|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InventoryProcessor
Interface for business logic methods having to do with SKUs and inventory.
CartProcessor
employs an
instance implementing InventoryProcessor
when inventory needs
to be processed.
When the application needs to create an instance that implements
InventoryProcessor
,
BusinessObjectFactory
finds the name of the Java class to instantiate from the
"inventoryProcessorImplementer" setting in the
appComponents.properties
file.
The default "inventoryProcessorImplementer" is
BasicInventoryProcessor
.
Method Summary | |
---|---|
java.util.Map |
defineInventorySettings(Product product,
java.util.Collection attributeSKUCollection)
Inspects a Product and returns a Map of useful variables related to the state of the product's inventory. |
java.util.Map |
processAddItems(java.util.Collection orderItems)
Processes inventory as new OrderItem s are added to a
user's cart. |
java.util.Map |
processInventory(java.util.Collection orderItems,
java.util.Map productSettings,
java.util.Collection matchingSkus,
java.lang.String decrementBehavior)
Generically processes inventory, returning a Map with information about items and skus. |
java.util.Map |
processOnCheckout(java.util.Map parameters)
Checks inventory for a user's cart during checkout. |
java.util.Map |
processOrderComplete(java.util.Map parameters)
Processes inventory for a user's cart as an order is completed. |
Method Detail |
---|
java.util.Map processAddItems(java.util.Collection orderItems) throws java.lang.Exception
OrderItem
s are added to a
user's cart. Decrements inventory levels (in the memory objects) if
products are set to be decremented upon being added to a cart. (Objects
are updated in the database by
BasicCartProcessor.processAddItems(Collection)
,
which is what calls this method.)
The default implementation of this method does the following:
OrderItem
s being added. BaseBusinessProcessor.loadMatchingSkus(Collection, Collection, Collection)
to load the skus corresponding to the OrderItem
s. processInventory(Collection, Map, Collection, String)
to process the inventory.CartProcessor.processQuantities(Collection)
to update
the cart with the new quantities.
orderItems
- The Collection
of
OrderItem
objects being added to the cart.
Map
containing results of the processing. In the
default implementation, the Map
is the same as the
one returned by
processInventory(Collection, Map, Collection, String)
(which this method calls).
java.lang.Exception
BasicCartProcessor.processAddItems(Collection)
java.util.Map processOnCheckout(java.util.Map parameters) throws java.lang.Exception
The default implementation of this method largely follows the same steps
as processAddItems(Collection)
.
parameters
- The most recent parameters submitted by the user.
Map
containing results of the processing. In the
default implementation, the Map
is the same as the
one returned by
processInventory(Collection, Map, Collection, String)
(which this method calls).
java.lang.Exception
CheckoutAction.processInventoryDiscountCheck(BaseForm)
java.util.Map processOrderComplete(java.util.Map parameters) throws java.lang.Exception
parameters
- The most recent parameters submitted by the user.
Map
containing results of the processing. In the
default implementation, the Map
is the same as the
one returned by
processInventory(Collection, Map, Collection, String)
(which this method calls).
java.lang.Exception
java.util.Map processInventory(java.util.Collection orderItems, java.util.Map productSettings, java.util.Collection matchingSkus, java.lang.String decrementBehavior) throws java.lang.Exception
orderItems
- A Collection
of
OrderItem
objects being processed.productSettings
- A Map
of Collections
representing the inventory settings in effect for the products
in the OrderItem
s.matchingSkus
- A Collection
of Map
s
representing all the SKUs associated with the
OrderItem
s.decrementBehavior
- A String
representing when inventory is to be
decremented. Either "onAddingToCart" or "onOrderCompletion".
Map
containing results of the processing. In the
default implementation, the keys of the Map
include:
skusToDecrement
: A Collection
of Map
s, each representing a
SKU
that
is to be decremented as result of the processing.decrementedSKUs
: A Map
whose
keys are OrderItem
objects and whose values are
comma-separated String
s representing the ids of
the SKU
objects corresponding to the OrderItem
that are to
be decremented. (Used to populate the OrderItem
's
descrementedSKUs
property.)rejectedOrderItems
: A
Collection
of OrderItem
objects
that have been removed from the user's cart due to their being
out of stock.adjustedQuantities
: A Map
whose keys are OrderItem
objects and whose values
are String
s representing the
OrderItem
s new quantity, after being adjusted
because not enough inventory is available.newOOSSKUs
: A Collection
of
Map
s, each representing a
SKU
that
has just reached its out of stock level as result of the
processing.productsToDeactivate
: A
Collection
of String
s, each
representing the id of a
Product
object that should now be deactivated because a
SKU
associated with it has just gone out of stock.lowStockEmails
: A Collection
of Map
s, each representing a
SKU
that
has reached its 'low stock' level, and should trigger a low stock
email as a result.java.lang.Exception
java.util.Map defineInventorySettings(Product product, java.util.Collection attributeSKUCollection)
product
- attributeSKUCollection
- An optional Collection of attribute-only SKUs used to define
the inventory settings that are returned.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |