Class AnonymousProcessService
- java.lang.Object
-
- org.forgerock.selfservice.core.AnonymousProcessService
-
- All Implemented Interfaces:
RequestHandler
public final class AnonymousProcessService extends Object implements RequestHandler
Anonymous process service progresses a chain ofProgressStage
configurations, handling any required client interactions.- Since:
- 0.1.0
-
-
Constructor Summary
Constructors Constructor Description AnonymousProcessService(ProcessInstanceConfig config, ProgressStageProvider progressStageProvider, SnapshotTokenHandlerFactory tokenHandlerFactory, ProcessStore processStore, ClassLoader classLoader)
Initialises the anonymous process service with the passed config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<ActionResponse,ResourceException>
handleAction(Context context, ActionRequest request)
Handles performing an action on a resource, and optionally returns an associated result.Promise<ResourceResponse,ResourceException>
handleRead(Context context, ReadRequest request)
Reads a JSON resource, returning aPromise
that will be completed when the resource has been read.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.json.resource.RequestHandler
handleCreate, handleDelete, handlePatch, handleQuery, handleUpdate
-
-
-
-
Constructor Detail
-
AnonymousProcessService
@Inject public AnonymousProcessService(ProcessInstanceConfig config, ProgressStageProvider progressStageProvider, SnapshotTokenHandlerFactory tokenHandlerFactory, ProcessStore processStore, ClassLoader classLoader)
Initialises the anonymous process service with the passed config.- Parameters:
config
- service configurationprogressStageProvider
- progress stage providertokenHandlerFactory
- snapshot token handler factoryprocessStore
- store for locally persisted stateclassLoader
- class loader used for dynamic stage class instantiation
-
-
Method Detail
-
handleRead
public Promise<ResourceResponse,ResourceException> handleRead(Context context, ReadRequest request)
Description copied from interface:RequestHandler
Reads a JSON resource, returning aPromise
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/supportedBadRequestException
if the passed identifier or filter is invalidNotFoundException
if the specified resource could not be found.
- Specified by:
handleRead
in interfaceRequestHandler
- Parameters:
context
- The request server context, such as associated principal.request
- The read request.- Returns:
- A
Promise
containing the result of the operation.
-
handleAction
public Promise<ActionResponse,ResourceException> handleAction(Context context, ActionRequest request)
Description copied from interface:RequestHandler
Handles performing an action on a resource, and optionally returns an associated result. The execution of an action is allowed to incur side effects.Actions 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 returnedPromise
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/supportedBadRequestException
if the passed identifier, parameters or filter is invalidNotFoundException
if the specified resource could not be found.- Specified by:
handleAction
in interfaceRequestHandler
- Parameters:
context
- The request server context, such as associated principal.request
- The action request.- Returns:
- A
Promise
containing the result of the operation.
-
-