Interface QueryResourceHandler
- All Known Implementing Classes:
IdentifierQueryResourceHandler
A query result completion handler may be specified when performing query
requests using a Connection object. The handleResource(org.forgerock.json.resource.ResourceResponse)
method is invoked for each resource which matches the query criteria,
followed by returning a QueryResponse or a ResourceException
indicating that no more JSON resources will be returned.
Implementations of these methods should complete in a timely manner so as to avoid keeping the invoking thread from dispatching to other completion handlers.
Synchronization note: each invocation of
handleResource for a resource happens-before the invocation of handleResource for the next
resource. Invocation of handleResource for the final resource
happens-before returning a QueryResponse or a
ResourceException are invoked with the final query status. In other
words, query resource handler method invocations will occur sequentially and
one at a time.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhandleResource(ResourceResponse resource) Invoked each time a matching JSON resource is returned from a query request.
-
Method Details
-
handleResource
Invoked each time a matching JSON resource is returned from a query request. More specifically, if a query request matches 10 resources, then this method will be invoked 10 times, once for each matching resource.Refer to
RequestHandler.handleQuery(org.forgerock.services.context.Context, QueryRequest, QueryResourceHandler)for information regarding the concurrency and the order in which events are processed.- Parameters:
resource- The matching JSON resource.- Returns:
trueif this handler should continue to be notified of any remaining matching JSON resources, orfalseif the remaining JSON resources should be skipped for some reason (e.g. a client side size limit has been reached).
-