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 create
DefaultInventoryTransactionType.FULFILLED
InventoryTransactions
and update SkuInventory
.-
Nested Class Summary
Nested classes/interfaces inherited from class com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
AbstractInventoryAdjustmentListener.OrderFulfillment, AbstractInventoryAdjustmentListener.OrderFulfillmentItem, AbstractInventoryAdjustmentListener.OrderItem
-
Field Summary
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, INVENTORY_SERIALIZATION_VALUE, TENANT_ID_PATH
-
Constructor Summary
ConstructorDescriptionFulfillmentFulfilledInventoryAdjustmentListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Supplies the valid fulfillment status which can be handled.void
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, buildSerializedSku, buildSkuInventoryAdjustmentItem, buildSkuInventoryAdjustmentRequest, getInventorySerializationValue, getOrderItemsIncludingDependents, isSerialized, process
Methods inherited from class com.broadleafcommerce.inventory.service.messaging.AbstractInventoryAdjustmentListener
buildContextInfo, buildContextInfo, getDocumentContext, getIdempotentConsumptionService, getSkuInventoryService, getSkuReferenceFieldType, getTypeFactory
-
Field Details
-
FULFILLED_STATUS
- See Also:
-
-
Constructor Details
-
FulfillmentFulfilledInventoryAdjustmentListener
public FulfillmentFulfilledInventoryAdjustmentListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, SkuInventoryService<SkuInventory> skuInventoryService)
-
-
Method Details
-
listen
@StreamListener("inventoryFulfillmentFulfilledInput") public void listen(org.springframework.messaging.Message<String> message) -
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
-