Class Action.ActionBuilder
java.lang.Object
org.forgerock.openam.auth.node.api.Action.ActionBuilder
- Enclosing class:
- Action
Builder for the
Action
.-
Method Summary
Modifier and TypeMethodDescriptionaddNodeType
(TreeContext context, String authName) Update the NodeType session property, and the NodeType sharedState value.addSessionHook
(Class<? extends TreeHook> sessionHook, UUID nodeId, String nodeType) Sets a class that will be run after successful login.Sets a class that will be run after successful login.addSessionHooks
(List<JsonValue> sessionHooks) Adds session hooks to the list.addWebhook
(String webhookName) Adds a webhook to the list.addWebhooks
(List<String> webhooks) Adds webhooks to the list.build()
Build the Action.putSessionProperty
(String key, String value) Add a new session property.Remove a previously set session property.replaceSharedState
(JsonValue sharedState) Replace the shared state.replaceTransientState
(JsonValue transientState) Replace the transient state.withDescription
(String description) Set a description for this action.withErrorMessage
(String errorMessage) Sets the error message to present to the caller when the FAILURE node is reached.withHeader
(String header) Set a header for this action.withIdentifiedIdentity
(AMIdentity identity) Set the identified identity that has been verified to exist in an identity store.withIdentifiedIdentity
(String username, IdType identityType) Set the identified identity that has been verified to exist in an identity store.withLockoutMessage
(String lockoutMessage) Sets the error message to present to the caller when the user is locked out.Set a stage for this action.withUniversalId
(String universalId) Deprecated.withUniversalId
(Optional<String> universalId) Deprecated.
-
Method Details
-
replaceTransientState
Replace the transient state.- Parameters:
transientState
- the new transient state.- Returns:
- the same instance of the ActionBuilder.
-
withHeader
Set a header for this action.- Parameters:
header
- the header for the action.- Returns:
- the same instance of the ActionBuilder.
-
withDescription
Set a description for this action.- Parameters:
description
- the description for this action.- Returns:
- the same instance of the ActionBuilder.
-
withStage
Set a stage for this action.- Parameters:
stage
- the stage for this action.- Returns:
- the same instance of the ActionBuilder.
-
withErrorMessage
Sets the error message to present to the caller when the FAILURE node is reached.It is up to the caller to apply localisation.
- Parameters:
errorMessage
- The error message.- Returns:
- the same instance of the ActionBuilder.
-
withLockoutMessage
Sets the error message to present to the caller when the user is locked out.It is up to the caller to apply localisation.
- Parameters:
lockoutMessage
- The lockout message.- Returns:
- the same instance of the ActionBuilder.
-
withUniversalId
Deprecated.Sets the universal id of the user object.- Parameters:
universalId
- The universal id of the user object.- Returns:
- the same instance of the ActionBuilder.
-
withUniversalId
Deprecated.Sets the universal id of the user object.If universalId is empty no action will take place.
- Parameters:
universalId
- The optional universal id of the user object.- Returns:
- the same instance of the ActionBuilder.
-
putSessionProperty
Add a new session property.- Parameters:
key
- The key for the property.value
- The value for the property.- Returns:
- the same instance of the ActionBuilder.
-
removeSessionProperty
Remove a previously set session property.- Parameters:
key
- The key for the property.- Returns:
- the same instance of the ActionBuilder.
-
addSessionHook
public Action.ActionBuilder addSessionHook(Class<? extends TreeHook> sessionHook, UUID nodeId, String nodeType) Sets a class that will be run after successful login. The class has to implementTreeHook
.- Parameters:
sessionHook
- The class to be run.nodeId
- The ID of the node.nodeType
- The type of the node.- Returns:
- the same instance of ActionBuilder
-
addSessionHook
public Action.ActionBuilder addSessionHook(Class<? extends TreeHook> sessionHook, UUID nodeId, String nodeType, JsonValue data) Sets a class that will be run after successful login. The class has to implementTreeHook
.- Parameters:
sessionHook
- The class to be run.nodeId
- The ID of the node.nodeType
- The type of the node.data
- The additional data for session hook.- Returns:
- the same instance of ActionBuilder
-
addSessionHooks
Adds session hooks to the list.- Parameters:
sessionHooks
- List of the hooks to add.- Returns:
- the same instance of ActionBuilder.
-
addWebhook
Adds a webhook to the list.- Parameters:
webhookName
- The webhook name created on the webhook service.- Returns:
- the same instance of ActionBuilder.
-
addWebhooks
Adds webhooks to the list.- Parameters:
webhooks
- List of webhooks that run after logout.- Returns:
- the same instance of ActionBuilder.
-
addNodeType
Update the NodeType session property, and the NodeType sharedState value. This method will copy the supplied TreeContext's shared state into this builder if the builder does not already have a sharedState set.- Parameters:
context
- The tree context.authName
- Name of the auth module just passed- Returns:
- the same instance of ActionBuilder.
-
withIdentifiedIdentity
Set the identified identity that has been verified to exist in an identity store.The identity may or may not have been authenticated as part of the tree execution.
- Parameters:
username
- the username of the identified identity.identityType
- the identity type of the identified identity. Must be one of the identity types defined in com.sun.identity.idm.IdType.- Returns:
- this action builder.
-
withIdentifiedIdentity
Set the identified identity that has been verified to exist in an identity store.The identity may or may not have been authenticated as part of the tree execution.
- Parameters:
identity
- the identified identity.- Returns:
- this action builder.
-
build
Build the Action.- Returns:
- an Action.
- Throws:
IllegalStateException
- if the builder is called before building mandatory fields.
withIdentifiedIdentity(java.lang.String, com.sun.identity.idm.IdType)
instead.