public class DescribedSyncRequestHandlerAdapter extends Object implements Describable<ApiDescription,Request>
SynchronousRequestHandlerAdapter that exposes a described handler.Describable.Listener| Modifier and Type | Method and Description |
|---|---|
void |
addDescriptorListener(Describable.Listener listener)
Add a listener for API Descriptor changes.
|
ApiDescription |
api(ApiProducer<ApiDescription> producer)
Provide the API description for the component.
|
Promise<ActionResponse,ResourceException> |
handleAction(Context context,
ActionRequest request)
Handles performing an action on a resource, and optionally returns an
associated result.
|
ApiDescription |
handleApiRequest(Context context,
Request request)
Handle a request for the API Descriptor.
|
Promise<ResourceResponse,ResourceException> |
handleCreate(Context context,
CreateRequest request)
Adds a new JSON resource, returning a
Promise that will be
completed when the resource has been added. |
Promise<ResourceResponse,ResourceException> |
handleDelete(Context context,
DeleteRequest request)
Deletes a JSON resource, returning a
Promise that will be
completed when the resource has been deleted. |
Promise<ResourceResponse,ResourceException> |
handlePatch(Context context,
PatchRequest request)
Updates a JSON resource by applying a set of changes to its existing
content, returning a
Promise that will be completed when the
resource has been updated. |
Promise<QueryResponse,ResourceException> |
handleQuery(Context context,
QueryRequest request,
QueryResourceHandler handler)
Searches for all JSON resources matching a user specified set of
criteria, returning a
Promise that will be completed when the
search has completed. |
Promise<ResourceResponse,ResourceException> |
handleRead(Context context,
ReadRequest request)
Reads a JSON resource, returning a
Promise that will be
completed when the resource has been read. |
Promise<ResourceResponse,ResourceException> |
handleUpdate(Context context,
UpdateRequest request)
Updates a JSON resource by replacing its existing content with new
content, returning a
Promise that will be completed when the
resource has been updated. |
void |
removeDescriptorListener(Describable.Listener listener)
Remove a listener from API Descriptor changes.
|
public ApiDescription api(ApiProducer<ApiDescription> producer)
Describableapi in interface Describable<ApiDescription,Request>producer - The API producer that provides general information to be built into the descriptor.public ApiDescription handleApiRequest(Context context, Request request)
DescribablehandleApiRequest in interface Describable<ApiDescription,Request>context - The request context.request - The request.public void addDescriptorListener(Describable.Listener listener)
DescribableaddDescriptorListener in interface Describable<ApiDescription,Request>listener - The listener.public void removeDescriptorListener(Describable.Listener listener)
DescribableremoveDescriptorListener in interface Describable<ApiDescription,Request>listener - The listener.public Promise<ResourceResponse,ResourceException> handleUpdate(Context context, UpdateRequest request)
RequestHandlerPromise that will be completed when the
resource has been updated.
Update expects failure the following failure exceptions:
ForbiddenException if access to the resource is forbidden
NotSupportedException if the requested functionality is not
implemented/supported
PreconditionRequiredException if version is required, but is
null
PreconditionFailedException if version did not match the
existing resource
BadRequestException if the passed identifier or filter is
invalid
NotFoundException if the specified resource could not be
found.
handleUpdate in interface RequestHandlercontext - The request server context, such as associated principal.request - The update request.Promise containing the result of the operation.public Promise<ResourceResponse,ResourceException> handleRead(Context context, ReadRequest request)
RequestHandlerPromise that will be
completed when the resource has been read.
Read expects failure exceptions as follows:
ForbiddenException if access to the resource is forbidden.
NotSupportedException if the requested functionality is not
implemented/supported
BadRequestException if the passed identifier or filter is
invalid
NotFoundException if the specified resource could not be
found.
handleRead in interface RequestHandlercontext - The request server context, such as associated principal.request - The read request.Promise containing the result of the operation.public Promise<QueryResponse,ResourceException> handleQuery(Context context, QueryRequest request, QueryResourceHandler handler)
RequestHandlerPromise that will be completed when the
search has completed.
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).
Query expects failure exceptions as follows:
ForbiddenException if access to the resource is forbidden
NotSupportedException if the requested functionality is not
implemented/supported
BadRequestException if the passed identifier, parameters or
filter is invalid
NotFoundException if the specified resource could not be
found
handleQuery in interface RequestHandlercontext - The request server context, such as associated principal.request - The query request.handler - The query resource handler to be notified for each matching
resource.Promise containing the result of the operation.public Promise<ResourceResponse,ResourceException> handlePatch(Context context, PatchRequest request)
RequestHandlerPromise that will be completed when the
resource has been updated.
Patch expects failure exceptions as follows:
ForbiddenException if access to the resource is forbidden
NotSupportedException if the requested functionality is not
implemented/supported
PreconditionRequiredException if version is required, but is
null
PreconditionFailedException if version did not match the
existing resource
BadRequestException if the passed identifier or filter is
invalid
NotFoundException if the specified resource could not be
found
ConflictException if patch could not be applied for the given
resource state.
handlePatch in interface RequestHandlercontext - The request server context, such as associated principal.request - The patch request.Promise containing the result of the operation.public Promise<ResourceResponse,ResourceException> handleDelete(Context context, DeleteRequest request)
RequestHandlerPromise that will be
completed when the resource has been deleted.
Delete expects failure exceptions as follows:
ForbiddenException if access to the resource is forbidden
NotSupportedException if the requested functionality is not
implemented/supported
BadRequestException if the passed identifier is invalid
NotFoundException if the specified resource could not be
found
PreconditionRequiredException if version is required, but is
null
PreconditionFailedException if version did not match the
existing resource.
handleDelete in interface RequestHandlercontext - The request server context, such as associated principal.request - The delete request.Promise containing the result of the operation.public Promise<ResourceResponse,ResourceException> handleCreate(Context context, CreateRequest request)
RequestHandlerPromise that will be
completed when the resource has been added.
Create expects failure exceptions as follows:
ForbiddenException if access to the resource is forbidden.
NotSupportedException if the requested functionality is not
implemented/supported
PreconditionFailedException if a resource with the same ID
already exists
BadRequestException if the passed identifier or value is
invalid
NotFoundException if the specified id could not be resolved,
for example when an intermediate resource in the hierarchy does not
exist.
handleCreate in interface RequestHandlercontext - The request server context, such as associated principal.request - The create request.Promise containing the result of the operation.public Promise<ActionResponse,ResourceException> handleAction(Context context, ActionRequest request)
RequestHandlerActions are parametric; a set of named parameters is provided as input to the action. The action result is a JSON object structure composed of basic Java types; its overall structure is defined by a specific implementation.
On completion, the action result (or null) must be used to complete the
returned Promise. On failure, the returned Promise must
be completed with the exception.
Action expects failure exceptions as follows: ForbiddenException
if access to the resource is forbidden. NotSupportedException if
the requested functionality is not implemented/supported
BadRequestException if the passed identifier, parameters or
filter is invalid NotFoundException if the specified resource
could not be found.
handleAction in interface RequestHandlercontext - The request server context, such as associated principal.request - The action request.Promise containing the result of the operation.Copyright © 2025 Open Identity Platform Community. All rights reserved.