Class AbstractInventoryAdjustmentListener
java.lang.Object
com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
- Direct Known Subclasses:
AbstractFulfillmentStatusChangeInventoryAdjustmentListener
,OrderSubmittedInventoryAdjustmentMessageListener
,ReturnConfirmedInventoryAdjustmentListener
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Order fulfillment fields relevant for adjusting inventory.static class
Order fulfillment item fields relevant for adjusting inventory.static class
Summarization of cart item fields relevant for creating an inventory reservation request. -
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractInventoryAdjustmentListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(@NonNull String tenantId, @NonNull String applicationId) Builds aContextInfo
for the application context id and tenant idprotected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(com.jayway.jsonpath.DocumentContext jsonContext) Builds aContextInfo
for the application context id and tenant id in the JSON payload.protected com.jayway.jsonpath.DocumentContext
getDocumentContext
(@NonNull String payload) Parses the message payload into aDocumentContext
which allows forJsonPath
parsing using Jackson providers.protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected SkuInventoryService<SkuInventory>
protected String
getSkuReferenceFieldType
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactory
-
Field Details
-
INVENTORY_SERIALIZATION_VALUE
- See Also:
-
TENANT_ID_PATH
- See Also:
-
APPLICATION_ID_PATH
- See Also:
-
-
Constructor Details
-
AbstractInventoryAdjustmentListener
public AbstractInventoryAdjustmentListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService)
-
-
Method Details
-
getDocumentContext
Parses the message payload into aDocumentContext
which allows forJsonPath
parsing using Jackson providers.- Parameters:
payload
- the message payload- Returns:
- a
DocumentContext
representation 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 aContextInfo
for the application context id and tenant id in the JSON payload.- Parameters:
jsonContext
- the JSON payload- Returns:
- a
ContextInfo
with 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 aContextInfo
for the application context id and tenant id- Parameters:
tenantId
- the tenant id of the contextapplicationId
- the application id of the context- Returns:
- a
ContextInfo
with the given context info
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getSkuInventoryService
-