Class CatalogEntityCreateEventHandler
java.lang.Object
com.broadleafcommerce.recommendationengine.service.messaging.handlers.CatalogEntityCreateEventHandler
- All Implemented Interfaces:
CatalogEntityEventHandler
-
Constructor Summary
ConstructorsConstructorDescriptionCatalogEntityCreateEventHandler(CatalogItemService<CatalogItem> catalogItemService, CatalogEntityEventHandlerUtility eventHandlerUtility, com.jayway.jsonpath.Configuration jsonPathConfiguration, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<CatalogItem>buildCatalogItemFromEntity(com.broadleafcommerce.data.tracking.core.Trackable entity, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) booleancanHandle(org.springframework.context.ApplicationEvent event) protected CatalogItemService<CatalogItem>protected StringgetCreatedEntityClassFromEvent(org.springframework.context.ApplicationEvent event) com.broadleafcommerce.data.tracking.core.TrackablegetCreatedEntityFromEvent(@NonNull org.springframework.context.ApplicationEvent event) Gets the created entity from the given event.protected CatalogEntityEventHandlerUtilityprotected com.jayway.jsonpath.Configurationprotected com.fasterxml.jackson.databind.ObjectMapperprotected com.broadleafcommerce.common.extension.TypeFactoryvoidhandle(org.springframework.context.ApplicationEvent event)
-
Constructor Details
-
CatalogEntityCreateEventHandler
public CatalogEntityCreateEventHandler(CatalogItemService<CatalogItem> catalogItemService, CatalogEntityEventHandlerUtility eventHandlerUtility, @Nullable com.jayway.jsonpath.Configuration jsonPathConfiguration, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getSupportedCreatedEntityClasses
-
canHandle
public boolean canHandle(org.springframework.context.ApplicationEvent event) - Specified by:
canHandlein interfaceCatalogEntityEventHandler
-
handle
public void handle(org.springframework.context.ApplicationEvent event) - Specified by:
handlein interfaceCatalogEntityEventHandler
-
buildCatalogItemFromEntity
protected Optional<CatalogItem> buildCatalogItemFromEntity(com.broadleafcommerce.data.tracking.core.Trackable entity, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getCreatedEntityClassFromEvent
@Nullable protected String getCreatedEntityClassFromEvent(org.springframework.context.ApplicationEvent event) -
getCreatedEntityFromEvent
public com.broadleafcommerce.data.tracking.core.Trackable getCreatedEntityFromEvent(@NonNull @NonNull org.springframework.context.ApplicationEvent event) Gets the created entity from the given event.- Parameters:
event- theApplicationEventthat was emitted for the created entity- Returns:
- the created entity from the given event
-
getCatalogItemService
-
getEventHandlerUtility
-
getJsonPathConfiguration
protected com.jayway.jsonpath.Configuration getJsonPathConfiguration() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-