Package org.forgerock.am.trees.model
Class TreeState.Builder
java.lang.Object
org.forgerock.am.trees.model.TreeState.Builder
- Enclosing class:
- TreeState
A builder for TreeState objects.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the TreeState object with the provided properties.withCurrentNodeId
(UUID currentNodeId) Sets the current node ID.withIdentifiedIdentity
(IdentifiedIdentity identifiedIdentity) Sets the identified identity.withIdentifiedIdentityFrom
(TreeState previousState, Action action) Sets the identified identity from the provided action if present, or the previous tree state otherwise.withMaxTreeDuration
(Duration maxTreeDuration) Sets the maximum duration of the tree.withMaxTreeDurationFrom
(TreeState previousState, Action action) Sets the maximum duration of the tree from the provided action if present, or the previous tree state otherwise.withSecureState
(JsonValue secureState) Sets the secure state.withSessionHooks
(List<JsonValue> sessionHooks) Sets the session hooks.withSessionHooksFrom
(TreeState previousState, Action action) Sets the session hooks from the previous state, followed by those from the provided action.withSessionProperties
(SessionProperties sessionProperties) Sets the session properties.withSessionPropertiesFrom
(TreeState previousState, Action action) Sets the combined session properties from the provided action and previous state.withSharedState
(JsonValue sharedState) Sets the shared state.withSharedStateFrom
(TreeState previousState, Action action) Sets the shared state from the provided action if present, or the previous tree state otherwise.withTransientState
(JsonValue transientState) Sets the transient state.withTransientStateFrom
(TreeState previousState, Action action) Sets the transient state from the provided action if present, or the previous tree state otherwise.withUnencryptedSecureState
(JsonValue unencryptedSecureState) Sets the unencrypted secure state.withUniversalId
(String universalId) Sets the universal ID.withUniversalIdFrom
(TreeState previousState, Action action) Sets the universal ID from the provided action if present, or the previous tree state otherwise.withWebhooks
(List<String> webhooks) Sets the webhooks.withWebhooksFrom
(TreeState previousState, Action action) Sets the webhooks from the previous state, followed by those from the provided action.
-
Method Details
-
withTransientState
Sets the transient state.- Parameters:
transientState
- the transient state- Returns:
- this builder
-
withTransientStateFrom
Sets the transient state from the provided action if present, or the previous tree state otherwise.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withSecureState
Sets the secure state.- Parameters:
secureState
- the secure state- Returns:
- this builder
-
withUnencryptedSecureState
Sets the unencrypted secure state.- Parameters:
unencryptedSecureState
- the unencrypted secure state- Returns:
- this builder
-
withCurrentNodeId
Sets the current node ID.- Parameters:
currentNodeId
- the current node ID- Returns:
- this builder
-
withSessionProperties
Sets the session properties.- Parameters:
sessionProperties
- the session properties- Returns:
- this builder
-
withSessionPropertiesFrom
Sets the combined session properties from the provided action and previous state. Sets the max session time and max idle time from the action if present, or the previous tree state otherwise.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withSessionHooks
Sets the session hooks.- Parameters:
sessionHooks
- the session hooks- Returns:
- this builder
-
withSessionHooksFrom
Sets the session hooks from the previous state, followed by those from the provided action.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withWebhooks
Sets the webhooks.- Parameters:
webhooks
- the webhooks- Returns:
- this builder
-
withWebhooksFrom
Sets the webhooks from the previous state, followed by those from the provided action.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withUniversalId
Sets the universal ID.- Parameters:
universalId
- the universal ID- Returns:
- this builder
-
withUniversalIdFrom
Sets the universal ID from the provided action if present, or the previous tree state otherwise.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withIdentifiedIdentity
Sets the identified identity.- Parameters:
identifiedIdentity
- the identified identity- Returns:
- this builder
-
withIdentifiedIdentityFrom
Sets the identified identity from the provided action if present, or the previous tree state otherwise. Logs a warning if both are present and different.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
withMaxTreeDuration
Sets the maximum duration of the tree.- Parameters:
maxTreeDuration
- the maximum duration of the tree- Returns:
- this builder
-
withMaxTreeDurationFrom
Sets the maximum duration of the tree from the provided action if present, or the previous tree state otherwise.- Parameters:
previousState
- the previous tree stateaction
- the last action- Returns:
- this builder
-
build
Builds the TreeState object with the provided properties.- Returns:
- the TreeState object