Class AbstractDelegatingResourceServiceBroker
- java.lang.Object
-
- org.onehippo.cms7.crisp.api.broker.AbstractDelegatingResourceServiceBroker
-
- All Implemented Interfaces:
ResourceServiceBroker
public abstract class AbstractDelegatingResourceServiceBroker extends Object implements ResourceServiceBroker
Abstract delegating Resource Service Broker adaptor class.
-
-
Constructor Summary
Constructors Constructor Description AbstractDelegatingResourceServiceBroker(ResourceServiceBroker delegated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
findResources(String resourceSpace, String baseAbsPath)
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.Resource
findResources(String resourceSpace, String baseAbsPath, Map<String,Object> pathVariables)
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.Resource
findResources(String resourceSpace, String baseAbsPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.Resource
findResources(String resourceSpace, String baseAbsPath, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.ResourceBeanMapper
getResourceBeanMapper(String resourceSpace)
Returns a properResourceBeanMapper
for the givenresourceSpace
.ResourceDataCache
getResourceDataCache(String resourceSpace)
Returns a proper resource cache store representation (ResourceDataCache
) for the specifiedresourceSpace
, or null if caching is disabled.Resource
resolve(String resourceSpace, String absPath)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.Resource
resolve(String resourceSpace, String absPath, Map<String,Object> pathVariables)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.Resource
resolve(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.Resource
resolve(String resourceSpace, String absPath, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.Binary
resolveBinary(String resourceSpace, String absPath)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.Binary
resolveBinary(String resourceSpace, String absPath, Map<String,Object> pathVariables)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.Binary
resolveBinary(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.Binary
resolveBinary(String resourceSpace, String absPath, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.Resource
resolveBinaryAsResource(String resourceSpace, String absPath)
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.Resource
resolveBinaryAsResource(String resourceSpace, String absPath, Map<String,Object> pathVariables)
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.Resource
resolveBinaryAsResource(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.Resource
resolveBinaryAsResource(String resourceSpace, String absPath, ExchangeHint exchangeHint)
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.URI
resolveFullURI(String resourceSpace, String absPath)
Resolves a full URI determined and resolved for the specificresourceSpace
and theabsPath
.URI
resolveFullURI(String resourceSpace, String absPath, Map<String,Object> pathVariables)
Resolves a full URI determined and resolved for the specificresourceSpace
and theabsPath
.ResourceLink
resolveLink(String resourceSpace, Resource resource)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves aResourceLink
for the givenresource
.ResourceLink
resolveLink(String resourceSpace, Resource resource, Map<String,Object> linkVariables)
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves aResourceLink
for the givenresource
with passinglinkVariables
that can be used by implementation to expand its internal link generation template.
-
-
-
Constructor Detail
-
AbstractDelegatingResourceServiceBroker
public AbstractDelegatingResourceServiceBroker(ResourceServiceBroker delegated)
-
-
Method Detail
-
resolve
public Resource resolve(String resourceSpace, String absPath) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.- Specified by:
resolve
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
- Returns:
- single
Resource
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolve
public Resource resolve(String resourceSpace, String absPath, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolve
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
exchangeHint
- a message exchange hint for the backend- Returns:
- single
Resource
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolve
public Resource resolve(String resourceSpace, String absPath, Map<String,Object> pathVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.- Specified by:
resolve
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
pathVariables
- the variables to expand the template given byabsPath
- Returns:
- single
Resource
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolve
public Resource resolve(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleResource
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolve
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
pathVariables
- the variables to expand the template given byabsPath
exchangeHint
- a message exchange hint for the backend- Returns:
- single
Resource
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinary
public Binary resolveBinary(String resourceSpace, String absPath) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.- Specified by:
resolveBinary
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
- Returns:
- single
Binary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinary
public Binary resolveBinary(String resourceSpace, String absPath, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolveBinary
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
exchangeHint
- a message exchange hint for the backend- Returns:
- single
Binary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinary
public Binary resolveBinary(String resourceSpace, String absPath, Map<String,Object> pathVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.- Specified by:
resolveBinary
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
pathVariables
- the variables to expand the template given byabsPath
- Returns:
- single
Binary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinary
public Binary resolveBinary(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves singleBinary
representation byabsPath
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolveBinary
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
pathVariables
- the variables to expand the template given byabsPath
exchangeHint
- a message exchange hint for the backend- Returns:
- single
Binary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinaryAsResource
public Resource resolveBinaryAsResource(String resourceSpace, String absPath) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.- Specified by:
resolveBinaryAsResource
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
- Returns:
- a
Resource
object converted from the singleBinary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinaryAsResource
public Resource resolveBinaryAsResource(String resourceSpace, String absPath, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolveBinaryAsResource
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
exchangeHint
- a message exchange hint for the backend- Returns:
- a
Resource
object converted from the singleBinary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinaryAsResource
public Resource resolveBinaryAsResource(String resourceSpace, String absPath, Map<String,Object> pathVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.- Specified by:
resolveBinaryAsResource
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
pathVariables
- the variables to expand the template given byabsPath
- Returns:
- a
Resource
object converted from the singleBinary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveBinaryAsResource
public Resource resolveBinaryAsResource(String resourceSpace, String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
, resolves singleBinary
representation byabsPath
, and converts theBinary
representation into aResource
.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
resolveBinaryAsResource
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aBinary
pathVariables
- the variables to expand the template given byabsPath
exchangeHint
- a message exchange hint for the backend- Returns:
- a
Resource
object converted from the singleBinary
representation byabsPath
- Throws:
ResourceException
- if resource resolution operation fails
-
findResources
public Resource findResources(String resourceSpace, String baseAbsPath) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.baseAbsPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenbaseAbsPath
can be a URI path or part of URL. Or, as an example, thebaseAbsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.- Specified by:
findResources
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
baseAbsPath
- base absolute path of aResource
- Returns:
- a parent
Resource
representation which contains a collection of childResource
representations - Throws:
ResourceException
- if resource resolution operation fails
-
findResources
public Resource findResources(String resourceSpace, String baseAbsPath, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.baseAbsPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenbaseAbsPath
can be a URI path or part of URL. Or, as an example, thebaseAbsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
findResources
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
baseAbsPath
- base absolute path of aResource
exchangeHint
- a message exchange hint for the backend- Returns:
- a parent
Resource
representation which contains a collection of childResource
representations - Throws:
ResourceException
- if resource resolution operation fails
-
findResources
public Resource findResources(String resourceSpace, String baseAbsPath, Map<String,Object> pathVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.baseAbsPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenbaseAbsPath
can be a URI path or part of URL. Or, as an example, thebaseAbsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
baseAbsPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andbaseAbsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.- Specified by:
findResources
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
baseAbsPath
- base absolute path of aResource
pathVariables
- the variables to expand the template given byabsPath
- Returns:
- a parent
Resource
representation which contains a collection of childResource
representations - Throws:
ResourceException
- if resource resolution operation fails
-
findResources
public Resource findResources(String resourceSpace, String baseAbsPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and searchResource
representations frombaseAbsPath
and returns a parentResource
representation which contains a collection of childResource
representations.baseAbsPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenbaseAbsPath
can be a URI path or part of URL. Or, as an example, thebaseAbsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
baseAbsPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andbaseAbsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
when making a real request to the backend.If a non-null
exchangeHint
is given, then it can be understood by the specificResourceResolver
implementation for its specific backend.- Specified by:
findResources
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
baseAbsPath
- base absolute path of aResource
pathVariables
- the variables to expand the template given byabsPath
exchangeHint
- a message exchange hint for the backend- Returns:
- a parent
Resource
representation which contains a collection of childResource
representations - Throws:
ResourceException
- if resource resolution operation fails
-
resolveLink
public ResourceLink resolveLink(String resourceSpace, Resource resource) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves aResourceLink
for the givenresource
.- Specified by:
resolveLink
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
resource
- resource representation- Returns:
- a
ResourceLink
for the givenresource
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveLink
public ResourceLink resolveLink(String resourceSpace, Resource resource, Map<String,Object> linkVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a properResourceResolver
by the specifiedresourceSpace
and resolves aResourceLink
for the givenresource
with passinglinkVariables
that can be used by implementation to expand its internal link generation template.How the
linkVariables
is used in link generation template expansion is totally up to an implementation.- Specified by:
resolveLink
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
resource
- resource representationlinkVariables
- the variables to expand the internal link generation template- Returns:
- a
ResourceLink
for the givenresource
- Throws:
ResourceException
- if resource resolution operation fails
-
getResourceDataCache
public ResourceDataCache getResourceDataCache(String resourceSpace) throws ResourceException
Description copied from interface:ResourceServiceBroker
Returns a proper resource cache store representation (ResourceDataCache
) for the specifiedresourceSpace
, or null if caching is disabled.An implementation may return a default resource cache store representation (
ResourceDataCache
) as a fallback if the resolvedResourceResolver
doesn't have its ownResourceDataCache
instance (in other words, if the resolvedResourceCacheResolvable.getResourceDataCache()
return null).If an underlying resource resolver is explicitly disabled on caching (in other words, if the resolved
ResourceCacheResolvable.isCacheEnabled()
returns false), it should return null.- Specified by:
getResourceDataCache
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
- Returns:
- a proper resource cache store representation (
ResourceDataCache
) for the specifiedresourceSpace
, or a fallbackResourceDataCache
if the resolvedResourceResolver
doesn't have its ownResourceDataCache
instance - Throws:
ResourceException
- if resource space is not found
-
getResourceBeanMapper
public ResourceBeanMapper getResourceBeanMapper(String resourceSpace) throws ResourceException
Description copied from interface:ResourceServiceBroker
Returns a properResourceBeanMapper
for the givenresourceSpace
.- Specified by:
getResourceBeanMapper
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
- Returns:
- a proper
ResourceBeanMapper
for the givenresourceSpace
- Throws:
ResourceException
- if resource space is not found
-
resolveFullURI
public URI resolveFullURI(String resourceSpace, String absPath) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a full URI determined and resolved for the specificresourceSpace
and theabsPath
. Or returns null if the backend cannot support a full URI access.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.- Specified by:
resolveFullURI
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
- Returns:
- URI representation by
absPath
- Throws:
ResourceException
- if resource resolution operation fails
-
resolveFullURI
public URI resolveFullURI(String resourceSpace, String absPath, Map<String,Object> pathVariables) throws ResourceException
Description copied from interface:ResourceServiceBroker
Resolves a full URI determined and resolved for the specificresourceSpace
and theabsPath
. Or returns null if the backend cannot support a full URI access.absPath
is a domain-specific path template that should be meaningful to the backend. For example, if the backend is a REST API, thenabsPath
can be a URI path or part of URL. Or, as an example, theabsPath
can be an index name of a search index, table name of databases or node path in JCR, totally depending onResourceResolver
implementations.The
absPath
template is expanded using the given path variables (pathVariables
), if any. For example, ifpathVariables
looks like{"var1":"hello","var2":"world"}
andabsPath
is".../some/path/{var1}/{var2}/overview"
, then it is expanded to".../some/path/hello/world/overview"
by thepathVariables
.- Specified by:
resolveFullURI
in interfaceResourceServiceBroker
- Parameters:
resourceSpace
- Resource space name to resolve a properResourceResolver
absPath
- absolute path of aResource
pathVariables
- the variables to expand the template given byabsPath
- Returns:
- URI representation by
absPath
- Throws:
ResourceException
- if resource resolution operation fails
-
-