Package org.keycloak.models.workflow
Class JpaWorkflowStateProvider
java.lang.Object
org.keycloak.models.workflow.JpaWorkflowStateProvider
- All Implemented Interfaces:
WorkflowStateProvider,Provider
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.workflow.WorkflowStateProvider
WorkflowStateProvider.ScheduledStep, WorkflowStateProvider.ScheduleResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getDueScheduledSteps(Workflow workflow) Retrieves all scheduled steps that are due for execution for the given workflow.getScheduledStep(String workflowId, String resourceId) Retrieves the scheduled step for a specific workflow and resource combination.getScheduledStepsByResource(String resourceId) Retrieves all scheduled steps associated with the specified resource.getScheduledStepsByStep(String workflowId, String stepId) Retrieves all scheduled steps for a specific step within a workflow.getScheduledStepsByWorkflow(String workflowId) Retrieves all scheduled steps associated with the specified workflow.booleanhasScheduledSteps(String workflowId) Checks whether there are any scheduled steps for the given workflow.voidRemoves the state record identified by the specified execution ID.voidDeletes all workflow state records associated with the current realm.voidremoveByResource(String resourceId) Deletes all state records associated with the given resource ID.voidremoveByWorkflow(String workflowId) Removes all state records associated with the specified workflow.voidremoveByWorkflowAndResource(String workflowId, String resourceId) Deletes the state record associated with a specific workflow and resource combination.scheduleStep(Workflow workflow, WorkflowStep step, String resourceId, String executionId) Schedules a workflow step for future execution.
-
Constructor Details
-
JpaWorkflowStateProvider
-
-
Method Details
-
getScheduledStep
Description copied from interface:WorkflowStateProviderRetrieves the scheduled step for a specific workflow and resource combination.- Specified by:
getScheduledStepin interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflowresourceId- the ID of the resource- Returns:
- the scheduled step, or
nullif no step is scheduled for this combination
-
scheduleStep
public WorkflowStateProvider.ScheduleResult scheduleStep(Workflow workflow, WorkflowStep step, String resourceId, String executionId) Description copied from interface:WorkflowStateProviderSchedules a workflow step for future execution. This method persists the scheduling information for a step that should be executed at a later time, typically based on the step's configuration (e.g., delay settings).- Specified by:
scheduleStepin interfaceWorkflowStateProvider- Parameters:
workflow- the workflow containing the stepstep- the workflow step to scheduleresourceId- the ID of the resource associated with this scheduled stepexecutionId- the ID of the workflow execution- Returns:
CREATEDif the execution was created (when the workflow first activates for a resource), {@code UPDATED) if it was just updated.
-
getDueScheduledSteps
Description copied from interface:WorkflowStateProviderRetrieves all scheduled steps that are due for execution for the given workflow. This method returns steps whose scheduled execution time has been reached or passed.- Specified by:
getDueScheduledStepsin interfaceWorkflowStateProvider- Parameters:
workflow- the workflow to check for due steps- Returns:
- a stream of scheduled steps that are due for execution
-
getScheduledStepsByWorkflow
Description copied from interface:WorkflowStateProviderRetrieves all scheduled steps associated with the specified workflow.- Specified by:
getScheduledStepsByWorkflowin interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflow- Returns:
- a stream of scheduled steps for the given workflow
-
getScheduledStepsByStep
public Stream<WorkflowStateProvider.ScheduledStep> getScheduledStepsByStep(String workflowId, String stepId) Description copied from interface:WorkflowStateProviderRetrieves all scheduled steps for a specific step within a workflow.- Specified by:
getScheduledStepsByStepin interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflowstepId- the ID of the step- Returns:
- a stream of scheduled steps matching the workflow and step IDs
-
getScheduledStepsByResource
Description copied from interface:WorkflowStateProviderRetrieves all scheduled steps associated with the specified resource.- Specified by:
getScheduledStepsByResourcein interfaceWorkflowStateProvider- Parameters:
resourceId- the ID of the resource- Returns:
- a stream of scheduled steps for the given resource
-
removeByResource
Description copied from interface:WorkflowStateProviderDeletes all state records associated with the given resource ID. This method removes all workflow state information for the specified resource, regardless of which workflows the resource is associated with.- Specified by:
removeByResourcein interfaceWorkflowStateProvider- Parameters:
resourceId- the ID of the resource whose state records should be deleted
-
removeByWorkflowAndResource
Description copied from interface:WorkflowStateProviderDeletes the state record associated with a specific workflow and resource combination. This method removes only the state information for the specified resource within the context of the specified workflow, leaving state records for other workflows intact.- Specified by:
removeByWorkflowAndResourcein interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflowresourceId- the ID of the resource
-
removeByWorkflow
Description copied from interface:WorkflowStateProviderRemoves all state records associated with the specified workflow. This method deletes all state information for the given workflow across all resources.- Specified by:
removeByWorkflowin interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflow whose state records should be deleted
-
remove
Description copied from interface:WorkflowStateProviderRemoves the state record identified by the specified execution ID. This method deletes a specific workflow execution state record.- Specified by:
removein interfaceWorkflowStateProvider- Parameters:
executionId- the ID of the execution whose state record should be deleted
-
removeAll
public void removeAll()Description copied from interface:WorkflowStateProviderDeletes all workflow state records associated with the current realm. This method removes all workflow state information for the realm bound to the current session.- Specified by:
removeAllin interfaceWorkflowStateProvider
-
hasScheduledSteps
Description copied from interface:WorkflowStateProviderChecks whether there are any scheduled steps for the given workflow.- Specified by:
hasScheduledStepsin interfaceWorkflowStateProvider- Parameters:
workflowId- the ID of the workflow to check- Returns:
trueif there are scheduled steps for this workflow,falseotherwise
-
close
public void close()
-