|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.messaging.SourceSinkTemplate
atg.commerce.fulfillment.FulfillerSystem
atg.commerce.fulfillment.HardgoodFulfiller
public class HardgoodFulfiller
This class is responsible for fulfilling order fragments. It receives FulfillOrderFragment messages and allocates all the items within each shipping group contained in the message using the InventoryManager. It sends ModifyOrderNotification messages reflecting all the changes that are made during this process. This class may be extended to customize the fulfillment process.
For each item in each shipping group, the HardgoodFulfiller will use the InventoryManager and either purchase the item, backorder it, preordered it, or mark it as out of stock. When the item's stock is increased and an UpdateInventory message is sent, the HardgoodFulfiller will try again to successfully purchase the item.
It receives the messages FulfillOrderFragment, ModifyOrder, ModifyOrderNotification, and UpdateInventory
It sends ModifyOrderNotification messages.
FulfillOrderFragment
,
ModifyOrder
,
ModifyOrderNotification
,
UpdateInventory
,
InventoryManager
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
DEFAULT_CATALOG_REF_DISPLAY_NAME
|
static java.lang.String |
DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME
|
static java.lang.String |
DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT
|
static java.lang.String |
DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME
|
static java.lang.String |
DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME
|
static java.lang.String |
DEFAULT_SHIP_ITEM_REL_VIEW_NAME
|
static java.lang.String |
DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME
|
static java.lang.String |
DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME
|
static java.lang.String |
DEFUALT_SHIP_ITEM_REL_STATE_PROPERTY_NAME
|
Fields inherited from class atg.commerce.fulfillment.FulfillerSystem |
---|
mModifyOrderPort, NUCLEUS_NAME |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
HardgoodFulfiller()
|
Method Summary | |
---|---|
protected boolean |
allocateItemQuantityFromInventory(Order pOrder,
ShippingGroupCommerceItemRelationship pShippingGroupItemRelationship,
long pQuantity,
java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor |
protected boolean |
allocateShippingGroup(Order pOrder,
ShippingGroup pShippingGroup,
java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor |
protected boolean |
allocateShippingGroupItem(Order pOrder,
ShippingGroupCommerceItemRelationship pShipItemRelationship,
java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor |
java.lang.String |
getCatalogRefDisplayNamePropertyName()
The name of the property of the catalog ref (sku) to get the items display name |
java.util.Properties |
getChainToRunMap()
|
java.lang.String |
getCommerceItemCatalogRefIdPropertyName()
The name of the catalog ref id property in a CommerceItem |
java.lang.String |
getFulfillerName()
This is the name of this fulfiller. |
HardgoodShipper |
getHardgoodShipper()
The hardgood shipper is a schedulable service that simulates the periodic shipment of shipping groups. |
InventoryManager |
getInventoryManager()
The InventoryManager is used to allocate items for shipment. |
java.io.Serializable |
getKeyForMessage(javax.jms.ObjectMessage oMessage)
This method will return the key to be used for locking out other messages with the same key while a thread is handling this message. |
ModificationHandler |
getModificationHandler()
The ModificationHandler handles all processing associated with ModifyOrderNotification and ModifyOrder messages that are received by HardgoodFulfiller. |
protected java.io.Serializable |
getOrderIdFromMessage(FulfillOrderFragment cMessage)
This is called only for the FulfillOrderFragment messages |
java.lang.String |
getPartialShipPropertyName()
The profile's attribute name which represents a Boolean object containing the information on whether the profile allows for partial shipments or not. |
java.lang.String |
getShipItemRelCommerceItemPropertyName()
The name of the commerce item property name in a ShippingGroupCommerceItemRelationship |
java.lang.String |
getShipItemRelOrderPropertyName()
The name of the order property in a ShippingGroupCommerceItemRelationship |
java.lang.String |
getShipItemRelShippingGroupPropertyName()
The name of the shipping group property in a ShippingGroupCommerceItemRelationship |
java.lang.String |
getShipItemRelStatePropertyName()
The name of the state property in a ShippingGroupCommerceItemRelationship |
java.lang.String |
getShipItemRelViewName()
The name of the view in the order repository for ShipItemRels. |
java.lang.String |
getShippingGroupSubmittedDatePropertyName()
The name of the submitted date property in the shipping group |
void |
handleFulfillOrderFragment(java.lang.String pPortName,
javax.jms.ObjectMessage pMessage)
This method is called to handle all messages of type FulfillOrderFragment. |
protected boolean |
handleMessage(java.lang.String pPortName,
javax.jms.ObjectMessage pMessage)
This is called to handle a newly received message. |
void |
handleUpdateInventory(java.lang.String pPortName,
javax.jms.ObjectMessage pMessage)
This method is called to handle all messages of type UpdateInventory. |
boolean |
isAllowPartialShipmentDefault()
This property is consulted when the shipping group's special instructions doesn't have a field indicating whether a shipping group should be split on partial shipment. |
boolean |
isOutOfStockIsError()
If this is true, an OUT_OF_STOCK item is considered an error resulting in the ShippingGroup being set to PENDING_MERCHANT_ACTION. |
Order |
loadOrder(java.lang.String pId)
This method will return the Order from the order repository with the given id. |
boolean |
processMultipleShippingGroups(Order pOrder,
java.lang.String[] pShippingGroupIds,
java.util.List pPerformedModifications)
This method will process each shipping group in the given array. |
protected void |
processShippingGroup(Order pOrder,
ShippingGroup pShippingGroup,
java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor |
java.util.HashMap |
retrieveWaitingShipMap(java.lang.String[] pCatalogRefIds)
Returns a HashMap where the keys are the order ids and the values are a Set of shipping group ids of the shipping groups who have items that were on preorder and are contained in the pCatalogRefIds that are passed in. |
void |
setAllowPartialShipmentDefault(boolean pAllowPartialShipmentDefault)
|
void |
setCatalogRefDisplayNamePropertyName(java.lang.String pCatalogRefDisplayNamePropertyName)
|
void |
setChainToRunMap(java.util.Properties pChainToRunMap)
|
void |
setCommerceItemCatalogRefIdPropertyName(java.lang.String pCommerceItemCatalogRefIdPropertyName)
|
void |
setFulfillerName(java.lang.String pFulfillerName)
|
void |
setHardgoodShipper(HardgoodShipper pHardgoodShipper)
|
void |
setInventoryManager(InventoryManager pInventoryManager)
|
void |
setModificationHandler(ModificationHandler pModificationHandler)
|
void |
setOutOfStockIsError(boolean pOutOfStockIsError)
|
void |
setPartialShipPropertyName(java.lang.String pPartialShipPropertyName)
|
void |
setShipItemRelCommerceItemPropertyName(java.lang.String pShipItemRelCommerceItemPropertyName)
|
void |
setShipItemRelOrderPropertyName(java.lang.String pShipItemRelOrderPropertyName)
|
void |
setShipItemRelShippingGroupPropertyName(java.lang.String pShipItemRelShippingGroupPropertyName)
|
void |
setShipItemRelStatePropertyName(java.lang.String pShipItemRelStatePropertyName)
|
void |
setShipItemRelViewName(java.lang.String pShipItemRelViewName)
|
void |
setShippedDate(ShippingGroup pShippingGroup,
java.util.Date pShipDate,
java.util.List pModificationList)
This method sets the date when the shipping group shipped to the given time. |
void |
setShippingGroupSubmittedDatePropertyName(java.lang.String pShippingGroupSubmittedDatePropertyName)
|
protected boolean |
shipAsItemsAreAvailable(ShippingGroup sg)
Deprecated. Replaced by the pipeline processor |
boolean |
shippingGroupHasShipped(Order pOrder,
java.lang.String pShippingGroupId,
Modification pModification,
java.util.List pPerformedModifications)
This method updates the states of all the items and the shipping group itself to reflect that the shipping group has shipped. |
boolean |
shippingGroupHasShipped(java.lang.String pOrderId,
java.lang.String pShippingGroupId)
This method can be called in three ways. |
void |
updateOrder(Order pOrder)
This method will save the order passed in to the repository that is being used. |
protected void |
verifyShippingGroupFulfillment(ShippingGroup pShippingGroup)
Deprecated. Replaced by the pipeline processor |
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate |
---|
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String DEFAULT_MODIFY_ORDER_NOTIFICATION_PORT
public static final java.lang.String DEFAULT_SHIP_ITEM_REL_ORDER_PROPERTY_NAME
public static final java.lang.String DEFAULT_SHIP_ITEM_REL_SHIPPING_GROUP_PROPERTY_NAME
public static final java.lang.String DEFUALT_SHIP_ITEM_REL_COMMERCE_ITEM_PROPERTY_NAME
public static final java.lang.String DEFUALT_SHIP_ITEM_REL_STATE_PROPERTY_NAME
public static final java.lang.String DEFAULT_SHIPPING_GROUP_SUBMITTED_DATE_PROPERTY_NAME
public static final java.lang.String DEFAULT_COMMERCE_ITEM_CATALOG_REF_ID_PROPERTY_NAME
public static final java.lang.String DEFAULT_CATALOG_REF_DISPLAY_NAME
public static final java.lang.String DEFAULT_SHIP_ITEM_REL_VIEW_NAME
Constructor Detail |
---|
public HardgoodFulfiller()
Method Detail |
---|
public void setOutOfStockIsError(boolean pOutOfStockIsError)
public boolean isOutOfStockIsError()
public void setAllowPartialShipmentDefault(boolean pAllowPartialShipmentDefault)
public boolean isAllowPartialShipmentDefault()
public void setPartialShipPropertyName(java.lang.String pPartialShipPropertyName)
public java.lang.String getPartialShipPropertyName()
public void setModificationHandler(ModificationHandler pModificationHandler)
public ModificationHandler getModificationHandler()
HardgoodFulfillerModificationHandler
,
ModifyOrderNotificiation
,
ModifyOrder
public void setInventoryManager(InventoryManager pInventoryManager)
public InventoryManager getInventoryManager()
InventoryManager
public void setHardgoodShipper(HardgoodShipper pHardgoodShipper)
public HardgoodShipper getHardgoodShipper()
HardgoodShipper
public void setFulfillerName(java.lang.String pFulfillerName)
public java.lang.String getFulfillerName()
public void setShipItemRelOrderPropertyName(java.lang.String pShipItemRelOrderPropertyName)
public java.lang.String getShipItemRelOrderPropertyName()
public void setShipItemRelShippingGroupPropertyName(java.lang.String pShipItemRelShippingGroupPropertyName)
public java.lang.String getShipItemRelShippingGroupPropertyName()
public void setShipItemRelCommerceItemPropertyName(java.lang.String pShipItemRelCommerceItemPropertyName)
public java.lang.String getShipItemRelCommerceItemPropertyName()
public void setShipItemRelStatePropertyName(java.lang.String pShipItemRelStatePropertyName)
public java.lang.String getShipItemRelStatePropertyName()
public void setShippingGroupSubmittedDatePropertyName(java.lang.String pShippingGroupSubmittedDatePropertyName)
public java.lang.String getShippingGroupSubmittedDatePropertyName()
public void setCommerceItemCatalogRefIdPropertyName(java.lang.String pCommerceItemCatalogRefIdPropertyName)
public java.lang.String getCommerceItemCatalogRefIdPropertyName()
public void setCatalogRefDisplayNamePropertyName(java.lang.String pCatalogRefDisplayNamePropertyName)
public java.lang.String getCatalogRefDisplayNamePropertyName()
public void setShipItemRelViewName(java.lang.String pShipItemRelViewName)
public java.lang.String getShipItemRelViewName()
public java.util.Properties getChainToRunMap()
public void setChainToRunMap(java.util.Properties pChainToRunMap)
protected boolean handleMessage(java.lang.String pPortName, javax.jms.ObjectMessage pMessage) throws javax.jms.JMSException
This is called to handle a newly received message. Before this method is called, the message is subjected to basic validity checks, a transaction is established, and an exclusive lock is acquired for the message's key.
HardgoodFulfiller handles the following types of messages:
HardgoodFulfiller can be extended to handle extra types of messages by overriding the handleNewMessageType method.
handleMessage
in class FulfillerSystem
pPortName
- - the port on which this message was receivedpMessage
- - the message that was sent on the port
javax.jms.JMSException
FulfillOrderFragment
,
handleFulfillOrderFragment(java.lang.String, javax.jms.ObjectMessage)
,
ModifyOrder
,
HardgoodFulfillerModificationHandler.handleModifyOrder(java.lang.String, javax.jms.ObjectMessage)
,
ModifyOrderNotification
,
HardgoodFulfillerModificationHandler.handleModifyOrderNotification(java.lang.String, javax.jms.ObjectMessage)
,
UpdateInventory
,
handleUpdateInventory(java.lang.String, javax.jms.ObjectMessage)
,
FulfillerSystem#receive
,
FulfillerSystem.handleNewMessageType(java.lang.String, javax.jms.ObjectMessage)
public java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage) throws javax.jms.JMSException
getKeyForMessage
in class FulfillerSystem
pMessage
- the ObjectMessage containing the CommerceMessage.
javax.jms.JMSException
protected java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
public void handleFulfillOrderFragment(java.lang.String pPortName, javax.jms.ObjectMessage pMessage) throws javax.jms.JMSException
This method is called to handle all messages of type
FulfillOrderFragment. Should developers wish to change the
behavior of the HardgoodFulfiller class in handling a
FulfillOrderFragment message this method should be overriden. It
will call to the pipeline chain to process the message.
The chain first loads the order with loadOrder, then calls
processMultipleShippingGroups for each order and its shipping
groups in the message. When processing has finished, it calls
updateOrder and sends all the changes that were made using
OrderFulfillmentTools.sendModifyOrderNotification()
pPortName
- The port from which the FulfillOrderFragment was received.pMessage
- The message that was received.
javax.jms.JMSException
FulfillOrderFragment
,
updateOrder(atg.commerce.order.Order)
,
processMultipleShippingGroups(atg.commerce.order.Order, java.lang.String[], java.util.List)
,
OrderFulfillmentTools.sendModifyOrderNotification(java.lang.String, java.util.List, atg.commerce.fulfillment.ModifyOrder, atg.commerce.messaging.SourceSinkTemplate, java.lang.String, atg.commerce.fulfillment.ModifyOrderNotification)
public void handleUpdateInventory(java.lang.String pPortName, javax.jms.ObjectMessage pMessage) throws javax.jms.JMSException
This method is called to handle all messages of type
UpdateInventory. Should developers wish to change the behavior
of the HardgoodFulfiller class in handling an UpdateInventory
message the method should be overridden. This message gets all
the orders waiting on the items contained in the message using
retrieveBackorderedShipMap and retrievePreorderedShipMap then
loads each order (loadOrder) and calls processShippingGroup for
each shipping group "owned" by this fulfiller. Once finished it
saves the changes (updateOrder) and send its modifications with
OrderFulfillmentTools.sendModifyOrderNotification
pPortName
- The port from which this message was received.pMessage
- The message that was received.
javax.jms.JMSException
UpdateInventory
,
retrieveWaitingShipMap(java.lang.String[])
,
loadOrder(java.lang.String)
,
processShippingGroup(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List)
,
OrderFulfillmentTools.#sendModifyOrderNotification
protected void processShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList) throws CommerceException
pOrder
- The order containing the shipping group we are processingpShippingGroup
- The shipping group we will try to allocate and shippModificationList
- List holding any modifications we might make
CommerceException
verifyShippingGroupFulfillment(atg.commerce.order.ShippingGroup)
,
allocateShippingGroup(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List)
,
#queueForShipping
,
shipAsItemsAreAvailable(atg.commerce.order.ShippingGroup)
,
splitShippingGroupWithAvailableItems(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List)
protected void verifyShippingGroupFulfillment(ShippingGroup pShippingGroup) throws IllegalShippingGroupStateException
pShippingGroup
- The shipping group we are verifying
IllegalShippingGroupStateException
atg.commerce.states.ShippingGroupStates#REMOVED,
,
atg.commerce.states.ShippingGroupStates#FAILED,
,
atg.commerce.states.ShippingGroupStates#NO_PENDING_ACTION,
,
ShippingGroupStates.PENDING_MERCHANT_ACTION
protected boolean allocateShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
pOrder
- The affect Order owning this ShippingGrouppShippingGroup
- The ShippingGroup we are checkingpModificationList
- Place to store our changes.
protected boolean allocateShippingGroupItem(Order pOrder, ShippingGroupCommerceItemRelationship pShipItemRelationship, java.util.List pModificationList)
pOrder
- the order in which this shipping group ispShipGroup
- the shipping group whose item states we are changingpModificationList
- the list of the modifications made to the items
allocateItemQuantityFromInventory(atg.commerce.order.Order, atg.commerce.order.ShippingGroupCommerceItemRelationship, long, java.util.List)
protected boolean allocateItemQuantityFromInventory(Order pOrder, ShippingGroupCommerceItemRelationship pShippingGroupItemRelationship, long pQuantity, java.util.List pModificationList) throws CommerceException
pOrder
- The order containing this item.pShippingGroupItemRelationship
- The item to allocatepQuantity
- The quantity of the item to allocate. Does not verify that this quantity
and the quantity in the item match.pModificationList
- Place to store any modifications that are made.
CommerceException
InventoryManager
protected boolean shipAsItemsAreAvailable(ShippingGroup sg)
pOrder
- The order we are interested in
public boolean shippingGroupHasShipped(java.lang.String pOrderId, java.lang.String pShippingGroupId)
pOrder
- The order containing the shipping grouppShippingGroup
- The shipping group to ship
HardgoodShipper
,
ShippingDroplet
,
ModifyOrder
,
GenericUpdate
public boolean shippingGroupHasShipped(Order pOrder, java.lang.String pShippingGroupId, Modification pModification, java.util.List pPerformedModifications)
setShippedDate
with the given shipping group.
If for some reason, the group could not be shipped, this method will return false.
pOrder
- The order containing the shipping grouppShippingGroupId
- The id of the shipping group to shippModification
- The modification request this action is in response topPerformedModifications
- The list to store our performed modifications in
setShippedDate(atg.commerce.order.ShippingGroup, java.util.Date, java.util.List)
public boolean processMultipleShippingGroups(Order pOrder, java.lang.String[] pShippingGroupIds, java.util.List pPerformedModifications) throws CommerceException
pOrder
- The order containing the shipping groups.pShippingGroupIds
- The array of shipping group ids to process.pPerformedModifications
- A place to store all new modifications.
CommerceException
public void setShippedDate(ShippingGroup pShippingGroup, java.util.Date pShipDate, java.util.List pModificationList)
actualShipDate
pShippingGroup
- The shipping group that shipped.pShipDate
- When the shipping group shipped.pModificationList
- Place to store new modifications.public java.util.HashMap retrieveWaitingShipMap(java.lang.String[] pCatalogRefIds)
pCatalogRefIds
- - the array of sku ids that have been moved off preorder
public Order loadOrder(java.lang.String pId) throws CommerceException
pId
- the id of the order to be retrieved
CommerceException
public void updateOrder(Order pOrder) throws CommerceException
pOrder
- - the order to be saved
CommerceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |