public class InventoryFacadeClient extends AbstractInventoryFacadeClient
This class provides common methods that this and other utility classes to the Inventory facade use. This class also provides a set of convenient Java APIs to represent particular Inventory operations. This set of Java APIs also include APIs for Web-based requests to transform the name-value pair requests into the appropriate request documents.
CHANGE_VERB_ACTION_ADD, CHANGE_VERB_ACTION_CHANGE, CHANGE_VERB_ACTION_CREATE, CHANGE_VERB_ACTION_DELETE, CHANGE_VERB_ACTION_UPDATE
Constructor and Description |
---|
InventoryFacadeClient()
Creates an instance of the client to communicate with the Inventory facade.
|
InventoryFacadeClient(BusinessContextType businessContext,
javax.security.auth.callback.CallbackHandler callbackHandler)
Creates an instance of the client to communicate with the Inventory facade.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map |
checkInventory(java.util.Map parameters)
Checks the inventory availability of an order in different locations (identified by the storeId or physicalStoreId).
|
CommerceFoundationFactory |
getCommerceFoundationFactory()
Gets the commerce foundation factory.
|
InventoryFactory |
getInventoryFactory()
Gets the inventory factory.
|
OrderFactory |
getOrderFactory()
Gets the order factory.
|
AcknowledgeInventoryRequirementType |
processInventoryRequirement(ProcessType process,
java.util.List orders)
This method communicates with the Inventory facade and sends the specified
ProcessInventoryRequirement request.
|
changeInventoryAvailability, getInventoryAvailability, getInventoryAvailability, getInventoryAvailability, processInventoryRequirement, syncInventoryAvailability
createActionExpression, createChangeVerb, createGetVerb, createGetVerb, createProcessVerb, createSyncVerb
public InventoryFacadeClient()
public InventoryFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
businessContext
- The default business context to associate with the messages
when making requests.callbackHandler
- Used for authentication purposes, as the controller provides
the authentication information to the transport when required.public java.util.Map checkInventory(java.util.Map parameters) throws InventoryRequirementException
parameters
- A map that contains name/value pairs of orderId, storeId, physicalStoreId_n.
orderId, the order ID which inventory availability will be checked. storeId, the online store Id. physicalStoreId_n, the No. n physical store Id, if only one, just use physicalStoreId.
storeId | ID of the online store. |
---|---|
overallInventoryStatus | The overall (i.e. worst) inventory status of the order/shopping cart in the online store. |
overallAvailabilityDate | The overall (i.e. latest) availability date of the order/shopping cart in the online store. |
inventoryRequirement | The InventoryRequirement SDO corresponding to the online store. |
physicalStoreInventoryAvailability | A list containing the inventory availability of the order/shopping cart in each of the physical stores specified |
---|
physicalStoreId | ID of physical store n. |
---|---|
overallInventoryStatus | The overall (i.e. worst) inventory status of the order/shopping cart in the physical store. |
overallAvailabilityDate | The overall (i.e. latest) availability date of the order/shopping cart in the physical store. |
inventoryRequirement | The InventoryRequirement SDO corresponding to the physical store. |
Sample code snippet:
Map parameters = new HashMap();
parameters.put("orderId", "10051");
parameters.put("storeId", "10001");
parameters.put("physicalStoreId_0", "50001");
parameters.put("physicalStoreId_1", "50002");
InventoryFacadeClient ifcClient = new InventoryFacadeClient(yourBusinessContext, yourCallbackHandler);
Map mapResult = ifcClient.checkInventory(parameters);
mapResult.get("storeId");
mapResult.get("overallInventoryStatus");
List physicalStoreResults = (List) (mapResult.get("physicalStoreInventoryAvailability"));
for (int i=0; i
InventoryRequirementException
public CommerceFoundationFactory getCommerceFoundationFactory()
public OrderFactory getOrderFactory()
public InventoryFactory getInventoryFactory()
public AcknowledgeInventoryRequirementType processInventoryRequirement(ProcessType process, java.util.List orders) throws InventoryRequirementException
process
- The ProcessType request.orders
- The List of a set of ordersInventoryRequirementException