public interface SynchronousRequestHandler
RequestHandler
s. A
synchronous request handler will block the caller until an operation has
completed which may impact scalability in many environments, such as
application servers. Therefore it is recommended that request handlers which
are intended for use in production environments implement the asynchronous
RequestHandler
interface. This interface can be easily "mocked" and
is therefore suitable for use in unit tests.
A synchronous request handler can be adapted as a RequestHandler
using the Resources.asRequestHandler(SynchronousRequestHandler)
method.
For more documentation about the individual operations see
RequestHandler
.
Modifier and Type | Method and Description |
---|---|
ActionResponse |
handleAction(Context context,
ActionRequest request)
Handles performing an action on a resource, and optionally returns an
associated result.
|
ResourceResponse |
handleCreate(Context context,
CreateRequest request)
Adds a new JSON resource.
|
ResourceResponse |
handleDelete(Context context,
DeleteRequest request)
Deletes a JSON resource.
|
ResourceResponse |
handlePatch(Context context,
PatchRequest request)
Updates a JSON resource by applying a set of changes to its existing
content.
|
QueryResponse |
handleQuery(Context context,
QueryRequest request,
Collection<ResourceResponse> resources)
Searches for all JSON resources matching a user specified set of
criteria.
|
ResourceResponse |
handleRead(Context context,
ReadRequest request)
Reads a JSON resource.
|
ResourceResponse |
handleUpdate(Context context,
UpdateRequest request)
Updates a JSON resource by replacing its existing content with new
content.
|
ActionResponse handleAction(Context context, ActionRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The action request.null
result of the action.ResourceException
- If the request failed for some reason.RequestHandler.handleAction(Context, ActionRequest)
ResourceResponse handleCreate(Context context, CreateRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The create request.ResourceException
- If the request failed for some reason.RequestHandler.handleCreate(Context, CreateRequest)
ResourceResponse handleDelete(Context context, DeleteRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The delete request.ResourceException
- If the request failed for some reason.RequestHandler.handleDelete(Context, DeleteRequest)
ResourceResponse handlePatch(Context context, PatchRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The patch request.ResourceException
- If the request failed for some reason.RequestHandler.handlePatch(Context, PatchRequest)
QueryResponse handleQuery(Context context, QueryRequest request, Collection<ResourceResponse> resources) throws ResourceException
context
- The request server context, such as associated principal.request
- The query request.resources
- A non-null
collection into which matching resources
should be put.ResourceException
- If the request failed for some reason.RequestHandler.handleQuery(Context, QueryRequest, QueryResourceHandler)
ResourceResponse handleRead(Context context, ReadRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The read request.ResourceException
- If the request failed for some reason.RequestHandler.handleRead(Context, ReadRequest)
ResourceResponse handleUpdate(Context context, UpdateRequest request) throws ResourceException
context
- The request server context, such as associated principal.request
- The update request.ResourceException
- If the request failed for some reason.RequestHandler.handleUpdate(Context, UpdateRequest)
Copyright © 2010-2018, ForgeRock All Rights Reserved.