Package org.forgerock.json.resource
Class ResourceApiVersionSpecificationFilter
- java.lang.Object
-
- org.forgerock.json.resource.ResourceApiVersionSpecificationFilter
-
- All Implemented Interfaces:
Filter
public final class ResourceApiVersionSpecificationFilter extends Object implements Filter
AFilter
supporting the specification of resource API version configuration to be used when a request on a specific endpoint does not contain an Accept-API-Version header. TheResourceApiVersionSpecificationFilter.VersionSpecification
is then expected to set the preferred version if it is able to.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ResourceApiVersionSpecificationFilter.NoApiVersionHandler
Handler allowing products to extend behaviour when a request has no resource API version supplied.static class
ResourceApiVersionSpecificationFilter.ResourcePathAndVersion
Class representing a mapping between aResourcePath
and aVersion
.static class
ResourceApiVersionSpecificationFilter.ResourcePathAndVersionSpecification
ResourceApiVersionSpecificationFilter.VersionSpecification
supporting specification of a request's resource version based on its resource path.static interface
ResourceApiVersionSpecificationFilter.VersionSpecification
Mechanism supporting specification of a version on the request.
-
Constructor Summary
Constructors Constructor Description ResourceApiVersionSpecificationFilter(ResourceApiVersionSpecificationFilter.VersionSpecification versionSpecification)
Constructs a newResourceApiVersionSpecificationFilter
instance.
-
Method Summary
-
-
-
Constructor Detail
-
ResourceApiVersionSpecificationFilter
public ResourceApiVersionSpecificationFilter(ResourceApiVersionSpecificationFilter.VersionSpecification versionSpecification)
Constructs a newResourceApiVersionSpecificationFilter
instance.- Parameters:
versionSpecification
- TheResourceApiVersionSpecificationFilter.VersionSpecification
.
-
-
Method Detail
-
filterAction
public Promise<ActionResponse,ResourceException> filterAction(Context context, ActionRequest request, RequestHandler next)
Description copied from interface:Filter
Filters an action request.- Specified by:
filterAction
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The action request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterCreate
public Promise<ResourceResponse,ResourceException> filterCreate(Context context, CreateRequest request, RequestHandler next)
Description copied from interface:Filter
Filters a create request.- Specified by:
filterCreate
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The create request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterDelete
public Promise<ResourceResponse,ResourceException> filterDelete(Context context, DeleteRequest request, RequestHandler next)
Description copied from interface:Filter
Filters a delete request.- Specified by:
filterDelete
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The delete request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterPatch
public Promise<ResourceResponse,ResourceException> filterPatch(Context context, PatchRequest request, RequestHandler next)
Description copied from interface:Filter
Filters a patch request.- Specified by:
filterPatch
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The patch request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterQuery
public Promise<QueryResponse,ResourceException> filterQuery(Context context, QueryRequest request, QueryResourceHandler handler, RequestHandler next)
Description copied from interface:Filter
Filters a query request.Implementations which return results directly rather than forwarding the request should 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 aQueryResponse
if the query has completed successfully, orResourceException
if the query did not complete successfully (even if some matching resources were returned).- Specified by:
filterQuery
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The query request.handler
- The resource handler.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterRead
public Promise<ResourceResponse,ResourceException> filterRead(Context context, ReadRequest request, RequestHandler next)
Description copied from interface:Filter
Filters a read request.- Specified by:
filterRead
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The read request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
filterUpdate
public Promise<ResourceResponse,ResourceException> filterUpdate(Context context, UpdateRequest request, RequestHandler next)
Description copied from interface:Filter
Filters an update request.- Specified by:
filterUpdate
in interfaceFilter
- Parameters:
context
- The filter chain context.request
- The update request.next
- A request handler representing the remainder of the filter chain.- Returns:
- A
Promise
containing the result of the operation.
-
-