Interface QueryResourceHandler
-
- All Known Implementing Classes:
IdentifierQueryResourceHandler
public interface QueryResourceHandler
A completion handler for consuming the results of a query request.A query result completion handler may be specified when performing query requests using a
Connection
object. ThehandleResource(org.forgerock.json.resource.ResourceResponse)
method is invoked for each resource which matches the query criteria, followed by returning aQueryResponse
or aResourceException
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 ofhandleResource
for the next resource. Invocation ofhandleResource
for the final resource happens-before returning aQueryResponse
or aResourceException
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
handleResource(ResourceResponse resource)
Invoked each time a matching JSON resource is returned from a query request.
-
-
-
Method Detail
-
handleResource
boolean handleResource(ResourceResponse resource)
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:
true
if this handler should continue to be notified of any remaining matching JSON resources, orfalse
if the remaining JSON resources should be skipped for some reason (e.g. a client side size limit has been reached).
-
-