public interface CollectionResourceProvider
NOTE: field filtering alters the structure of a JSON resource and MUST only be performed once while processing a request. It is therefore the responsibility of front-end implementations (e.g. HTTP listeners, Servlets, etc) to perform field filtering. Request handler and resource provider implementations SHOULD NOT filter fields, but MAY choose to optimise their processing in order to return a resource containing only the fields targeted by the field filters.
Modifier and Type | Method and Description |
---|---|
default Promise<ActionResponse,ResourceException> |
actionCollection(Context context,
ActionRequest request)
Performs the provided
action
against the resource collection. |
default Promise<ActionResponse,ResourceException> |
actionInstance(Context context,
String resourceId,
ActionRequest request)
Performs the provided
action against a resource within the collection. |
default Promise<ResourceResponse,ResourceException> |
createInstance(Context context,
CreateRequest request)
Adds a new resource instance to the collection. |
default Promise<ResourceResponse,ResourceException> |
deleteInstance(Context context,
String resourceId,
DeleteRequest request)
Removes a resource instance from the collection. |
default Promise<ResourceResponse,ResourceException> |
patchInstance(Context context,
String resourceId,
PatchRequest request)
Patches an existing resource within the collection. |
default Promise<QueryResponse,ResourceException> |
queryCollection(Context context,
QueryRequest request,
QueryResourceHandler handler)
Searches the collection for all resources which match the query request
criteria. |
default Promise<ResourceResponse,ResourceException> |
readInstance(Context context,
String resourceId,
ReadRequest request)
Reads an existing resource within the collection. |
default Promise<ResourceResponse,ResourceException> |
updateInstance(Context context,
String resourceId,
UpdateRequest request)
Updates an existing resource within the collection. |
default Promise<ActionResponse,ResourceException> actionCollection(Context context, ActionRequest request)
action
against the resource collection.context
- The request server context.request
- The action request.Promise
containing the result of the operation.RequestHandler.handleAction(Context, ActionRequest)
default Promise<ActionResponse,ResourceException> actionInstance(Context context, String resourceId, ActionRequest request)
action
against a resource within the collection.context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The action request.Promise
containing the result of the operation.RequestHandler.handleAction(Context, ActionRequest)
default Promise<ResourceResponse,ResourceException> createInstance(Context context, CreateRequest request)
Adds
a new resource instance to the collection.
Create requests are targeted at the collection itself and may include a
user-provided resource ID for the new resource as part of the request
itself. The user-provider resource ID may be accessed using the method
CreateRequest.getNewResourceId()
.
context
- The request server context.request
- The create request.Promise
containing the result of the operation.RequestHandler.handleCreate(Context, CreateRequest)
,
CreateRequest.getNewResourceId()
default Promise<ResourceResponse,ResourceException> deleteInstance(Context context, String resourceId, DeleteRequest request)
Removes
a resource instance from the collection.context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The delete request.Promise
containing the result of the operation.RequestHandler.handleDelete(Context, DeleteRequest)
default Promise<ResourceResponse,ResourceException> patchInstance(Context context, String resourceId, PatchRequest request)
Patches
an existing resource within the collection.context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The patch request.Promise
containing the result of the operation.RequestHandler.handlePatch(Context, PatchRequest)
default Promise<QueryResponse,ResourceException> queryCollection(Context context, QueryRequest request, QueryResourceHandler handler)
Searches
the collection for all resources which match the query request
criteria.
Implementations must invoke
QueryResourceHandler.handleResource(ResourceResponse)
for each resource
which matches the query criteria. Once all matching resources have been
returned implementations are required to return either a
QueryResponse
if the query has completed successfully, or
ResourceException
if the query did not complete successfully
(even if some matching resources were returned).
context
- The request server context.request
- The query request.handler
- The query resource handler to be notified for each matching
resource.Promise
containing the result of the operation.RequestHandler.handleQuery(Context, QueryRequest, QueryResourceHandler)
default Promise<ResourceResponse,ResourceException> readInstance(Context context, String resourceId, ReadRequest request)
Reads
an existing resource within the collection.context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The read request.Promise
containing the result of the operation.RequestHandler.handleRead(Context, ReadRequest)
default Promise<ResourceResponse,ResourceException> updateInstance(Context context, String resourceId, UpdateRequest request)
Updates
an existing resource within the collection.context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The update request.Promise
containing the result of the operation.RequestHandler.handleUpdate(Context, UpdateRequest)
Copyright © 2010-2018, ForgeRock All Rights Reserved.