public class DefaultTransitionHandler extends Object implements TransitionHandler
TransitionHandler
that takes in a business domain. Used to a
create a sandbox change listener for a Sandboxable entity.Constructor and Description |
---|
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,
com.broadleafcommerce.common.extension.data.DataRouteReference routeReference,
SingleIndexRequestMessageFactory factory) |
DefaultTransitionHandler(WorkflowTransitionHelper helper,
Class<?> businessDomain,
Class<?> entityDomain) |
Modifier and Type | Method and Description |
---|---|
Optional<Class<?>> |
getEntityDomain()
The entity domain to use if the inheriting class's generic P is the interface
ContextStateAware . |
protected Set<String> |
getInstantiableEntitiesWhitelist()
If
setInstantiableEntitiesWhitelist(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<?,?> |
getMappingContext()
Normally,
setMappingContext(MappingContext) is called directly by
TransitionHandlerFactory , but this method is also Autowired to enable
standard bean injection. |
boolean |
isRequestedEntityWhitelistedForTransition(TransitionRequest request)
Examines whether the provided
TransitionRequest.getEntity() is whitelisted for
transition operations by this handler. |
void |
processDeploymentRequest(WorkflowDeployRequest request)
Handle the WorkflowDeployRequest that has been deemed appropriate for this handler based on
comparing the
WorkflowTransitionRequest.getEntity() against the generic type of the
handler implementation. |
void |
processPromotionRequest(WorkflowPromoteRequest request)
Handle the WorkflowPromoteRequest that has been deemed appropriate for this handler based on
comparing the
WorkflowTransitionRequest.getEntity() against the generic type of the
handler implementation. |
void |
processRebasingRequest(WorkflowRebaseRequest request)
Handle the WorkflowRebaseRequest that has been deemed appropriate for this handler based on
comparing the
WorkflowTransitionRequest.getEntity() against the generic type of the
handler implementation. |
void |
processRejectionRequest(WorkflowRejectRequest request)
Handle the WorkflowRejectRequest that has been deemed appropriate for this handler based on
comparing the
WorkflowTransitionRequest.getEntity() against the generic type of the
handler implementation. |
void |
processReversionRequest(WorkflowRevertRequest request)
Handle the WorkflowRevertRequest that has been deemed appropriate for this handler based on
comparing the
WorkflowTransitionRequest.getEntity() against the generic type of the
handler implementation. |
void |
setInstantiableEntitiesWhitelist(Set<String> instantiableEntitiesWhitelist) |
void |
setMappingContext(org.springframework.data.mapping.context.MappingContext<?,?> mappingContext)
Normally,
setMappingContext(MappingContext) is called directly by
TransitionHandlerFactory , but this method is also Autowired to enable
standard bean injection. |
String |
toString() |
DefaultTransitionHandler |
withPropagationManager(PropagationManager propagationManager) |
DefaultTransitionHandler |
withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canHandle, canHandleDynamically, getNarrowedEntity, handle, handle, handle, handle, handle, logger, validate
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)
public DefaultTransitionHandler(WorkflowTransitionHelper helper, Class<?> businessDomain, Class<?> entityDomain)
public DefaultTransitionHandler withPropagationManager(PropagationManager propagationManager)
public DefaultTransitionHandler withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
public Optional<Class<?>> getEntityDomain()
TransitionHandler
ContextStateAware
.getEntityDomain
in interface TransitionHandler
ContextStateAware
.public void processPromotionRequest(WorkflowPromoteRequest request)
TransitionHandler
WorkflowTransitionRequest.getEntity()
against the generic type of the
handler implementation.processPromotionRequest
in interface TransitionHandler
request
- The request for a Trackable
entity promotionpublic void processDeploymentRequest(WorkflowDeployRequest request)
TransitionHandler
WorkflowTransitionRequest.getEntity()
against the generic type of the
handler implementation.processDeploymentRequest
in interface TransitionHandler
request
- The request for a Trackable
entity deploymentpublic void processRejectionRequest(WorkflowRejectRequest request)
TransitionHandler
WorkflowTransitionRequest.getEntity()
against the generic type of the
handler implementation.processRejectionRequest
in interface TransitionHandler
request
- The request for a Trackable
entity rejectionpublic void processReversionRequest(WorkflowRevertRequest request)
TransitionHandler
WorkflowTransitionRequest.getEntity()
against the generic type of the
handler implementation.processReversionRequest
in interface TransitionHandler
request
- The request for a Trackable
entity reversionpublic void processRebasingRequest(WorkflowRebaseRequest request)
TransitionHandler
WorkflowTransitionRequest.getEntity()
against the generic type of the
handler implementation.processRebasingRequest
in interface TransitionHandler
request
- The request for a Trackable
entity rebasepublic boolean isRequestedEntityWhitelistedForTransition(TransitionRequest request)
TransitionHandler
TransitionRequest.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.
isRequestedEntityWhitelistedForTransition
in interface TransitionHandler
request
- the TransitionRequest
whose TransitionRequest.getEntity()
should be checkedtrue
if the entity is whitelisted, false
otherwisepublic void setInstantiableEntitiesWhitelist(Set<String> instantiableEntitiesWhitelist)
protected Set<String> getInstantiableEntitiesWhitelist()
setInstantiableEntitiesWhitelist(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 and
getMappingContext()
is available, it will be used to compute a new value based on
the available persistent entities.
instantiableEntitiesWhitelist
@Autowired public void setMappingContext(@Nullable org.springframework.data.mapping.context.MappingContext<?,?> mappingContext)
setMappingContext(MappingContext)
is called directly by
TransitionHandlerFactory
, but this method is also Autowired
to enable
standard bean injection.@Nullable protected org.springframework.data.mapping.context.MappingContext<?,?> getMappingContext()
setMappingContext(MappingContext)
is called directly by
TransitionHandlerFactory
, but this method is also Autowired
to enable
standard bean injection.Copyright © 2021. All rights reserved.