public interface ResourceResolver extends ResourceCacheResolvable
Resource
(s).Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any resources used in this
ResourceResolver instance with the backend. |
Resource |
findResources(String baseAbsPath)
|
Resource |
findResources(String baseAbsPath,
ExchangeHint exchangeHint)
|
Resource |
findResources(String baseAbsPath,
Map<String,Object> pathVariables)
|
Resource |
findResources(String baseAbsPath,
Map<String,Object> pathVariables,
ExchangeHint exchangeHint)
|
ResourceBeanMapper |
getResourceBeanMapper()
Returns a
ResourceBeanMapper . |
ResourceLinkResolver |
getResourceLinkResolver()
Returns a domain-specific
ResourceLinkResolver for a Resource representation generated by
this ResourceResolver implementation. |
boolean |
isLive()
Returns true if the
ResourceResolver service for a backend is still alive. |
void |
refresh()
Refreshes any local state changes, if any.
|
Resource |
resolve(String absPath)
Resolves single
Resource representation by absPath . |
Resource |
resolve(String absPath,
ExchangeHint exchangeHint)
|
Resource |
resolve(String absPath,
Map<String,Object> pathVariables)
Resolves single
Resource representation by absPath . |
Resource |
resolve(String absPath,
Map<String,Object> pathVariables,
ExchangeHint exchangeHint)
Resolves single
Resource representation by absPath . |
Binary |
resolveBinary(String absPath)
Resolves single
Binary representation by absPath . |
Binary |
resolveBinary(String absPath,
ExchangeHint exchangeHint)
Resolves single
Binary representation by absPath . |
Binary |
resolveBinary(String absPath,
Map<String,Object> pathVariables)
Resolves single
Binary representation by absPath . |
Binary |
resolveBinary(String absPath,
Map<String,Object> pathVariables,
ExchangeHint exchangeHint)
Resolves single
Binary representation by absPath . |
Resource |
resolveBinaryAsResource(String absPath)
|
Resource |
resolveBinaryAsResource(String absPath,
ExchangeHint exchangeHint)
|
Resource |
resolveBinaryAsResource(String absPath,
Map<String,Object> pathVariables)
|
Resource |
resolveBinaryAsResource(String absPath,
Map<String,Object> pathVariables,
ExchangeHint exchangeHint)
|
URI |
resolveFullURI(String absPath)
Resolves a full URI determined and resolved for the
absPath . |
URI |
resolveFullURI(String absPath,
Map<String,Object> pathVariables)
Resolves a full URI determined and resolved for the
absPath . |
createCacheKey, fromCacheData, getResourceDataCache, isCacheable, isCacheEnabled, toCacheData
Resource resolve(String absPath) throws ResourceException
Resource
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
absPath
- absolute path of a Resource
Resource
representation by absPath
ResourceException
- if resource resolution operation failsResource resolve(String absPath, ExchangeHint exchangeHint) throws ResourceException
Resource
representation by absPath
with the optional exchangeHint
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Resource
exchangeHint
- a message exchange hint for the backendResource
representation by absPath
ResourceException
- if resource resolution operation failsResource resolve(String absPath, Map<String,Object> pathVariables) throws ResourceException
Resource
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
absPath
- absolute path of a Resource
pathVariables
- the variables to expand the template given by absPath
Resource
representation by absPath
ResourceException
- if resource resolution operation failsResource resolve(String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Resource
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Resource
pathVariables
- the variables to expand the template given by absPath
exchangeHint
- a message exchange hint for the backendResource
representation by absPath
ResourceException
- if resource resolution operation failsBinary resolveBinary(String absPath) throws ResourceException
Binary
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
absPath
- absolute path of a Binary
Binary
representation by absPath
ResourceException
- if resource resolution operation failsBinary resolveBinary(String absPath, ExchangeHint exchangeHint) throws ResourceException
Binary
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Binary
exchangeHint
- a message exchange hint for the backendBinary
representation by absPath
ResourceException
- if resource resolution operation failsBinary resolveBinary(String absPath, Map<String,Object> pathVariables) throws ResourceException
Binary
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
absPath
- absolute path of a Binary
pathVariables
- the variables to expand the template given by absPath
Binary
representation by absPath
ResourceException
- if resource resolution operation failsBinary resolveBinary(String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Binary
representation by absPath
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Binary
pathVariables
- the variables to expand the template given by absPath
exchangeHint
- a message exchange hint for the backendBinary
representation by absPath
ResourceException
- if resource resolution operation failsResource resolveBinaryAsResource(String absPath) throws ResourceException
Binary
representation by absPath
, and convert it to a Resource
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
absPath
- absolute path of a Binary
Resource
object converted from the single Binary
representation by absPath
ResourceException
- if resource resolution operation failsResource resolveBinaryAsResource(String absPath, ExchangeHint exchangeHint) throws ResourceException
Binary
representation by absPath
, and convert it to a Resource
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Binary
exchangeHint
- a message exchange hint for the backendResource
object converted from the single Binary
representation by absPath
ResourceException
- if resource resolution operation failsResource resolveBinaryAsResource(String absPath, Map<String,Object> pathVariables) throws ResourceException
Binary
representation by absPath
, and convert it to a Resource
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
absPath
- absolute path of a Binary
pathVariables
- the variables to expand the template given by absPath
Resource
object converted from the single Binary
representation by absPath
ResourceException
- if resource resolution operation failsResource resolveBinaryAsResource(String absPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Binary
representation by absPath
, and convert it to a Resource
.
absPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
absPath
- absolute path of a Binary
pathVariables
- the variables to expand the template given by absPath
exchangeHint
- a message exchange hint for the backendResource
object converted from the single Binary
representation by absPath
ResourceException
- if resource resolution operation failsResource findResources(String baseAbsPath) throws ResourceException
Resource
representations from baseAbsPath
and returns a parent Resource
representation
which contains a collection of child Resource
representations.
baseAbsPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then baseAbsPath
can be a URI path or part of URL. Or, as
an example, the baseAbsPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
baseAbsPath
- base absolute path of a Resource
Resource
representation which contains a collection of child Resource
representationsResourceException
- if resource resolution operation failsResource findResources(String baseAbsPath, ExchangeHint exchangeHint) throws ResourceException
Resource
representations from baseAbsPath
and returns a parent Resource
representation
which contains a collection of child Resource
representations.
baseAbsPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then baseAbsPath
can be a URI path or part of URL. Or, as
an example, the baseAbsPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
baseAbsPath
- base absolute path of a Resource
exchangeHint
- a message exchange hint for the backendResource
representation which contains a collection of child Resource
representationsResourceException
- if resource resolution operation failsResource findResources(String baseAbsPath, Map<String,Object> pathVariables) throws ResourceException
Resource
representations from baseAbsPath
and returns a parent Resource
representation
which contains a collection of child Resource
representations.
baseAbsPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then baseAbsPath
can be a URI path or part of URL. Or, as
an example, the baseAbsPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The baseAbsPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and baseAbsPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
baseAbsPath
- base absolute path of a Resource
pathVariables
- the variables to expand the template given by absPath
Resource
representation which contains a collection of child Resource
representationsResourceException
- if resource resolution operation failsResource findResources(String baseAbsPath, Map<String,Object> pathVariables, ExchangeHint exchangeHint) throws ResourceException
Resource
representations from baseAbsPath
and returns a parent Resource
representation
which contains a collection of child Resource
representations.
baseAbsPath
is a domain-specific path template that should be meaningful to the backend.
For example, if the backend is a REST API, then baseAbsPath
can be a URI path or part of URL. Or, as
an example, the baseAbsPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The baseAbsPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and baseAbsPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
when making a real request
to the backend.
If a non-null exchangeHint
is given, then it can be understood by the specific ResourceResolver
implementation for its specific backend.
baseAbsPath
- base absolute path of a Resource
pathVariables
- the variables to expand the template given by absPath
exchangeHint
- a message exchange hint for the backendResource
representation which contains a collection of child Resource
representationsResourceException
- if resource resolution operation failsboolean isLive() throws ResourceException
ResourceResolver
service for a backend is still alive. Returns true by default.
An implementation may choose to implement this method to check if the underlying connection with the
backend is still alive in this method. In REST API based implementation, it is likely to simply return true
in this method. However, for example, an implementation with JCR backend may use javax.jcr.Session#isLive()
method in its implementation.
ResourceResolver
service for a backend is still alive. true by defaultResourceException
- if resource resolution operation failsvoid refresh() throws ResourceException
An implementation may choose to implement this method to give a chance to refresh local states. In REST
API based implementation, it is likely to simply do nothing in this method. However, for example, an implementation
with JCR backend may use javax.jcr.Session#refresh(boolean)
method in its implementation.
ResourceException
- if resource resolution operation failsvoid close() throws ResourceException
ResourceResolver
instance with the backend.
An implementation may choose to implement this method to give a chance to close any resources used in this implementation. In REST API based implementation, it is likely to simply do nothing in this method if the REST API is stateless. However, for example, an implementation with a stateful connection may close its connection to the backend in this method.
ResourceException
- if resource resolution operation failsResourceLinkResolver getResourceLinkResolver()
ResourceLinkResolver
for a Resource
representation generated by
this ResourceResolver
implementation.ResourceLinkResolver
for a Resource
representation generated by
this ResourceResolver
implementationResourceBeanMapper getResourceBeanMapper() throws ResourceException
ResourceBeanMapper
.ResourceBeanMapper
UnsupportedOperationException
- if a ResourceBeanMapper
is not supportedResourceException
URI resolveFullURI(String absPath) throws ResourceException
absPath
.
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, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
resourceSpace
- Resource space name to resolve a proper ResourceResolver
absPath
- absolute path of a Resource
absPath
ResourceException
- if resource resolution operation failsURI resolveFullURI(String absPath, Map<String,Object> pathVariables) throws ResourceException
absPath
.
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, then absPath
can be a URI path or part of URL. Or, as
an example, the absPath
can be an index name of a search index, table name of databases or node
path in JCR, totally depending on ResourceResolver
implementations.
The absPath
template is expanded using the given path variables (pathVariables
), if any.
For example, if pathVariables
looks like {"var1":"hello","var2":"world"}
and absPath
is ".../some/path/{var1}/{var2}/overview"
, then it is expanded to
".../some/path/hello/world/overview"
by the pathVariables
.
resourceSpace
- Resource space name to resolve a proper ResourceResolver
absPath
- absolute path of a Resource
pathVariables
- the variables to expand the template given by absPath
absPath
ResourceException
- if resource resolution operation failsCopyright © 2017–2020 Hippo B.V. (http://www.onehippo.com). All rights reserved.