Interface QueriableResourceProvider
-
- All Superinterfaces:
ResourceProvider
@Deprecated @ConsumerType public interface QueriableResourceProvider extends ResourceProvider
Deprecated.Use theResourceProvider
A queriable resource provider is an extension of a resource provider. This extension is supported for services directly implementing theResourceProvider
interface andResourceProvider
s returned through aResourceProviderFactory
.- Since:
- 2.2 (Sling API Bundle 2.2.0)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LANGUAGES
Deprecated.The name of the service registration property containing the supported languages of the resource provider (value is "provider.query.languages").-
Fields inherited from interface org.apache.sling.api.resource.ResourceProvider
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Iterator<Resource>
findResources(ResourceResolver resolver, java.lang.String query, java.lang.String language)
Deprecated.Searches for resources using the given query formulated in the given language.java.util.Iterator<ValueMap>
queryResources(ResourceResolver resolver, java.lang.String query, java.lang.String language)
Deprecated.Queries the storage using the given query formulated in the given language.-
Methods inherited from interface org.apache.sling.api.resource.ResourceProvider
getResource, getResource, listChildren
-
-
-
-
Field Detail
-
LANGUAGES
static final java.lang.String LANGUAGES
Deprecated.The name of the service registration property containing the supported languages of the resource provider (value is "provider.query.languages"). If the resource provider is delivered by aResourceProviderFactory
this property should be declared on the factory.- See Also:
- Constant Field Values
-
-
Method Detail
-
findResources
java.util.Iterator<Resource> findResources(ResourceResolver resolver, java.lang.String query, java.lang.String language)
Deprecated.Searches for resources using the given query formulated in the given language.The semantic meaning of the query and language depend on the actual implementation and storage used for the resources. For JCR repository being used as storage, the query and language parameters are used to create a JCR
Query
through theQueryManager
. The result returned is then based on theNodeIterator
provided by the query result.- Parameters:
resolver
- The resource resolverquery
- The query string to use to find the resources.language
- The language in which the query is formulated.- Returns:
- An
Iterator
ofResource
objects matching the query. If no resources match,null
might be returned instead of an empty iterator. - Throws:
QuerySyntaxException
- If the query is not syntactically correct according to the query language indicator or if the query language is not supported as specified inLANGUAGES
.SlingException
- If an error occurs querying for the resources.java.lang.IllegalStateException
- if this resource provider has already been closed.
-
queryResources
java.util.Iterator<ValueMap> queryResources(ResourceResolver resolver, java.lang.String query, java.lang.String language)
Deprecated.Queries the storage using the given query formulated in the given language.The semantic meaning of the query and language depend on the actual implementation and storage used for the resources. For JCR repository being used as storage, the query and language parameters are used to create a JCR
Query
through theQueryManager
. The result returned is then based on theRowIterator
provided by the query result. The map returned for each row is indexed by the column name and the column value is the JCRValue
object converted into the respective Java object, such asBoolean
for a value of property type Boolean.- Parameters:
resolver
- The resource resolverquery
- The query string to use to find the resources.language
- The language in which the query is formulated.- Returns:
- An
Iterator
ofMap
instances providing access to the query result. If no resources match,null
might be returned instead of an empty iterator. - Throws:
QuerySyntaxException
- If the query is not syntactically correct according to the query language indicator or if the query language is not supported as specified inLANGUAGES
.SlingException
- If an error occurs querying for the resources.java.lang.IllegalStateException
- if this resource provider has already been closed.
-
-