public class SimpleResource extends Object implements CollectionResourceProvider
CollectionResourceProvider
that just echos back the operation performed.Constructor and Description |
---|
SimpleResource() |
Modifier and Type | Method and Description |
---|---|
Promise<ActionResponse,ResourceException> |
actionCollection(Context context,
ActionRequest request)
Performs the provided
action
against the resource collection. |
Promise<ActionResponse,ResourceException> |
actionInstance(Context context,
String resourceId,
ActionRequest request)
Performs the provided
action against a resource within the collection. |
Promise<ResourceResponse,ResourceException> |
createInstance(Context context,
CreateRequest request)
Adds a new resource instance to the collection. |
Promise<ResourceResponse,ResourceException> |
deleteInstance(Context context,
String resourceId,
DeleteRequest request)
Removes a resource instance from the collection. |
Promise<ResourceResponse,ResourceException> |
patchInstance(Context context,
String resourceId,
PatchRequest request)
Patches an existing resource within the collection. |
Promise<QueryResponse,ResourceException> |
queryCollection(Context context,
QueryRequest request,
QueryResourceHandler handler)
Searches the collection for all resources which match the query request
criteria. |
Promise<ResourceResponse,ResourceException> |
readInstance(Context context,
String resourceId,
ReadRequest request)
Reads an existing resource within the collection. |
Promise<ResourceResponse,ResourceException> |
updateInstance(Context context,
String resourceId,
UpdateRequest request)
Updates an existing resource within the collection. |
public Promise<ActionResponse,ResourceException> actionCollection(Context context, ActionRequest request)
action
against the resource collection.actionCollection
in interface CollectionResourceProvider
context
- The request server context.request
- The action request.Promise
containing the result of the operation.RequestHandler.handleAction(Context, ActionRequest)
public Promise<ActionResponse,ResourceException> actionInstance(Context context, String resourceId, ActionRequest request)
action
against a resource within the collection.actionInstance
in interface CollectionResourceProvider
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)
public 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()
.
createInstance
in interface CollectionResourceProvider
context
- The request server context.request
- The create request.Promise
containing the result of the operation.RequestHandler.handleCreate(Context, CreateRequest)
,
CreateRequest.getNewResourceId()
public Promise<ResourceResponse,ResourceException> deleteInstance(Context context, String resourceId, DeleteRequest request)
Removes
a resource instance from the collection.deleteInstance
in interface CollectionResourceProvider
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)
public Promise<ResourceResponse,ResourceException> patchInstance(Context context, String resourceId, PatchRequest request)
Patches
an existing resource within the collection.patchInstance
in interface CollectionResourceProvider
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)
public 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).
queryCollection
in interface CollectionResourceProvider
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)
public Promise<ResourceResponse,ResourceException> readInstance(Context context, String resourceId, ReadRequest request)
Reads
an existing resource within the collection.readInstance
in interface CollectionResourceProvider
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)
public Promise<ResourceResponse,ResourceException> updateInstance(Context context, String resourceId, UpdateRequest request)
Updates
an existing resource within the collection.updateInstance
in interface CollectionResourceProvider
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 © 2025 Open Identity Platform Community. All rights reserved.