atg.commerce.order.abandoned
Class AbandonedOrderTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.abandoned.AbandonedOrderTools
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class AbandonedOrderTools
extends GenericService

This class contains methods used by several components of the Abandoned Shopping Carts feature. It also provides a central location for the definition of property, repository item, order state, and abandonment state names. There are methods that are used to send the various abandonment JMS messages, and perform the functions needed for the SetLastUpdated, ReanimateAbandonedOrder, and ConvertAbandonedOrder scenario actions and droplets.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mOrderPriceInfoPropertyName
           
protected  java.lang.String mPriceInfoAmountPropertyName
           
protected  java.lang.String mPriceInfoCurrencyCodePropertyName
           
protected  javax.transaction.TransactionManager mTransactionManager
           
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
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
AbandonedOrderTools()
           
 
Method Summary
protected  void addAbandonedOrderToProfile(java.lang.String pProfileId, java.lang.String pOrderId)
          This method subtracts one from the abandonedOrderCount of the given profile.
 void convertAbandonedOrder(java.lang.String pOrderId)
          This method sets the abandonment state of the given order to CONVERTED, sets the conversionDate property to the current system time, and sends an OrderConverted message if configured to do so.
protected  MutableRepositoryItem createAbandonmentInfo(RepositoryItem pOrder)
          This method generates a new abandonmentInfo object for the given order.
 void doStartService()
          doStartService() validates that the default reanimated state exists in the list of reanimated states and that the default lost state exists in the list of lost states
 java.lang.String[] getAbandonableOrderStates()
           
 java.lang.String getAbandonedOrderItemName()
           
 java.lang.String getAbandonedOrderOrderIdPropertyName()
           
 java.lang.String getAbandonedOrderProfileIdPropertyName()
           
 java.lang.String getAbandonmentCountPropertyName()
           
 java.lang.String getAbandonmentDatePropertyName()
           
protected  RepositoryItem getAbandonmentInfo(RepositoryItem pOrder, boolean pCreate)
          This method gets the abandonmentInfo item associated with the given order.
 java.lang.String getAbandonmentInfoItemName()
           
 java.lang.String getAbandonmentInfoPropertyName()
           
 java.lang.String getAbandonmentStatePropertyName()
           
 java.lang.String getConversionDatePropertyName()
           
 java.lang.String getDefaultAbandonedState()
           
 java.lang.String getDefaultConvertedState()
           
 java.lang.String getDefaultLostState()
           
 java.lang.String getDefaultReanimatedState()
           
 java.lang.String getLastUpdatedPropertyName()
           
 java.lang.String[] getLostAbandonmentStates()
           
 java.lang.String getLostDatePropertyName()
           
 AbandonedOrderMessageFactory getMessageFactory()
           
 MessageSender getMessageSender()
           
 java.lang.String getOrderIdPropertyName()
           
 java.lang.String getOrderItemName()
           
 OrderManager getOrderManager()
           
 java.lang.String getOrderPriceInfoPropertyName()
           
 java.lang.String getOrderPropertyName()
           
 MutableRepository getOrderRepository()
           
 java.lang.String getPriceInfoAmountPropertyName()
           
 java.lang.String getPriceInfoCurrencyCodePropertyName()
           
 java.lang.String getProfileIdPropertyName()
           
 java.lang.String getProfileItemName()
           
 MutableRepository getProfileRepository()
           
 java.lang.String[] getReanimateableAbandonmentStates()
           
 java.lang.String[] getReanimatedAbandonmentStates()
           
 java.lang.String getReanimationDatePropertyName()
           
 javax.transaction.TransactionManager getTransactionManager()
          Transaction Manager
 boolean isDeleteLostOrders()
           
 boolean isLeaveAbandonmentInfoForDeletedOrders()
           
 boolean isSendOrderAbandonedMessage()
           
 boolean isSendOrderConvertedMessage()
           
 boolean isSendOrderLostMessage()
           
 boolean isSendOrderReanimatedMessage()
           
 void reanimateAbandonedOrder(java.lang.String pOrderId)
          This method checks first to see if the given order has an abandonmentInfo item associated it.
protected  void removeAbandonedOrderFromProfile(java.lang.String pOrderId)
          This method subtracts one from the abandonedOrderCount of the given profile.
 void setAbandonableOrderStates(java.lang.String[] pAbandonableOrderStates)
          The possible order states an order must be for the AbandonedOrderService to identify the order as abandoned or lost.
 void setAbandonedOrderItemName(java.lang.String pAbandonedOrderItemName)
          The name of the abandonedOrder item descriptor in the profile repository.
 void setAbandonedOrderOrderIdPropertyName(java.lang.String pAbandonedOrderOrderIdPropertyName)
          The name of the property in the abandonedOrder repository item that holds the ID of the order.
 void setAbandonedOrderProfileIdPropertyName(java.lang.String pAbandonedOrderProfileIdPropertyName)
          The name of the property in the abandonedOrder repository item that holds the ID of the profile that owns the order.
 void setAbandonmentCountPropertyName(java.lang.String pAbandonmentCountPropertyName)
          The name of the property in the abandonmentInfo repository item that indicates the number of times the order has been abandoned.
 void setAbandonmentDatePropertyName(java.lang.String pAbandonmentDatePropertyName)
          The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as abandoned.
 void setAbandonmentInfoItemName(java.lang.String pAbandonmentInfoItemName)
          The name of the abandonmentInfo item descriptor in the order repository.
 void setAbandonmentInfoPropertyName(java.lang.String pAbandonmentInfoPropertyName)
          The name of the order property that refers to its abandonmentInfo item
 void setAbandonmentStatePropertyName(java.lang.String pAbandonmentStatePropertyName)
          The name of the abandonmentInfo property that holds the abandonment state of the order.
 void setConversionDatePropertyName(java.lang.String pConversionDatePropertyName)
          The name of the property in the abandonmentInfo repository item that holds the date/time when the order was converted.
 void setDefaultAbandonedState(java.lang.String pDefaultAbandonedState)
          The abandonment state that will be assigned to orders identified as abandoned.
 void setDefaultConvertedState(java.lang.String pDefaultConvertedState)
          The abandonment state that should be assigned to orders identified as converted.
 void setDefaultLostState(java.lang.String pDefaultLostState)
          The abandonment state that will be assigned to orders identified as lost.
 void setDefaultReanimatedState(java.lang.String pDefaultReanimatedState)
          The abandonment state that should be assigned to orders identified as reanimated.
 void setDeleteLostOrders(boolean pDeleteLostOrders)
          Boolean indicating if orders identified as lost should be removed from the order repository.
 void setLastUpdated(java.lang.String pOrderId)
          This method sets the lastUpdated property of the abandonmentInfo repository item associated with the given order to the current system time.
 void setLastUpdatedPropertyName(java.lang.String pLastUpdatedPropertyName)
          The name of the property to be updated by the SetLastUpdated scenario action and droplet.
 void setLeaveAbandonmentInfoForDeletedOrders(boolean pLeaveAbandonmentInfoForDeletedOrders)
          Boolean indicating if we should leave an orphan abandonmentInfo item in the repository after we delete a lost order.
 void setLostAbandonmentStates(java.lang.String[] pLostAbandonmentStates)
          All the possible abandonment states that an order can have for it to be considered lost.
 void setLostDatePropertyName(java.lang.String pLostDatePropertyName)
          The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as lost.
 void setMessageFactory(AbandonedOrderMessageFactory pMessageFactory)
          The component that builds abandonment-related JMS messages: OrderAbandoned, OrderReanimated, OrderConverted, and OrderLost
 void setMessageSender(MessageSender pMessageSender)
          The component that sends abandonment-related JMS messages.
 void setOrderIdPropertyName(java.lang.String pOrderIdPropertyName)
          The name of the property in the abandonmentInfo repository item that holds the ID of the order associated with it.
 void setOrderItemName(java.lang.String pOrderItemName)
          The name of the order item descriptor in the order repository.
 void setOrderManager(OrderManager pOrderManager)
          OrderManager is used to delete lost orders if the service is configured to do so.
 void setOrderPriceInfoPropertyName(java.lang.String pOrderPriceInfoPropertyName)
          The name of the property in the order repository item that holds the order's price info.
 void setOrderPropertyName(java.lang.String pOrderPropertyName)
          The name of the property in the abandonmentInfo repository item that refers back to the order reposiory item associated with it.
 void setOrderRepository(MutableRepository pOrderRepository)
          The order repository in which to look for abandoned orders.
 void setPriceInfoAmountPropertyName(java.lang.String pPriceInfoAmountPropertyName)
          The name of the property in the orderPriceInfo repository item that holds the order's monetary value.
 void setPriceInfoCurrencyCodePropertyName(java.lang.String pPriceInfoCurrencyCodePropertyName)
          The name of the property in the orderPriceInfo repository item that holds the currency code for the order's monetary value.
 void setProfileIdPropertyName(java.lang.String pProfileIdPropertyName)
          The name of the property in the order repository item that holds the ID of the profile that owns the order.
 void setProfileItemName(java.lang.String pProfileItemName)
          The name of the user item descriptor in the profile repository.
 void setProfileRepository(MutableRepository pProfileRepository)
          The profile repository in which to edit the "abandonedOrderCount" property of profiles.
 void setReanimateableAbandonmentStates(java.lang.String[] pReanimateableAbandonmentStates)
          The possible abandonment states of abandoned and lost orders.
 void setReanimatedAbandonmentStates(java.lang.String[] pReanimatedAbandonmentStates)
          The possible abandonment states that an order can have for it no longer to be considered abandoned.
 void setReanimationDatePropertyName(java.lang.String pReanimationDatePropertyName)
          The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently reanimated.
 void setSendOrderAbandonedMessage(boolean pSendOrderAbandonedMessage)
          Boolean indicating if OrderAbandoned messages should be sent when the service identifies an abandoned order.
 void setSendOrderConvertedMessage(boolean pSendOrderConvertedMessage)
          Boolean indicating if an OrderConverted message should be sent when an abandoned order is converted.
 void setSendOrderLostMessage(boolean pSendOrderLostMessage)
          Boolean indicating if OrderLost messages should be sent when the service identifies a lost order.
 void setSendOrderReanimatedMessage(boolean pSendOrderReanimatedMessage)
          Boolean indicating if an OrderReanimated message should be sent when an abandoned order is reanimated.
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets the Transaction Manager.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Resource Bundle


mTransactionManager

protected javax.transaction.TransactionManager mTransactionManager

mOrderPriceInfoPropertyName

protected java.lang.String mOrderPriceInfoPropertyName

mPriceInfoAmountPropertyName

protected java.lang.String mPriceInfoAmountPropertyName

mPriceInfoCurrencyCodePropertyName

protected java.lang.String mPriceInfoCurrencyCodePropertyName
Constructor Detail

AbandonedOrderTools

public AbandonedOrderTools()
Method Detail

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the Transaction Manager.


getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Transaction Manager


setOrderRepository

public void setOrderRepository(MutableRepository pOrderRepository)
The order repository in which to look for abandoned orders.

Parameters:
pOrderRepository - the order repository in which to look for abandoned orders.

getOrderRepository

public MutableRepository getOrderRepository()
Returns:
returns the order repository to search for abandoned and lost orders, and to which the abandonment data will be added

setOrderManager

public void setOrderManager(OrderManager pOrderManager)
OrderManager is used to delete lost orders if the service is configured to do so.

Parameters:
pOrderManager - the OrderManager component that will be used to delete lost orders.

getOrderManager

public OrderManager getOrderManager()
Returns:
returns the OrderManager component that will be used to delete lost orders.

setProfileRepository

public void setProfileRepository(MutableRepository pProfileRepository)
The profile repository in which to edit the "abandonedOrderCount" property of profiles.

Parameters:
pProfileRepository - the profile repository in which to edit the "abandonedOrderCount" property of profiles.

getProfileRepository

public MutableRepository getProfileRepository()
Returns:
Returns the profile repository in which to edit the "abandonedOrderCount" property of profiles.

setAbandonableOrderStates

public void setAbandonableOrderStates(java.lang.String[] pAbandonableOrderStates)
The possible order states an order must be for the AbandonedOrderService to identify the order as abandoned or lost. These should be the order states where the order is not checked out, and it is up to the user to do something further with the order. By default, this will only be "INCOMPLETE".

Parameters:
pAbandonableOrderStates - the possible order states an order must be in to be considered abandoned or lost.

getAbandonableOrderStates

public java.lang.String[] getAbandonableOrderStates()
Returns:
Returns the possible states an order must be in to be considered abandoned or lost.

setReanimateableAbandonmentStates

public void setReanimateableAbandonmentStates(java.lang.String[] pReanimateableAbandonmentStates)
The possible abandonment states of abandoned and lost orders. Orders with these abandonment states are to be considered REANIMATED if they are modified by the owner of the order.

Parameters:
pReanimateableAbandonmentStates - the possible abandonment states of abandoned and lost orders. Orders with these abandonment states are to be considered REANIMATED if they are modified by the owner of the order.

getReanimateableAbandonmentStates

public java.lang.String[] getReanimateableAbandonmentStates()
Returns:
Returns the possible abandonment states of abandoned and lost orders. Used to determine if a modified order should be considered reanimated.

setReanimatedAbandonmentStates

public void setReanimatedAbandonmentStates(java.lang.String[] pReanimatedAbandonmentStates)
The possible abandonment states that an order can have for it no longer to be considered abandoned. This will be checked to determine if an order with abandonment info should be re-identified as abandoned.

Parameters:
pReanimatedAbandonmentStates - The possible abandonment states that an order can have for it no longer to be considered abandoned. This will be checked to determine if an order with abandonment info should be re-identified as abandoned.

getReanimatedAbandonmentStates

public java.lang.String[] getReanimatedAbandonmentStates()
Returns:
Returns the possible abandonment states that an order can have for it no longer to be considered abandoned. This will be checked to determine if an order with abandonment info should be re-identified as abandoned.

setLostAbandonmentStates

public void setLostAbandonmentStates(java.lang.String[] pLostAbandonmentStates)
All the possible abandonment states that an order can have for it to be considered lost. The abandonment state of an order identified as lost will be checked against this list to determine if it has already been identified as lost.

Parameters:
pLostAbandonmentStates - All the possible abandonment states that an order can have for it to be considered lost. The abandonment state of an order identified as lost will be checked against this list to determine if it has already been identified as lost.

getLostAbandonmentStates

public java.lang.String[] getLostAbandonmentStates()
Returns:
Returns All the possible abandonment states that an order can have for it to be considered lost. The abandonment state of an order identified as lost will be checked against this list to determine if it has already been identified as lost.

setDefaultAbandonedState

public void setDefaultAbandonedState(java.lang.String pDefaultAbandonedState)
The abandonment state that will be assigned to orders identified as abandoned.

Parameters:
pAbandonedState - the abandonment state that will be assigned to orders identified as abandoned.

getDefaultAbandonedState

public java.lang.String getDefaultAbandonedState()
Returns:
Returns the abandonment state that will be assigned to orders identified as abandoned.

setDefaultReanimatedState

public void setDefaultReanimatedState(java.lang.String pDefaultReanimatedState)
The abandonment state that should be assigned to orders identified as reanimated.

Parameters:
pReanimatedState - the abandonment state that should be assigned to orders identified as reanimated

getDefaultReanimatedState

public java.lang.String getDefaultReanimatedState()
Returns:
Returns the abandonment state should be assigned to orders identified as reanimated.

setDefaultConvertedState

public void setDefaultConvertedState(java.lang.String pDefaultConvertedState)
The abandonment state that should be assigned to orders identified as converted.

Parameters:
pDefaultConvertedState - the abandonment state that should be assigned to orders identified as converted

getDefaultConvertedState

public java.lang.String getDefaultConvertedState()
Returns:
Returns the abandonment state should be assigned to orders identified as converted.

setDefaultLostState

public void setDefaultLostState(java.lang.String pDefaultLostState)
The abandonment state that will be assigned to orders identified as lost.

Parameters:
pDefaultLostState - the abandonment state that will be assigned to orders identified as lost

getDefaultLostState

public java.lang.String getDefaultLostState()
Returns:
Returns the abandonment state should be assigned to orders identified as lost.

setOrderItemName

public void setOrderItemName(java.lang.String pOrderItemName)
The name of the order item descriptor in the order repository.

Parameters:
pOrderItemName - the name of the order item descriptor in the order repository.

getOrderItemName

public java.lang.String getOrderItemName()
Returns:
Returns the name of the order item descriptor in the order repository.

setProfileItemName

public void setProfileItemName(java.lang.String pProfileItemName)
The name of the user item descriptor in the profile repository.

Parameters:
pProfileItemName - the name of the user item descriptor in the profile repository.

getProfileItemName

public java.lang.String getProfileItemName()
Returns:
Returns the name of the user item descriptor in the profile repository

setAbandonmentInfoItemName

public void setAbandonmentInfoItemName(java.lang.String pAbandonmentInfoItemName)
The name of the abandonmentInfo item descriptor in the order repository.

Parameters:
pAbandonmentInfoItemName - the name of the abandonmentInfo item descriptor in the order repository.

getAbandonmentInfoItemName

public java.lang.String getAbandonmentInfoItemName()
Returns:
Returns the name of the abandonmentInfo item descriptor in the order repository.

setAbandonedOrderItemName

public void setAbandonedOrderItemName(java.lang.String pAbandonedOrderItemName)
The name of the abandonedOrder item descriptor in the profile repository.

Parameters:
pAbandonedOrderItemName - the name of the abandonedOrder item descriptor in the profile repository.

getAbandonedOrderItemName

public java.lang.String getAbandonedOrderItemName()
Returns:
Returns the name of the abandonedOrder item descriptor in the profile repository.

setAbandonmentInfoPropertyName

public void setAbandonmentInfoPropertyName(java.lang.String pAbandonmentInfoPropertyName)
The name of the order property that refers to its abandonmentInfo item

Parameters:
pAbandonmentInfoPropertyName - the name of the order property that refers to its abandonmentInfo item.

getAbandonmentInfoPropertyName

public java.lang.String getAbandonmentInfoPropertyName()
Returns:
Returns the name of the order property that refers to its abandonmentInfo item

setAbandonmentStatePropertyName

public void setAbandonmentStatePropertyName(java.lang.String pAbandonmentStatePropertyName)
The name of the abandonmentInfo property that holds the abandonment state of the order.

Parameters:
pAbandonmentStatePropertyName - the name of the abandonmentInfo property that holds the abandonment state of the order.

getAbandonmentStatePropertyName

public java.lang.String getAbandonmentStatePropertyName()
Returns:
Returns the name of the abandonmentInfo property that indicates the abandonment state of the order.

setOrderPropertyName

public void setOrderPropertyName(java.lang.String pOrderPropertyName)
The name of the property in the abandonmentInfo repository item that refers back to the order reposiory item associated with it.

Parameters:
pOrderPropertyName - the name of the property in the abandonmentInfo repository item that refers back to the order repository item associated with it.

getOrderPropertyName

public java.lang.String getOrderPropertyName()
Returns:
Returns the name of the property in the abandonmentInfo repository item that refers back to the order repository item associated with it.

setOrderIdPropertyName

public void setOrderIdPropertyName(java.lang.String pOrderIdPropertyName)
The name of the property in the abandonmentInfo repository item that holds the ID of the order associated with it.

Parameters:
pOrderIdPropertyName - the name of the property in the abandonmentInfo repository item that holds the ID of the order associated with it.

getOrderIdPropertyName

public java.lang.String getOrderIdPropertyName()
Returns:
Returns the name of the property in the abandonmentInfo repository item that holds the ID of the order associated with it.

setProfileIdPropertyName

public void setProfileIdPropertyName(java.lang.String pProfileIdPropertyName)
The name of the property in the order repository item that holds the ID of the profile that owns the order.

Parameters:
pProfileIdPropertyName - the name of the property in the order repository item that holds the ID of the profile that owns the order.

getProfileIdPropertyName

public java.lang.String getProfileIdPropertyName()
Returns:
Returns the name of the property in the order repository item that holds the ID of the profile that owns the order.

setAbandonedOrderOrderIdPropertyName

public void setAbandonedOrderOrderIdPropertyName(java.lang.String pAbandonedOrderOrderIdPropertyName)
The name of the property in the abandonedOrder repository item that holds the ID of the order.

Parameters:
pAbandonedOrderOrderIdPropertyName - the name of the property in the abandonedOrder repository item that holds the ID of the order.

getAbandonedOrderOrderIdPropertyName

public java.lang.String getAbandonedOrderOrderIdPropertyName()
Returns:
Returns the name of the property in the abandonedOrder repository item that holds the ID of the order.

setAbandonedOrderProfileIdPropertyName

public void setAbandonedOrderProfileIdPropertyName(java.lang.String pAbandonedOrderProfileIdPropertyName)
The name of the property in the abandonedOrder repository item that holds the ID of the profile that owns the order.

Parameters:
pProfileIdPropertyName - the name of the property in the abandonedOrder repository item that holds the ID of the profile that owns the order.

getAbandonedOrderProfileIdPropertyName

public java.lang.String getAbandonedOrderProfileIdPropertyName()
Returns:
Returns the name of the property in the abandonedOrder repository item that holds the ID of the profile that owns the order.

setAbandonmentCountPropertyName

public void setAbandonmentCountPropertyName(java.lang.String pAbandonmentCountPropertyName)
The name of the property in the abandonmentInfo repository item that indicates the number of times the order has been abandoned.

Parameters:
pAbandonmentCountPropertyName - the name of the property in the abandonmentInfo repository item that indicates the number of times the order has been abandoned.

getAbandonmentCountPropertyName

public java.lang.String getAbandonmentCountPropertyName()
Returns:
Returns the name of the property in the abandonmentInfo repository item that indicates the number of times the order has been abandoned.

setAbandonmentDatePropertyName

public void setAbandonmentDatePropertyName(java.lang.String pAbandonmentDatePropertyName)
The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as abandoned.

Parameters:
pAbandonmentTimePropertyName - the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as abandoned.

getAbandonmentDatePropertyName

public java.lang.String getAbandonmentDatePropertyName()
Returns:
Retuns the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as abandoned.

setReanimationDatePropertyName

public void setReanimationDatePropertyName(java.lang.String pReanimationDatePropertyName)
The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently reanimated.

Parameters:
pAbandonmentDatePropertyName - the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently reanimated.

getReanimationDatePropertyName

public java.lang.String getReanimationDatePropertyName()
Returns:
Retuns the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently reanimated.

setConversionDatePropertyName

public void setConversionDatePropertyName(java.lang.String pConversionDatePropertyName)
The name of the property in the abandonmentInfo repository item that holds the date/time when the order was converted.

Parameters:
pAbandonmentDatePropertyName - the name of the property in the abandonmentInfo repository item that holds the date/time when the order was converted.

getConversionDatePropertyName

public java.lang.String getConversionDatePropertyName()
Returns:
Retuns the name of the property in the abandonmentInfo repository item that holds the date/time when the order was converted.

setLostDatePropertyName

public void setLostDatePropertyName(java.lang.String pLostDatePropertyName)
The name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as lost.

Parameters:
pLostDatePropertyName - the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as lost.

getLostDatePropertyName

public java.lang.String getLostDatePropertyName()
Returns:
Retuns the name of the property in the abandonmentInfo repository item that holds the date/time when the order was most recently identified as lost.

setOrderPriceInfoPropertyName

public void setOrderPriceInfoPropertyName(java.lang.String pOrderPriceInfoPropertyName)
The name of the property in the order repository item that holds the order's price info.

Parameters:
pOrderPriceInfoPropertyName - the name of the order price info property

getOrderPriceInfoPropertyName

public java.lang.String getOrderPriceInfoPropertyName()
Returns:
Returns the name of the property in the order repository item that holds the order's price info.

setPriceInfoAmountPropertyName

public void setPriceInfoAmountPropertyName(java.lang.String pPriceInfoAmountPropertyName)
The name of the property in the orderPriceInfo repository item that holds the order's monetary value.

Parameters:
pPriceInfoAmountPropertyName - the name of the order price info property

getPriceInfoAmountPropertyName

public java.lang.String getPriceInfoAmountPropertyName()
Returns:
Returns the name of the property in the orderPriceInfo repository item that holds the order's monetary value.

setPriceInfoCurrencyCodePropertyName

public void setPriceInfoCurrencyCodePropertyName(java.lang.String pPriceInfoCurrencyCodePropertyName)
The name of the property in the orderPriceInfo repository item that holds the currency code for the order's monetary value.

Parameters:
pPriceInfoCurrencyCodePropertyName - the name of the order price info property

getPriceInfoCurrencyCodePropertyName

public java.lang.String getPriceInfoCurrencyCodePropertyName()
Returns:
Returns the name of the property in the orderPriceInfo repository item that holds the currency code for the order's monetary value.

setMessageFactory

public void setMessageFactory(AbandonedOrderMessageFactory pMessageFactory)
The component that builds abandonment-related JMS messages: OrderAbandoned, OrderReanimated, OrderConverted, and OrderLost

Parameters:
pMessageFactory - the component that builds abandonment-related JMS messages: OrderAbandoned, OrderReanimated, OrderConverted, and OrderLost

getMessageFactory

public AbandonedOrderMessageFactory getMessageFactory()
Returns:
Returns the component that builds abandonment-related JMS messages: OrderAbandoned, OrderReanimated, OrderConverted, and OrderLost

setMessageSender

public void setMessageSender(MessageSender pMessageSender)
The component that sends abandonment-related JMS messages.

Parameters:
pMessageSender - the component that sends abandonment-related JMS messages.

getMessageSender

public MessageSender getMessageSender()
Returns:
Returns the component that sends abandonment-related JMS messages.

setSendOrderAbandonedMessage

public void setSendOrderAbandonedMessage(boolean pSendOrderAbandonedMessage)
Boolean indicating if OrderAbandoned messages should be sent when the service identifies an abandoned order.

Parameters:
pSendOrderAbandonedMessage - boolean indicating if OrderAbandoned messages should be sent when the service identifies an abandoned order.

isSendOrderAbandonedMessage

public boolean isSendOrderAbandonedMessage()
Returns:
Returns boolean indicating if OrderAbandoned messages should be sent when the service identifies an abandoned order.

setSendOrderReanimatedMessage

public void setSendOrderReanimatedMessage(boolean pSendOrderReanimatedMessage)
Boolean indicating if an OrderReanimated message should be sent when an abandoned order is reanimated.

Parameters:
pSendOrderReanimatedMessage - boolean indicating if an OrderReanimated message should be sent when an abandoned order is reanimated.

isSendOrderReanimatedMessage

public boolean isSendOrderReanimatedMessage()
Returns:
Returns boolean indicating if an OrderReanimated message should be sent when an abandoned order is reanimated.

setSendOrderConvertedMessage

public void setSendOrderConvertedMessage(boolean pSendOrderConvertedMessage)
Boolean indicating if an OrderConverted message should be sent when an abandoned order is converted.

Parameters:
pSendOrderConvertedMessage - boolean indicating if an OrderConverted message should be sent when an abandoned order is converted.

isSendOrderConvertedMessage

public boolean isSendOrderConvertedMessage()
Returns:
Return boolean indicating if an OrderConverted message should be sent when an abandoned order is converted.

setSendOrderLostMessage

public void setSendOrderLostMessage(boolean pSendOrderLostMessage)
Boolean indicating if OrderLost messages should be sent when the service identifies a lost order.

Parameters:
pSendOrderLostMessage - boolean indicating if an OrderLost message should be sent when the service identifies a lost order.

isSendOrderLostMessage

public boolean isSendOrderLostMessage()
Returns:
Returns boolean indicating if OrderLost messages should be sent when the service identifies a lost order.

setDeleteLostOrders

public void setDeleteLostOrders(boolean pDeleteLostOrders)
Boolean indicating if orders identified as lost should be removed from the order repository.

Parameters:
pDeleteLostOrders - boolean indicating if orders identified as lost should be removed from the order repository

isDeleteLostOrders

public boolean isDeleteLostOrders()
Returns:
Returns boolean indicating if orders identified as lost should be removed from the order repository.

setLeaveAbandonmentInfoForDeletedOrders

public void setLeaveAbandonmentInfoForDeletedOrders(boolean pLeaveAbandonmentInfoForDeletedOrders)
Boolean indicating if we should leave an orphan abandonmentInfo item in the repository after we delete a lost order.

Parameters:
pLeaveAbandonmentInfoForDeletedOrders - Boolean indicating if we should leave an orphan abandonmentInfo item in the repository after we delete a lost order.

isLeaveAbandonmentInfoForDeletedOrders

public boolean isLeaveAbandonmentInfoForDeletedOrders()
Returns:
Returns boolean indicating if we should leave an orphan abandonmentInfo item in the repository after we delete a lost order.

setLastUpdatedPropertyName

public void setLastUpdatedPropertyName(java.lang.String pLastUpdatedPropertyName)
The name of the property to be updated by the SetLastUpdated scenario action and droplet.

Parameters:
pLastUpdatedPropertyName - the name of the property to be updated by the SetLastUpdated scenario action and droplet.

getLastUpdatedPropertyName

public java.lang.String getLastUpdatedPropertyName()
Returns:
Returns the name of the property to be updated by the SetLastUpdated scenario action and droplet.

doStartService

public void doStartService()
                    throws ServiceException
doStartService() validates that the default reanimated state exists in the list of reanimated states and that the default lost state exists in the list of lost states

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

createAbandonmentInfo

protected MutableRepositoryItem createAbandonmentInfo(RepositoryItem pOrder)
                                               throws RepositoryException
This method generates a new abandonmentInfo object for the given order.

Parameters:
pOrder - the order repository item that needs an abandonmentInfo item created and associated with it
Throws:
RepositoryException

getAbandonmentInfo

protected RepositoryItem getAbandonmentInfo(RepositoryItem pOrder,
                                            boolean pCreate)
                                     throws RepositoryException
This method gets the abandonmentInfo item associated with the given order. If there is no abandonmentInfo item associated with the order, the pCreate parameter indicates whether or not to create one.

Parameters:
pOrder - the order repository item whose abandonmentInfo item we are trying to obtain.
pCreate - boolean indicating if an abandonmentInfo item should be created if none currently exists.
Throws:
RepositoryException

addAbandonedOrderToProfile

protected void addAbandonedOrderToProfile(java.lang.String pProfileId,
                                          java.lang.String pOrderId)
                                   throws RepositoryException
This method subtracts one from the abandonedOrderCount of the given profile.

Parameters:
pProfileId - the ID of the profile to be edited.
Throws:
RepositoryException

removeAbandonedOrderFromProfile

protected void removeAbandonedOrderFromProfile(java.lang.String pOrderId)
                                        throws RepositoryException
This method subtracts one from the abandonedOrderCount of the given profile.

Parameters:
pProfileId - the ID of the profile to be edited.
Throws:
RepositoryException

setLastUpdated

public void setLastUpdated(java.lang.String pOrderId)
                    throws RepositoryException,
                           CommerceException
This method sets the lastUpdated property of the abandonmentInfo repository item associated with the given order to the current system time.

Parameters:
pOrderId - the ID of the order whose abandonmentInfo is to be edited.
Throws:
RepositoryException
CommerceException

reanimateAbandonedOrder

public void reanimateAbandonedOrder(java.lang.String pOrderId)
                             throws RepositoryException,
                                    javax.jms.JMSException,
                                    CommerceException
This method checks first to see if the given order has an abandonmentInfo item associated it. If so, it checks to see if the order is considered abandoned or lost. If so, it sets the abandonment state of the given order to REANIMATED, sets the reanimationDate property to the current system time, and sends an OrderReanimated message if configured to do so.

Parameters:
pOrderId - the ID of the order to be marked as reanimated.
Throws:
RepositoryException
javax.jms.JMSException
CommerceException

convertAbandonedOrder

public void convertAbandonedOrder(java.lang.String pOrderId)
                           throws RepositoryException,
                                  javax.jms.JMSException,
                                  CommerceException
This method sets the abandonment state of the given order to CONVERTED, sets the conversionDate property to the current system time, and sends an OrderConverted message if configured to do so.

Parameters:
pOrderId - the ID of the order to be marked as converted.
Throws:
RepositoryException
javax.jms.JMSException
CommerceException