Class OptionTemplateCatalogEntityDeletedEventHandler
java.lang.Object
com.broadleafcommerce.catalog.messaging.entitydeletion.handlers.AbstractCatalogEntityDeletedEventHandler
com.broadleafcommerce.catalog.messaging.entitydeletion.handlers.OptionTemplateCatalogEntityDeletedEventHandler
- All Implemented Interfaces:
CatalogEntityDeletedEventHandler
public class OptionTemplateCatalogEntityDeletedEventHandler
extends AbstractCatalogEntityDeletedEventHandler
The
CatalogEntityDeletedEventHandler
instance to clean up OptionTemplates
when a JpaCategory
is deleted.- Author:
- Sunny Yu
-
Constructor Summary
ConstructorDescriptionOptionTemplateCatalogEntityDeletedEventHandler
(com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator contextRequestHydrator, OptionTemplateService<OptionTemplate> optionTemplateService) -
Method Summary
Modifier and TypeMethodDescriptionprotected OptionTemplateService<OptionTemplate>
An abstract method to return aSet
of classes of the deleted entities that are supported.void
handle
(@NonNull org.springframework.context.ApplicationEvent event) Handles theApplicationEvent
that represents the catalog entity deletion.protected void
handleOptionTemplateDeletionByCategoryIds
(@NonNull Collection<String> categoryIds, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Methods inherited from class com.broadleafcommerce.catalog.messaging.entitydeletion.handlers.AbstractCatalogEntityDeletedEventHandler
buildContext, buildHydratedContextInfo, buildMatchingContextInfo, buildMatchingContextRequest, buildMatchingContextRequest, canHandle, getCatalogService, getContextRequestHydrator, getDeletedEntityClassFromEvent, getDeletedEntityFromEvent, getObjectMapper, getTypeFactory
-
Constructor Details
-
OptionTemplateCatalogEntityDeletedEventHandler
public OptionTemplateCatalogEntityDeletedEventHandler(com.broadleafcommerce.data.tracking.core.tenant.service.CommonCatalogService<com.broadleafcommerce.data.tracking.core.tenant.domain.Catalog> catalogService, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.web.ContextRequestHydrator contextRequestHydrator, OptionTemplateService<OptionTemplate> optionTemplateService)
-
-
Method Details
-
getSupportedDeletedEntityClasses
Description copied from class:AbstractCatalogEntityDeletedEventHandler
An abstract method to return aSet
of classes of the deleted entities that are supported.For example, if a
CatalogEntityDeletedEventHandler
instance can only handle the event when theJpaProduct
is deleted, this handler instance would be skipped when the emitted event is for aJpaCategoryProduct
.- Specified by:
getSupportedDeletedEntityClasses
in classAbstractCatalogEntityDeletedEventHandler
-
handle
public void handle(@NonNull @NonNull org.springframework.context.ApplicationEvent event) Description copied from interface:CatalogEntityDeletedEventHandler
Handles theApplicationEvent
that represents the catalog entity deletion.- Parameters:
event
- theApplicationEvent
that potentially represents the catalog entity deletion
-
handleOptionTemplateDeletionByCategoryIds
protected void handleOptionTemplateDeletionByCategoryIds(@NonNull @NonNull Collection<String> categoryIds, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getOptionTemplateService
-