Package org.keycloak.models.workflow
Class AbstractWorkflowEventProvider
java.lang.Object
org.keycloak.models.workflow.AbstractWorkflowEventProvider
- All Implemented Interfaces:
WorkflowEventProvider,Provider
- Direct Known Subclasses:
ClientAuthenticatedWorkflowEventProvider,ClientCreatedWorkflowEventProvider,UserAuthenticatedWorkflowEventProvider,UserCreatedWorkflowEventProvider,UserFedIdentityAddedWorkflowEventProvider,UserFedIdentityRemovedWorkflowEventProvider,UserGroupMembershipAddedWorkflowEventProvider,UserGroupMembershipRemovedWorkflowEventProvider,UserRoleGrantedWorkflowEventProvider,UserRoleRevokedWorkflowEventProvider
Utility class to simplify implementation of WorkflowEventProvider interface, providing default implementations for most methods.
Subclasses need to implement only the
WorkflowEventProvider.getSupportedResourceType() method and the relevant supports methods. If
the provider supports ProviderEvents, they also need to implement the resolveResourceId(org.keycloak.provider.ProviderEvent) method because there is no
common way to resolve resource IDs from provider events, so that logic is provider-specific.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final Stringprotected final KeycloakSession -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWorkflowEventProvider(KeycloakSession session, String configParameter, String providerId) -
Method Summary
Modifier and TypeMethodDescriptioncreate(AdminEvent adminEvent) Creates aWorkflowEventfrom anAdminEvent.Creates aWorkflowEventfrom a userEvent.create(ProviderEvent providerEvent) Creates aWorkflowEventfrom aProviderEvent.booleanevaluate(WorkflowExecutionContext context) Evaluates whether the event in the workflow execution context matches this provider's criteria.protected StringresolveResourceId(ProviderEvent providerEvent) Resolves the resource ID from the givenProviderEvent.booleansupports(AdminEvent adminEvent) Determines whether this provider supports the givenAdminEvent.booleanDetermines whether this provider supports the given userEvent.booleansupports(ProviderEvent providerEvent) Determines whether this provider supports the givenProviderEvent.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.workflow.WorkflowEventProvider
close, getSupportedResourceType
-
Field Details
-
providerId
-
configParameter
-
session
-
-
Constructor Details
-
AbstractWorkflowEventProvider
public AbstractWorkflowEventProvider(KeycloakSession session, String configParameter, String providerId)
-
-
Method Details
-
create
Description copied from interface:WorkflowEventProviderCreates aWorkflowEventfrom a userEvent.- Specified by:
createin interfaceWorkflowEventProvider- Parameters:
event- the user event to convert- Returns:
- a WorkflowEvent representing the given event, or
nullif the event is not supported
-
create
Description copied from interface:WorkflowEventProviderCreates aWorkflowEventfrom anAdminEvent.- Specified by:
createin interfaceWorkflowEventProvider- Parameters:
adminEvent- the admin event to convert- Returns:
- a WorkflowEvent representing the given admin event, or
nullif the event is not supported
-
create
Description copied from interface:WorkflowEventProviderCreates aWorkflowEventfrom aProviderEvent.- Specified by:
createin interfaceWorkflowEventProvider- Parameters:
providerEvent- the provider event to convert- Returns:
- a WorkflowEvent representing the given provider event, or
nullif the event is not supported
-
evaluate
Description copied from interface:WorkflowEventProviderEvaluates whether the event in the workflow execution context matches this provider's criteria. Implementations should inspect the workflow event in the providedcontextand returntruewhen the event matches the provider's specific conditions.- Specified by:
evaluatein interfaceWorkflowEventProvider- Parameters:
context- the execution context for the workflow evaluation- Returns:
trueif the event matches the criteria,falseotherwise
-
supports
Description copied from interface:WorkflowEventProviderDetermines whether this provider supports the given userEvent.- Specified by:
supportsin interfaceWorkflowEventProvider- Parameters:
event- the user event to check- Returns:
trueif the event is supported,falseotherwise
-
supports
Description copied from interface:WorkflowEventProviderDetermines whether this provider supports the givenAdminEvent.- Specified by:
supportsin interfaceWorkflowEventProvider- Parameters:
adminEvent- the admin event to check- Returns:
trueif the event is supported,falseotherwise
-
supports
Description copied from interface:WorkflowEventProviderDetermines whether this provider supports the givenProviderEvent.- Specified by:
supportsin interfaceWorkflowEventProvider- Parameters:
providerEvent- the provider event to check- Returns:
trueif the event is supported,falseotherwise
-
resolveResourceId
Resolves the resource ID from the givenProviderEvent.- Parameters:
providerEvent- the provider event- Returns:
- the resolved resource ID, or
nullif it cannot be resolved
-