Author: cziegeler
Date: Sun Jun 14 07:42:00 2015
New Revision: 1685363
URL: http://svn.apache.org/r1685363
Log:
SLING-4752 : New query api - throw exception if sorting or paginating is
requested across providers
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java?rev=1685363&r1=1685362&r2=1685363&view=diff
==============================================================================
---
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
(original)
+++
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/query/QueryManager.java
Sun Jun 14 07:42:00 2015
@@ -38,10 +38,19 @@ public interface QueryManager {
/**
* Execute the given query in the context of the resource resolver.
*
+ * In general a search is performed across all resource providers
supporting
+ * search. However, sorting and pagination across providers can't be done
in
+ * a general but fast way, therefore as soon as a query instructions object
+ * is provided, the search is only performed against a single provider. If
+ * the query is restricted by path, the provider handling that path is
used.
+ * If potentially more than one provider is targeted and a query
instructions
+ * is provided, an {@code IllegalArgumentException} is thrown.
+ *
* @param resolver The resource resolver
* @param q The query
* @param qi The optional query instructions
* @return An iterator of resources - the result might be empty.
+ * @throws IllegalArgumentException If the query is invalid.
*/
@Nonnull Iterator<Resource> find(@Nonnull ResourceResolver resolver,
@Nonnull Query q,