Class DefaultTransitionHandler
java.lang.Object
com.broadleafcommerce.data.tracking.core.transition.DefaultTransitionHandler
- All Implemented Interfaces:
TransitionHandler
Base implementation of
TransitionHandler that takes in a business domain. Used to a
create a sandbox change listener for a Sandboxable entity.- Author:
- Chad Harchar (charchar)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTransitionHandler(TrackableRepository<Trackable> repository, WorkflowMapper mapper, CommonCatalogService<Catalog> commonCatalogService, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> resourceLockRepository, Class<?> entityDomain, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper serializationHelper, com.broadleafcommerce.common.extension.data.DataRouteReference routeReference, SingleIndexRequestMessageFactory factory) DefaultTransitionHandler(WorkflowTransitionHelper helper, Class<?> businessDomain, Class<?> entityDomain) -
Method Summary
Modifier and TypeMethodDescriptionThe entity domain to use if the inheriting class's generic P is the interfaceContextStateAware.IfsetInstantiableEntitiesWhitelist(Set)was called with a non-null argument, the field will be non-null and will be returned as-is.protected org.springframework.data.mapping.context.MappingContext<?,?> Normally,setMappingContext(MappingContext)is called directly byTransitionHandlerFactory, but this method is alsoAutowiredto enable standard bean injection.booleanExamines whether the providedTransitionRequest.getEntity()is whitelisted for transition operations by this handler.voidHandle the WorkflowDeployRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.voidHandle the WorkflowPromoteRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.voidHandle the WorkflowRebaseRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.voidHandle the WorkflowRejectRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.voidHandle the WorkflowRevertRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.voidsetInstantiableEntitiesWhitelist(Set<String> instantiableEntitiesWhitelist) voidsetMappingContext(org.springframework.data.mapping.context.MappingContext<?, ?> mappingContext) Normally,setMappingContext(MappingContext)is called directly byTransitionHandlerFactory, but this method is alsoAutowiredto enable standard bean injection.toString()withEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) withPropagationManager(PropagationManager propagationManager) withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.transition.TransitionHandler
canHandle, canHandleDynamically, getNarrowedEntity, handle, handle, handle, handle, handle, logger, validate
-
Constructor Details
-
DefaultTransitionHandler
public DefaultTransitionHandler(TrackableRepository<Trackable> repository, WorkflowMapper mapper, CommonCatalogService<Catalog> commonCatalogService, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?, ?> resourceLockRepository, Class<?> entityDomain, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper serializationHelper, @Nullable com.broadleafcommerce.common.extension.data.DataRouteReference routeReference, SingleIndexRequestMessageFactory factory) -
DefaultTransitionHandler
public DefaultTransitionHandler(WorkflowTransitionHelper helper, Class<?> businessDomain, Class<?> entityDomain)
-
-
Method Details
-
withPropagationManager
-
withTypeFactory
public DefaultTransitionHandler withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
withEventPublisher
public DefaultTransitionHandler withEventPublisher(org.springframework.context.ApplicationEventPublisher publisher) -
getEntityDomain
Description copied from interface:TransitionHandlerThe entity domain to use if the inheriting class's generic P is the interfaceContextStateAware.- Specified by:
getEntityDomainin interfaceTransitionHandler- Returns:
- The business domain to use if the inheriting class's generic P is the interface
ContextStateAware.
-
processPromotionRequest
Description copied from interface:TransitionHandlerHandle the WorkflowPromoteRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.- Specified by:
processPromotionRequestin interfaceTransitionHandler- Parameters:
request- The request for aTrackableentity promotion
-
processDeploymentRequest
Description copied from interface:TransitionHandlerHandle the WorkflowDeployRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.- Specified by:
processDeploymentRequestin interfaceTransitionHandler- Parameters:
request- The request for aTrackableentity deployment
-
processRejectionRequest
Description copied from interface:TransitionHandlerHandle the WorkflowRejectRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.- Specified by:
processRejectionRequestin interfaceTransitionHandler- Parameters:
request- The request for aTrackableentity rejection
-
processReversionRequest
Description copied from interface:TransitionHandlerHandle the WorkflowRevertRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.- Specified by:
processReversionRequestin interfaceTransitionHandler- Parameters:
request- The request for aTrackableentity reversion
-
processRebasingRequest
Description copied from interface:TransitionHandlerHandle the WorkflowRebaseRequest that has been deemed appropriate for this handler based on comparing theWorkflowTransitionRequest.getEntity()against the generic type of the handler implementation.- Specified by:
processRebasingRequestin interfaceTransitionHandler- Parameters:
request- The request for aTrackableentity rebase
-
isRequestedEntityWhitelistedForTransition
Description copied from interface:TransitionHandlerExamines whether the providedTransitionRequest.getEntity()is whitelisted for transition operations by this handler.This is most important for security purposes since the entity class will be dynamically loaded. Only allowing instantiation of whitelisted types protects against injection of malicious code.
- Specified by:
isRequestedEntityWhitelistedForTransitionin interfaceTransitionHandler- Parameters:
request- theTransitionRequestwhoseTransitionRequest.getEntity()should be checked- Returns:
trueif the entity is whitelisted,falseotherwise
-
setInstantiableEntitiesWhitelist
-
getInstantiableEntitiesWhitelist
IfsetInstantiableEntitiesWhitelist(Set)was called with a non-null argument, the field will be non-null and will be returned as-is.If
setInstantiableEntitiesWhitelist(Set)was not called andgetMappingContext()is available, it will be used to compute a new value based on the available persistent entities.- Returns:
- the existing or newly-computed value of
instantiableEntitiesWhitelist
-
toString
-
setMappingContext
@Autowired public void setMappingContext(@Nullable org.springframework.data.mapping.context.MappingContext<?, ?> mappingContext) Normally,setMappingContext(MappingContext)is called directly byTransitionHandlerFactory, but this method is alsoAutowiredto enable standard bean injection. -
getMappingContext
@Nullable protected org.springframework.data.mapping.context.MappingContext<?,?> getMappingContext()Normally,setMappingContext(MappingContext)is called directly byTransitionHandlerFactory, but this method is alsoAutowiredto enable standard bean injection.
-