Class AbstractInventoryAdjustmentListener
- java.lang.Object
-
- com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
-
- Direct Known Subclasses:
AbstractFulfillmentStatusChangeInventoryAdjustmentListener,OrderSubmittedInventoryAdjustmentMessageListener,ReturnConfirmedInventoryAdjustmentListener
public abstract class AbstractInventoryAdjustmentListener extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringAPPLICATION_ID_PATHprotected static StringTENANT_ID_PATH
-
Constructor Summary
Constructors Constructor Description AbstractInventoryAdjustmentListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildContextInfo(@NonNull String tenantId, @NonNull String applicationId)Builds aContextInfofor the application context id and tenant idprotected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildContextInfo(com.jayway.jsonpath.DocumentContext jsonContext)Builds aContextInfofor the application context id and tenant id in the JSON payload.protected com.jayway.jsonpath.DocumentContextgetDocumentContext(@NonNull String payload)Parses the message payload into aDocumentContextwhich allows forJsonPathparsing using Jackson providers.protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionServicegetIdempotentConsumptionService()protected SkuInventoryService<SkuInventory>getSkuInventoryService()protected StringgetSkuReferenceFieldType(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()
-
-
-
Field Detail
-
TENANT_ID_PATH
protected static final String TENANT_ID_PATH
- See Also:
- Constant Field Values
-
APPLICATION_ID_PATH
protected static final String APPLICATION_ID_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractInventoryAdjustmentListener
public AbstractInventoryAdjustmentListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService)
-
-
Method Detail
-
getDocumentContext
protected com.jayway.jsonpath.DocumentContext getDocumentContext(@NonNull @NonNull String payload)Parses the message payload into aDocumentContextwhich allows forJsonPathparsing using Jackson providers.- Parameters:
payload- the message payload- Returns:
- a
DocumentContextrepresentation of the message payload
-
getSkuReferenceFieldType
protected String getSkuReferenceFieldType(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(com.jayway.jsonpath.DocumentContext jsonContext)
Builds aContextInfofor the application context id and tenant id in the JSON payload.- Parameters:
jsonContext- the JSON payload- Returns:
- a
ContextInfowith the context info from the JSON object
-
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(@NonNull @NonNull String tenantId, @NonNull @NonNull String applicationId)Builds aContextInfofor the application context id and tenant id- Parameters:
tenantId- the tenant id of the contextapplicationId- the application id of the context- Returns:
- a
ContextInfowith the given context info
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getSkuInventoryService
protected SkuInventoryService<SkuInventory> getSkuInventoryService()
-
-