public interface ContextualInventoryService extends InventoryService
InventoryService but with optional, additional context information. This context
can then be passed on to an InventoryServiceExtensionHandlerInventoryService},
InventoryServiceExtensionHandler},
CheckAvailabilityActivity},
DecrementInventoryActivity}| Modifier and Type | Field and Description |
|---|---|
static String |
ORDER_KEY
Used as a key in the context map methods below.
|
static String |
ROLLBACK_STATE_KEY
Used as a key in the context map methods below.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrementInventory(Map<Sku,Integer> skuQuantities,
Map<String,Object> context)
Usually invoked from
DecrementInventoryActivity |
void |
decrementInventory(Sku sku,
int quantity,
Map<String,Object> context)
Pass through for
decrementInventory(Map, Map) |
void |
incrementInventory(Map<Sku,Integer> skuQuantities,
Map<String,Object> context)
Callers that invoke this method directly should check for a
ROLLBACK_STATE_KEY in the given context. |
void |
incrementInventory(Sku sku,
int quantity,
Map<String,Object> context) |
boolean |
isAvailable(Sku sku,
int quantity,
Map<String,Object> context) |
Map<Sku,Integer> |
retrieveQuantitiesAvailable(Collection<Sku> skus,
Map<String,Object> context) |
Integer |
retrieveQuantityAvailable(Sku sku,
Map<String,Object> context) |
checkBasicAvailablility, decrementInventory, decrementInventory, incrementInventory, incrementInventory, isAvailable, retrieveQuantitiesAvailable, retrieveQuantityAvailablestatic final String ORDER_KEY
static final String ROLLBACK_STATE_KEY
DecrementInventoryActivity
and is utilized in the DecrementInventoryRollbackHandler. This can be cast to a MapInteger retrieveQuantityAvailable(Sku sku, Map<String,Object> context)
context - can be null. If not null, this should at least contain the #CART_CONTEXT_KEY#retrieveQuantitiesAvailable(Collection, Map)}Map<Sku,Integer> retrieveQuantitiesAvailable(Collection<Sku> skus, Map<String,Object> context)
context - can be null. If not null, this should at least contain the #CART_CONTEXT_KEY#retrieveQuantitiesAvailable(Collection)}boolean isAvailable(Sku sku, int quantity, Map<String,Object> context)
context - can be null. If not null, this should at least contain the #CART_CONTEXT_KEY#isAvailable(Sku, int)}void decrementInventory(Sku sku, int quantity, Map<String,Object> context) throws InventoryUnavailableException
Pass through for decrementInventory(Map, Map)
InventoryUnavailableException#decrementInventory(Map, Map)}void decrementInventory(Map<Sku,Integer> skuQuantities, Map<String,Object> context) throws InventoryUnavailableException
Usually invoked from DecrementInventoryActivity
Callers that invoke this method directly should check the given context object for a ROLLBACK_STATE_KEY.
This will contain information about what actually happened in terms of decrementing inventory. For implementers of this
interface
Implementers of this method (explicitly those that are utilizing the InventoryServiceExtensionHandler)
should populate a ROLLBACK_STATE_KEY within the given context in order to communicate back to the
caller what actually happened while decrementing inventory so that it can be undone later
context - can be null. If not null, this should at least contain the ORDER_KEY and/or the
ROLLBACK_STATE_KEYInventoryUnavailableException#decrementInventory(Map)}void incrementInventory(Sku sku, int quantity, Map<String,Object> context)
#incrementInventory(Map, Map)}void incrementInventory(Map<Sku,Integer> skuQuantities, Map<String,Object> context)
Callers that invoke this method directly should check for a ROLLBACK_STATE_KEY in the given context.
This will contain information about what actually happened in terms of decrementing inventory
Implementers of this method (explicitly those that are utilizing the InventoryServiceExtensionHandler)
should populate a ROLLBACK_STATE_KEY within the given context in order to communicate back to the
caller what actually happened while decrementing inventory so that it can be undone later
context - can be null. If not null, this should at least contain the ROLLBACK_STATE_KEY#incrementInventory(Map)}Copyright © 2014. All Rights Reserved.