Class DefaultPropagationHandler
java.lang.Object
com.broadleafcommerce.data.tracking.core.transition.DefaultPropagationHandler
- All Implemented Interfaces:
PropagationAware
,PropagationHandler
,org.springframework.core.Ordered
Default instance of
PropagationHandler
. Represents simple propagation behavior in a
sparse override hierarchy.- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionDefaultPropagationHandler
(WorkflowMapper mapper, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(Trackable incoming, String incomingCatalog, String parentCatalog, Trackable candidate, OperationType changeType) Is this handler capable of handling the propagation process given the contextual information.handleCreate
(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, TrackableRepository<Trackable> repository) handleDelete
(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, Trackable candidate, TrackableRepository<Trackable> repository) protected Trackable
handlePropagation
(Trackable incoming, String parentCatalog, String propagationId, Trackable candidate, TrackableRepository<Trackable> repository, boolean isDelete) handleUpdate
(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, Trackable candidate, TrackableRepository<Trackable> repository) protected void
notifyOfPersistence
(Trackable domain, TrackableRepository<Trackable> repository) Inform the system via a message of typePersistenceProducer.TYPE
that an entity has been persisted.protected void
updatePersistenceState
(Trackable trackable) Setup the initialNotificationState
on aTrackable
entity in regard to the sending status of thePersistenceProducer.TYPE
message for a persistence event.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.transition.PropagationHandler
getOrder
-
Constructor Details
-
DefaultPropagationHandler
public DefaultPropagationHandler(WorkflowMapper mapper, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager)
-
-
Method Details
-
canHandle
public boolean canHandle(Trackable incoming, String incomingCatalog, String parentCatalog, @Nullable Trackable candidate, OperationType changeType) Description copied from interface:PropagationHandler
Is this handler capable of handling the propagation process given the contextual information.- Specified by:
canHandle
in interfacePropagationHandler
- Parameters:
incoming
- The Trackable instance that contains the change information to propagateincomingCatalog
- The current catalog in which the propagation is occuringparentCatalog
- The parent catalog up one levelcandidate
- The candidate, if available, representing a catalog override already existing in the incomingCatalog.changeType
- The type of change requested. SeeOperationType
.- Returns:
- Is this handler capable of handling the propagation process
-
handleDelete
public Trackable handleDelete(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, @Nullable Trackable candidate, TrackableRepository<Trackable> repository) - Specified by:
handleDelete
in interfacePropagationAware
-
handleCreate
public Trackable handleCreate(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, TrackableRepository<Trackable> repository) - Specified by:
handleCreate
in interfacePropagationAware
-
handleUpdate
public Trackable handleUpdate(Trackable incoming, String incomingCatalog, String parentCatalog, String propagationId, @Nullable Trackable candidate, TrackableRepository<Trackable> repository) - Specified by:
handleUpdate
in interfacePropagationAware
-
handlePropagation
-
updatePersistenceState
Setup the initialNotificationState
on aTrackable
entity in regard to the sending status of thePersistenceProducer.TYPE
message for a persistence event.- Parameters:
trackable
-Trackable
the entity which experienced a persistence event
-
notifyOfPersistence
Inform the system via a message of typePersistenceProducer.TYPE
that an entity has been persisted.- Parameters:
domain
- the entity that was persisted
-