Class FulfillmentFulfilledInventoryAdjustmentListener
- java.lang.Object
-
- com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
-
- com.broadleafcommerce.inventory.service.messaging.fulfillments.AbstractFulfillmentStatusChangeInventoryAdjustmentListener
-
- com.broadleafcommerce.inventory.service.messaging.fulfillments.FulfillmentFulfilledInventoryAdjustmentListener
-
@DataRouteByKey("inventory") public class FulfillmentFulfilledInventoryAdjustmentListener extends AbstractFulfillmentStatusChangeInventoryAdjustmentListener
Listens for fulfilled fulfillments to createDefaultInventoryTransactionType.FULFILLED
InventoryTransactions
and updateSkuInventory
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.broadleafcommerce.inventory.service.messaging.fulfillments.AbstractFulfillmentStatusChangeInventoryAdjustmentListener
AbstractFulfillmentStatusChangeInventoryAdjustmentListener.OrderFulfillmentItem, AbstractFulfillmentStatusChangeInventoryAdjustmentListener.OrderItem
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
FULFILLED_STATUS
-
Fields inherited from class com.broadleafcommerce.inventory.service.messaging.fulfillments.AbstractFulfillmentStatusChangeInventoryAdjustmentListener
FULFILLMENT_ID_PATH, FULFILLMENT_ITEMS_PATH, FULFILLMENT_STATUS_PATH, NEVER_RESERVATION_STRATEGY, ORDER_ITEMS_PATH
-
Fields inherited from class com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
APPLICATION_ID_PATH, TENANT_ID_PATH
-
-
Constructor Summary
Constructors Constructor Description FulfillmentFulfilledInventoryAdjustmentListener(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 String
getValidFulfillmentStatus()
Supplies the valid fulfillment status which can be handled.void
listen(org.springframework.messaging.Message<String> message)
protected void
performInventoryAdjustment(SkuInventoryAdjustmentRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Execute the required inventory adjustment for the status change.-
Methods inherited from class com.broadleafcommerce.inventory.service.messaging.fulfillments.AbstractFulfillmentStatusChangeInventoryAdjustmentListener
buildRequestedItems, buildSkuInventoryAdjustmentRequest, process
-
Methods inherited from class com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
buildContextInfo, buildContextInfo, getDocumentContext, getIdempotentConsumptionService, getSkuInventoryService, getSkuReferenceFieldType, getTypeFactory
-
-
-
-
Field Detail
-
FULFILLED_STATUS
protected static final String FULFILLED_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FulfillmentFulfilledInventoryAdjustmentListener
public FulfillmentFulfilledInventoryAdjustmentListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService)
-
-
Method Detail
-
listen
@StreamListener("inventoryFulfillmentFulfilledInput") public void listen(org.springframework.messaging.Message<String> message)
-
getValidFulfillmentStatus
protected String getValidFulfillmentStatus()
Description copied from class:AbstractFulfillmentStatusChangeInventoryAdjustmentListener
Supplies the valid fulfillment status which can be handled.- Specified by:
getValidFulfillmentStatus
in classAbstractFulfillmentStatusChangeInventoryAdjustmentListener
- Returns:
- the valid fulfillment status which can be handled
-
performInventoryAdjustment
protected void performInventoryAdjustment(SkuInventoryAdjustmentRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) throws InventoryUnavailableException, InventoryNotReservedException
Description copied from class:AbstractFulfillmentStatusChangeInventoryAdjustmentListener
Execute the required inventory adjustment for the status change.- Specified by:
performInventoryAdjustment
in classAbstractFulfillmentStatusChangeInventoryAdjustmentListener
- Parameters:
request
- the request to adjust inventorycontextInfo
- context information surrounding sandboxing and multitenant state- Throws:
InventoryUnavailableException
- if inventory could not be decrementedInventoryNotReservedException
- if inventory was not already reserved
-
-