Class CatalogEntityDeletedEventListener
java.lang.Object
com.broadleafcommerce.catalog.messaging.entitydeletion.CatalogEntityDeletedEventListener
The event listener for processing
InternalPersistenceEvent
and
CatalogEntityDeletedEvent
that are emitted when a CatalogTrackable
entity is
deleted.
InternalPersistenceEvent
is handled for cases where the deleted entity has catalog-level
overrides, this event is emitted at deletion. CatalogEntityDeletedEvent
is handled for
cases where the overrides don't exist, this event is emitted during propagation.
- Author:
- Sunny Yu
- See Also:
-
DefaultPropagationHandler
WorkflowTransitionHelper
-
Constructor Summary
ConstructorDescriptionCatalogEntityDeletedEventListener
(List<CatalogEntityDeletedEventHandler> catalogEntityDeletedEventHandlers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleCatalogEntityDeletedEvent
(@NonNull com.broadleafcommerce.data.tracking.core.catalog.CatalogEntityDeletedEvent event) void
handleInternalPersistenceEvent
(@NonNull com.broadleafcommerce.common.messaging.notification.domain.InternalPersistenceEvent event) protected boolean
shouldProcessEvent
(@NonNull com.broadleafcommerce.common.messaging.notification.domain.InternalPersistenceEvent event) Determines whether the givenInternalPersistenceEvent
should be processed.
-
Constructor Details
-
CatalogEntityDeletedEventListener
public CatalogEntityDeletedEventListener(List<CatalogEntityDeletedEventHandler> catalogEntityDeletedEventHandlers)
-
-
Method Details
-
handleInternalPersistenceEvent
@EventListener public void handleInternalPersistenceEvent(@NonNull @NonNull com.broadleafcommerce.common.messaging.notification.domain.InternalPersistenceEvent event) -
handleCatalogEntityDeletedEvent
@EventListener public void handleCatalogEntityDeletedEvent(@NonNull @NonNull com.broadleafcommerce.data.tracking.core.catalog.CatalogEntityDeletedEvent event) -
shouldProcessEvent
protected boolean shouldProcessEvent(@NonNull @NonNull com.broadleafcommerce.common.messaging.notification.domain.InternalPersistenceEvent event) Determines whether the givenInternalPersistenceEvent
should be processed.Since there can be multiple instances of
InternalPersistenceEvents
be emitted for a single entity deletion deployment as the catalog tree is iterated, there are a list of criteria where anInternalPersistenceEvent
would be processed:- The event's entity is CatalogTrackable
- The event is for a
TrackingLevel.PRODUCTION
-level change - The event represents an entity deletion
- The deleted entity has field overrides
- The deleted entity belongs to a lower-level catalog
- Parameters:
event
- theInternalPersistenceEvent
to check- Returns:
- true if the given
InternalPersistenceEvent
should be processed, otherwise false.
-