atg.commerce.order.abandoned
Class AbandonedOrderService

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

public class AbandonedOrderService
extends SingletonSchedulableService

This service identifies orders that are considered abandoned and lost. The amount of time an order needs to be idle to be considered abandoned and lost is configurable. Also, a minimum amount an order has to be for to be considered abandoned or lost can also be configured. This service is an instance of the SingletonSchedulableService In scheduled mode locks must be acquired before the service is executed, to ensure that only one instance of this service is running at a given time. In non-scheduled mode locks are optional Lock names and timeouts are configurable

See Also:
SingletonSchedulableService.getLockName(), Author: Paul O'Brien

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.util.ResourceBundle sResourceBundle
          Resource Bundle
 
Fields inherited from class atg.service.scheduler.SchedulableService
mJobId
 
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
AbandonedOrderService()
           
 
Method Summary
protected  MutableRepositoryItem createAbandonmentInfo(RepositoryItem pOrder)
          This method generates a new abandonmentInfo object for the given order.
protected  javax.servlet.Servlet createAdminServlet()
          Creates and returns a new Servlet that will administer this service.
 void doScheduledTask(Scheduler pScheduler, ScheduledJob pScheduledJob)
          Callback method for the SingletonSchedulableService.
 RepositoryItem[] findAbandonedOrders()
          This method generates and executes the query for abandoned orders, and returns an array of order repository items representing the orders identified as abandoned.
 RepositoryItem[] findLostOrders()
          This method generates and executes the query for lost orders, and returns an array of order repository items representing the orders identified as lost.
protected  Query generateAbandonedQuery()
          This method generates the query to identify abandoned orders.
protected  Query generateAbandonmentInfoQueryForAbandonedOrders()
          This method generates the part of the abandoned order query that deals with whether or not the order has abandonmentInfo already, and if it does what abandonment states are considered valid to identify an order as abandoned or lost.
protected  Query generateAbandonmentInfoQueryForLostOrders()
          This method generates the part of the lost order query that deals with whether or not the order has abandonmentInfo already, and if it does what abandonment states are considered valid to identify an order as abandoned or lost.
protected  Query generateDateQuery(int pIdleDays)
          This method generates the part of the abandoned/lost order query that deals with how long the order has been idle.
protected  Query generateLostQuery()
          This method generates the query to identify lost orders.
protected  Query generateMinimumAmountQuery()
          This method generates the part of the abandoned/lost order query that deals with the minimum amount an order must be for to identify the order as abandoned or lost.
protected  Query generateOrderStatesQuery()
          This method generates the part of the abandoned/lost order query that deals with what order states are considered possible for abandonment.
 RepositoryItem[] getAbandonedOrders()
          Deprecated. Call findAbandonedOrders() instead. The number of loaded orders is limited to getMaxAbandonedOrdersPerTransaction()
 AbandonedOrderTools getAbandonedOrderTools()
           
 Query getAbandonmentInfoQueryForAbandonedOrders()
          If the property is null, generate the query by calling generateAbandonmentInfoQueryForAbandonedOrders, otherwise return the query stored in the property.
 Query getAbandonmentInfoQueryForLostOrders()
          If the property is null, generate the query by calling generateAbandonmentInfoQueryForLostOrders, otherwise return the query stored in the property.
 Query getDateQueryForAbandonedOrders()
          Generate the query by calling generateDateQuery.
 Query getDateQueryForLostOrders()
          Generate the query by calling generateDateQuery.
 java.lang.String getDateQueryPropertyName()
           
 int getIdleDaysUntilAbandoned()
           
 int getIdleDaysUntilLost()
           
 RepositoryItem[] getLostOrders()
          Deprecated. call findLostOrders() instead.
 int getMaxAbandonedOrdersPerTransaction()
          The maximum number of abandoned orders which will be loaded at once.
 int getMaxItemsPerTransaction()
          Returns property maxItemsPerTransaction
 int getMaxLostOrdersPerTransaction()
          The maximum number of lost orders which will be loaded at once.
 double getMinimumAmount()
           
 Query getMinimumAmountQuery()
          If the property is null, generate the query by calling generateMinimumAmountQuery, otherwise return the query stored in the property.
 java.lang.String getOrderStatePropertyName()
           
 Query getOrderStatesQuery()
          If the property is null, generate the query by calling generateOrderStatesQuery, otherwise return the query stored in the property.
 java.lang.String getPriceInfoPropertyName()
           
 java.lang.String getSubtotalPropertyName()
           
 javax.transaction.TransactionManager getTransactionManager()
          Returns property transactionManager
 void processAbandonedOrders()
          This method gets the orders identified as abandoned, iterates through the results, calling the methods to update each order, and send an AbandonedOrderMessage.
 void processLostOrders()
          This method gets the orders identified as lost, then iterates through the results, calling the methods to update each order, and send an AbandonedOrderMessage.
 void setAbandonedOrderTools(AbandonedOrderTools pAbandonedOrderTools)
          AbandonedOrderTools contains property/item names and helper methods that manipulate abandonment data.
 void setAbandonmentInfoQueryForAbandonedOrders(Query pAbandonmentInfoQueryForAbandonedOrders)
          The part of the abandoned order query that deals with what abandonment states an order can have for it to be considered newly abandoned.
 void setAbandonmentInfoQueryForLostOrders(Query pAbandonmentInfoQueryForLostOrders)
          The part of the lost order query that deals with what abandonment states an order can have for it to be considered newly lost.
 void setDateQueryForAbandonedOrders(Query pDateQueryForAbandonedOrders)
          The part of the abandoned order query that relates to how long the order has been idle.
 void setDateQueryForLostOrders(Query pDateQueryForLostOrders)
          The part of the lost order query that relates to how long the order has been idle.
 void setDateQueryPropertyName(java.lang.String pDateQueryPropertyName)
          The name of the property in the order item descriptor that is to be used as the basis for the "idle time" part of the abandoned/lost queries Note: changing this property during runtime after this service has already run will not change the query - the queries are generated on the first run of this service.
 void setIdleDaysUntilAbandoned(int pIdleDaysUntilAbandoned)
          The number of days which an order needs to be idle before it is considered abandoned.
 void setIdleDaysUntilLost(int pIdleDaysUntilLost)
          The number of days which an order needs to be idle before it is considered lost.
 void setMaxAbandonedOrdersPerTransaction(int pMaxAbandonedOrdersPerTransaction)
           
 void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
          Sets property maxItemsPerTransaction
 void setMaxLostOrdersPerTransaction(int pMaxLostOrdersPerTransaction)
           
 void setMinimumAmount(double pMinimumAmount)
          The minimum amount of an order for it to be considered abandoned or lost.
 void setMinimumAmountQuery(Query pMinimumAmountQuery)
          The part of the abandoned/lost order query that deals with the minimum total amount an order can have.
 void setOrderStatePropertyName(java.lang.String pOrderStatePropertyName)
          The name of the order property that indicates the state of the order.
 void setOrderStatesQuery(Query pOrderStatesQuery)
          The part of the abandoned/lost order query that deals with what order states are considered possible for abandonment.
 void setPriceInfoPropertyName(java.lang.String pPriceInfoPropertyName)
          The name of the property of the order repository item that refers to its priceInfo item.
 void setSubtotalPropertyName(java.lang.String pSubtotalPropertyName)
          The name of the subtotal property of the priceInfo to compare the minimum amount against.
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets property transactionManager
protected  RepositoryItem updateAbandonedOrder(RepositoryItem pOrder)
          This method updates an order identified as abandoned.
protected  RepositoryItem updateLostOrder(RepositoryItem pOrder)
          This method updates an order identified as lost.
 
Methods inherited from class atg.service.scheduler.SingletonSchedulableService
acquireLock, getClientLockManager, getLockName, getLockTimeOut, performScheduledTask, releaseLock, setClientLockManager, setLockName, setLockTimeOut
 
Methods inherited from class atg.service.scheduler.SchedulableService
doStartService, doStopService, getJobDescription, getJobId, getJobName, getSchedule, getScheduler, getThreadMethod, isTransactional, setJobDescription, setJobName, setSchedule, setScheduler, setThreadMethod, setTransactional, startScheduledJob, stopScheduledJob
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, 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, reResolveThis, 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

Constructor Detail

AbandonedOrderService

public AbandonedOrderService()
Method Detail

setAbandonedOrderTools

public void setAbandonedOrderTools(AbandonedOrderTools pAbandonedOrderTools)
AbandonedOrderTools contains property/item names and helper methods that manipulate abandonment data.

Parameters:
pAbandonedOrderTools - the AbandonedOrderTools helper component.

getAbandonedOrderTools

public AbandonedOrderTools getAbandonedOrderTools()
Returns:
returns the AbandonedOrderTools helper component.

setIdleDaysUntilAbandoned

public void setIdleDaysUntilAbandoned(int pIdleDaysUntilAbandoned)
The number of days which an order needs to be idle before it is considered abandoned. Note: changing this property during runtime after this service has already run will not change the query - the queries are generated on the first run of this service. If you would like to change this property and have it change the query, set the dateQueryForAbandonedOrders property to null as well as changing this property.

Parameters:
pIdleDaysUntilAbandoned - the number of days which an order needs to be idle before it is considered abandoned.

getIdleDaysUntilAbandoned

public int getIdleDaysUntilAbandoned()
Returns:
Returns the number of days which an order needs to be idle before \ it is considered abandoned.

setIdleDaysUntilLost

public void setIdleDaysUntilLost(int pIdleDaysUntilLost)
The number of days which an order needs to be idle before it is considered lost. Note: changing this property during runtime after this service has already run will not change the query - the queries are generated on the first run of this service. If you would like to change this property and have it change the query, set the dateQueryForLostOrders property to null as well as changing this property.

Parameters:
pIdleDaysUntilLost - the number of days which an order needs to be idle before it is considered lost.

getIdleDaysUntilLost

public int getIdleDaysUntilLost()
Returns:
Returns the number of days which an order needs to be idle before it is considered lost.

getMaxLostOrdersPerTransaction

public int getMaxLostOrdersPerTransaction()
The maximum number of lost orders which will be loaded at once. This value is used in processLostOrders() as a number of orders to be updated per transaction.

Returns:
the maxLostOrdersPerTransaction

setMaxLostOrdersPerTransaction

public void setMaxLostOrdersPerTransaction(int pMaxLostOrdersPerTransaction)
Parameters:
maxLostOrdersPerTransaction - the maximum number of orders

getMaxAbandonedOrdersPerTransaction

public int getMaxAbandonedOrdersPerTransaction()
The maximum number of abandoned orders which will be loaded at once. This value is used in processAbandonedOrders() as a number of orders to be updated per transaction.

Returns:
the maxAbandonedOrdersPerTransaction

setMaxAbandonedOrdersPerTransaction

public void setMaxAbandonedOrdersPerTransaction(int pMaxAbandonedOrdersPerTransaction)
Parameters:
maxAbandonedOrdersPerTransaction - the maximum number of orders

setMinimumAmount

public void setMinimumAmount(double pMinimumAmount)
The minimum amount of an order for it to be considered abandoned or lost. Note: changing this property during runtime after this service has already run will not change the query - the queries are generated on the first run of this service. If you would like to change this property and have it change the query, set the minimumAmountQuery property to null as well as changing this property.

Parameters:
pMinimumAmount - the minimum amount of an order for it to be be considered abandoned or lost.

getMinimumAmount

public double getMinimumAmount()
Returns:
Returns the minimum amount of an order for it to be considered abandoned or lost.

setDateQueryPropertyName

public void setDateQueryPropertyName(java.lang.String pDateQueryPropertyName)
The name of the property in the order item descriptor that is to be used as the basis for the "idle time" part of the abandoned/lost queries Note: changing this property during runtime after this service has already run will not change the query - the queries are generated on the first run of this service. If you would like to change this property and have it change the query, set the dateQueryForAbandonedOrder and dateQueryForLostOrders properties to null as well as changing this property

Parameters:
pDateQueryPropertyName - the name of the property in the order item descriptor that is to be used as the basis for the "idle time" part of the abandoned/lost queries

getDateQueryPropertyName

public java.lang.String getDateQueryPropertyName()
Returns:
Returns the name of property in the order item descriptor that is to be used as thebasis for the "idle time" part of the abandoned/lost queries

setOrderStatePropertyName

public void setOrderStatePropertyName(java.lang.String pOrderStatePropertyName)
The name of the order property that indicates the state of the order.

Parameters:
pOrderStatePropertyName - the name of the order property that indicates the state of the order

getOrderStatePropertyName

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

setPriceInfoPropertyName

public void setPriceInfoPropertyName(java.lang.String pPriceInfoPropertyName)
The name of the property of the order repository item that refers to its priceInfo item.

Parameters:
pPriceInfoPropertyName - the name of the property of the order repository item that refers to its priceInfo item.

getPriceInfoPropertyName

public java.lang.String getPriceInfoPropertyName()
Returns:
Returns the name of the property of the order repository item that refers to its priceInfo item.

setSubtotalPropertyName

public void setSubtotalPropertyName(java.lang.String pSubtotalPropertyName)
The name of the subtotal property of the priceInfo to compare the minimum amount against.

Parameters:
pSubtotalPropertyName - the name of the subtotal property of the priceInfo to compare the minimum amount against.

getSubtotalPropertyName

public java.lang.String getSubtotalPropertyName()
Returns:
returns the name of the subtotal property of the priceInfo to compare the minimum amount against.

setDateQueryForAbandonedOrders

public void setDateQueryForAbandonedOrders(Query pDateQueryForAbandonedOrders)
The part of the abandoned order query that relates to how long the order has been idle. This query will be of the form: "abandonmentInfo.orderLastUpdated < "Mon Nov 17 13:35:03 EDT 2003"

Parameters:
pDateQuery - the part of the abandoned order query that relates to how long the order has been idle

getDateQueryForAbandonedOrders

public Query getDateQueryForAbandonedOrders()
                                     throws RepositoryException
Generate the query by calling generateDateQuery.

Returns:
returns the part of the abandoned order query that relates to how long the order has been idle.
Throws:
RepositoryException

setDateQueryForLostOrders

public void setDateQueryForLostOrders(Query pDateQueryForLostOrders)
The part of the lost order query that relates to how long the order has been idle. This query will be of the form: "abandonmentInfo.orderLastUpdated < "Mon Nov 17 13:35:03 EDT 2003"

Parameters:
pDateQuery - the part of the lost order query that relates to how long the order has been idle

getDateQueryForLostOrders

public Query getDateQueryForLostOrders()
                                throws RepositoryException
Generate the query by calling generateDateQuery.

Returns:
returns the part of the lost order query that relates to how long the order has been idle.
Throws:
RepositoryException

setOrderStatesQuery

public void setOrderStatesQuery(Query pOrderStatesQuery)
The part of the abandoned/lost order query that deals with what order states are considered possible for abandonment. This query will be of the form 'state = "INCOMPLETE"'.

Parameters:
pDateQuery - the part of the abandoned/lost order query that deals with what order states are considered possible for abandonment.

getOrderStatesQuery

public Query getOrderStatesQuery()
                          throws RepositoryException
If the property is null, generate the query by calling generateOrderStatesQuery, otherwise return the query stored in the property.

Returns:
returns the part of the abandoned/lost order query that deals with what order states are considered possible for abandonment.
Throws:
RepositoryException

setAbandonmentInfoQueryForAbandonedOrders

public void setAbandonmentInfoQueryForAbandonedOrders(Query pAbandonmentInfoQueryForAbandonedOrders)
The part of the abandoned order query that deals with what abandonment states an order can have for it to be considered newly abandoned. This query will be of the form 'abandonmentInfo is "null" OR abandonmentInfo.state = "REANIMATED" OR abandonmentInfo.state = "null"'

Parameters:
pDateQuery - the part of the abandoned order query that deals with what abandonment states an order can have for it to be considered newly abandoned

getAbandonmentInfoQueryForAbandonedOrders

public Query getAbandonmentInfoQueryForAbandonedOrders()
                                                throws RepositoryException
If the property is null, generate the query by calling generateAbandonmentInfoQueryForAbandonedOrders, otherwise return the query stored in the property.

Returns:
returns the part of the abandoned order query that deals with what abandonment states an order can have for it to be considered newly abandoned.
Throws:
RepositoryException

setAbandonmentInfoQueryForLostOrders

public void setAbandonmentInfoQueryForLostOrders(Query pAbandonmentInfoQueryForLostOrders)
The part of the lost order query that deals with what abandonment states an order can have for it to be considered newly lost. This query will be of the form 'abandonmentInfo = "null" OR abandonmentInfo.state != "LOST" OR abandonmentInfo.state = "null"'

Parameters:
pDateQuery - the part of the lost order query that deals with what abandonment states an order can have for it to be considered newly lost

getAbandonmentInfoQueryForLostOrders

public Query getAbandonmentInfoQueryForLostOrders()
                                           throws RepositoryException
If the property is null, generate the query by calling generateAbandonmentInfoQueryForLostOrders, otherwise return the query stored in the property.

Returns:
returns the part of the lost order query that deals with what abandonment states an order can have for it to be considered newly lost.
Throws:
RepositoryException

setMinimumAmountQuery

public void setMinimumAmountQuery(Query pMinimumAmountQuery)
The part of the abandoned/lost order query that deals with the minimum total amount an order can have. This query will be of the form "priceInfo.rawSubtotal >= 100.00"

Parameters:
pDateQuery - the part of the abandoned/lost order query that deals with the minimum total amount an order can have.

getMinimumAmountQuery

public Query getMinimumAmountQuery()
                            throws RepositoryException
If the property is null, generate the query by calling generateMinimumAmountQuery, otherwise return the query stored in the property.

Returns:
returns the part of the abandoned/lost order query that deals with the minimum total amount an order can have.
Throws:
RepositoryException

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets property transactionManager


getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns property transactionManager


setMaxItemsPerTransaction

public void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
Sets property maxItemsPerTransaction


getMaxItemsPerTransaction

public int getMaxItemsPerTransaction()
Returns property maxItemsPerTransaction


createAdminServlet

protected javax.servlet.Servlet createAdminServlet()
Creates and returns a new Servlet that will administer this service. The AbandonedOrderService implements its own admin servlet to hide getAbandonedOrders() and getLostOrders() from showing up as properties.

Overrides:
createAdminServlet in class GenericService
Returns:
admin servlet

generateDateQuery

protected Query generateDateQuery(int pIdleDays)
                           throws RepositoryException
This method generates the part of the abandoned/lost order query that deals with how long the order has been idle.

Parameters:
pIdleDays - the number of days orders need to be idle to be returned by this query.
Returns:
Returns query that will return orders idle for the given number of days.
Throws:
RepositoryException

generateOrderStatesQuery

protected Query generateOrderStatesQuery()
                                  throws RepositoryException
This method generates the part of the abandoned/lost order query that deals with what order states are considered possible for abandonment.

Returns:
Returns query that will return orders with the proper states.
Throws:
RepositoryException

generateAbandonmentInfoQueryForAbandonedOrders

protected Query generateAbandonmentInfoQueryForAbandonedOrders()
                                                        throws RepositoryException
This method generates the part of the abandoned order query that deals with whether or not the order has abandonmentInfo already, and if it does what abandonment states are considered valid to identify an order as abandoned or lost. We want only orders that either have no abandonmentInfo, or those whose abandonment state is RECLAIMED.

Returns:
Returns query that will return orders with the proper abandonment information.
Throws:
RepositoryException

generateAbandonmentInfoQueryForLostOrders

protected Query generateAbandonmentInfoQueryForLostOrders()
                                                   throws RepositoryException
This method generates the part of the lost order query that deals with whether or not the order has abandonmentInfo already, and if it does what abandonment states are considered valid to identify an order as abandoned or lost. For lost queries, we want only orders that either have no abandonmentInfo, or those whose abandonment state is NOT already LOST.

Returns:
Returns query that will return orders with the proper abandonment information.
Throws:
RepositoryException

generateMinimumAmountQuery

protected Query generateMinimumAmountQuery()
                                    throws RepositoryException
This method generates the part of the abandoned/lost order query that deals with the minimum amount an order must be for to identify the order as abandoned or lost. This will generate a query of the form "WHERE priceInfo.rawSubtotal >= {minimumAmount}"

Returns:
Returns query that will return orders worth more than the configured minimum amount
Throws:
RepositoryException

generateAbandonedQuery

protected Query generateAbandonedQuery()
                                throws RepositoryException
This method generates the query to identify abandoned orders. It creates a 4-piece query (date, order state, abandonment state, and minimum amount), then combines them into an "and" query and returns that query.

Returns:
Returns query that will return the abandoned orders.
Throws:
RepositoryException

generateLostQuery

protected Query generateLostQuery()
                           throws RepositoryException
This method generates the query to identify lost orders. It creates a 4-piece query (date, order state, abandonment state, and minimum amount), then combines them into an "and" query and returns that query.

Returns:
Returns query that will return the lost orders
Throws:
RepositoryException

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

updateAbandonedOrder

protected RepositoryItem updateAbandonedOrder(RepositoryItem pOrder)
                                       throws RepositoryException
This method updates an order identified as abandoned. If no abandonmentInfo exists for the order, it is created. Otherwise, the abandonmentInfo item is updated. Also, the abandonedOrderCount of the profile that owns the order is incremented.

Parameters:
pOrder - the order that has been identified as abandoned
Returns:
Returns the new or updated abandonmentInfo repository item.
Throws:
RepositoryException

updateLostOrder

protected RepositoryItem updateLostOrder(RepositoryItem pOrder)
                                  throws RepositoryException,
                                         CommerceException
This method updates an order identified as lost. If no abandonmentInfo exists for the order, it is created. Otherwise, the abandonmentInfo item is updated. Also, the abandonedOrderCount of the profile that owns the order is decremented if the order was previously identified as abandoned.

Parameters:
pOrder - the order that has been identified as lost
Returns:
Returns the new or updated abandonmentInfo repository item.
Throws:
RepositoryException
CommerceException

getAbandonedOrders

public RepositoryItem[] getAbandonedOrders()
                                    throws RepositoryException
Deprecated. Call findAbandonedOrders() instead. The number of loaded orders is limited to getMaxAbandonedOrdersPerTransaction()

This method generates and executes the query for abandoned orders, and returns an array of order repository items representing the orders identified as abandoned. This method can be overridden if you would like to change the way abandoned orders are identified.

Returns:
Returns an array of order repository items representing the orders identified as abandoned.
Throws:
RepositoryException

findAbandonedOrders

public RepositoryItem[] findAbandonedOrders()
                                     throws RepositoryException
This method generates and executes the query for abandoned orders, and returns an array of order repository items representing the orders identified as abandoned. This method can be overridden if you would like to change the way abandoned orders are identified. The number of loaded orders is limited to getMaxAbandonedOrdersPerTransaction()

Returns:
Returns an array of order repository items representing the orders identified as abandoned.
Throws:
RepositoryException

getLostOrders

public RepositoryItem[] getLostOrders()
                               throws RepositoryException
Deprecated. call findLostOrders() instead.

This method generates and executes the query for lost orders, and returns an array of order repository items representing the orders identified as lost. This method can be overridden if you would like to change the way lost orders are identified. The number of loaded orders is limited to getMaxLostOrdersPerTransaction()

Returns:
Returns an array of order repository items representing the orders identified as lost.
Throws:
RepositoryException

findLostOrders

public RepositoryItem[] findLostOrders()
                                throws RepositoryException
This method generates and executes the query for lost orders, and returns an array of order repository items representing the orders identified as lost. This method can be overridden if you would like to change the way lost orders are identified. The number of loaded orders is limited to getMaxLostOrdersPerTransaction()

Returns:
Returns an array of order repository items representing the orders identified as lost.
Throws:
RepositoryException

processAbandonedOrders

public void processAbandonedOrders()
                            throws CommerceException
This method gets the orders identified as abandoned, iterates through the results, calling the methods to update each order, and send an AbandonedOrderMessage.

Throws:
CommerceException
See Also:
getMaxAbandonedOrdersPerTransaction()

processLostOrders

public void processLostOrders()
                       throws CommerceException
This method gets the orders identified as lost, then iterates through the results, calling the methods to update each order, and send an AbandonedOrderMessage.

Throws:
CommerceException
See Also:
getMaxLostOrdersPerTransaction()

doScheduledTask

public void doScheduledTask(Scheduler pScheduler,
                            ScheduledJob pScheduledJob)
Callback method for the SingletonSchedulableService.

Specified by:
doScheduledTask in class SingletonSchedulableService