|
|||||||||
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.service.scheduler.SchedulableService
atg.service.scheduler.SingletonSchedulableService
atg.commerce.order.abandoned.AbandonedOrderService
public class AbandonedOrderService
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
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.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 java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
Constructor Detail |
---|
public AbandonedOrderService()
Method Detail |
---|
public void setAbandonedOrderTools(AbandonedOrderTools pAbandonedOrderTools)
pAbandonedOrderTools
- the AbandonedOrderTools helper component.public AbandonedOrderTools getAbandonedOrderTools()
public void setIdleDaysUntilAbandoned(int pIdleDaysUntilAbandoned)
pIdleDaysUntilAbandoned
- the number of days which an order needs to
be idle before it is considered abandoned.public int getIdleDaysUntilAbandoned()
public void setIdleDaysUntilLost(int pIdleDaysUntilLost)
pIdleDaysUntilLost
- the number of days which an order needs to be
idle before it is considered lost.public int getIdleDaysUntilLost()
public int getMaxLostOrdersPerTransaction()
processLostOrders()
as
a number of orders to be updated per transaction.
public void setMaxLostOrdersPerTransaction(int pMaxLostOrdersPerTransaction)
maxLostOrdersPerTransaction
- the maximum number of orderspublic int getMaxAbandonedOrdersPerTransaction()
processAbandonedOrders()
as
a number of orders to be updated per transaction.
public void setMaxAbandonedOrdersPerTransaction(int pMaxAbandonedOrdersPerTransaction)
maxAbandonedOrdersPerTransaction
- the maximum number of orderspublic void setMinimumAmount(double pMinimumAmount)
pMinimumAmount
- the minimum amount of an order for it to be
be considered abandoned or lost.public double getMinimumAmount()
public void setDateQueryPropertyName(java.lang.String pDateQueryPropertyName)
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 queriespublic java.lang.String getDateQueryPropertyName()
public void setOrderStatePropertyName(java.lang.String pOrderStatePropertyName)
pOrderStatePropertyName
- the name of the order property that
indicates the state of the orderpublic java.lang.String getOrderStatePropertyName()
public void setPriceInfoPropertyName(java.lang.String pPriceInfoPropertyName)
pPriceInfoPropertyName
- the name of the property of the order
repository item that refers to its priceInfo item.public java.lang.String getPriceInfoPropertyName()
public void setSubtotalPropertyName(java.lang.String pSubtotalPropertyName)
pSubtotalPropertyName
- the name of the subtotal property
of the priceInfo to compare the minimum amount against.public java.lang.String getSubtotalPropertyName()
public void setDateQueryForAbandonedOrders(Query pDateQueryForAbandonedOrders)
pDateQuery
- the part of the abandoned order query that
relates to how long the order has been idlepublic Query getDateQueryForAbandonedOrders() throws RepositoryException
RepositoryException
public void setDateQueryForLostOrders(Query pDateQueryForLostOrders)
pDateQuery
- the part of the lost order query that
relates to how long the order has been idlepublic Query getDateQueryForLostOrders() throws RepositoryException
RepositoryException
public void setOrderStatesQuery(Query pOrderStatesQuery)
pDateQuery
- the part of the abandoned/lost order query that
deals with what order states are considered possible for
abandonment.public Query getOrderStatesQuery() throws RepositoryException
RepositoryException
public void setAbandonmentInfoQueryForAbandonedOrders(Query pAbandonmentInfoQueryForAbandonedOrders)
pDateQuery
- the part of the abandoned order query that
deals with what abandonment states an order can have for it
to be considered newly abandonedpublic Query getAbandonmentInfoQueryForAbandonedOrders() throws RepositoryException
RepositoryException
public void setAbandonmentInfoQueryForLostOrders(Query pAbandonmentInfoQueryForLostOrders)
pDateQuery
- the part of the lost order query that
deals with what abandonment states an order can have for it
to be considered newly lostpublic Query getAbandonmentInfoQueryForLostOrders() throws RepositoryException
RepositoryException
public void setMinimumAmountQuery(Query pMinimumAmountQuery)
pDateQuery
- the part of the abandoned/lost order query that
deals with the minimum total amount an order can have.public Query getMinimumAmountQuery() throws RepositoryException
RepositoryException
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setMaxItemsPerTransaction(int pMaxItemsPerTransaction)
public int getMaxItemsPerTransaction()
protected javax.servlet.Servlet createAdminServlet()
createAdminServlet
in class GenericService
protected Query generateDateQuery(int pIdleDays) throws RepositoryException
pIdleDays
- the number of days orders need to be idle to be returned by this
query.
RepositoryException
protected Query generateOrderStatesQuery() throws RepositoryException
RepositoryException
protected Query generateAbandonmentInfoQueryForAbandonedOrders() throws RepositoryException
RepositoryException
protected Query generateAbandonmentInfoQueryForLostOrders() throws RepositoryException
RepositoryException
protected Query generateMinimumAmountQuery() throws RepositoryException
RepositoryException
protected Query generateAbandonedQuery() throws RepositoryException
RepositoryException
protected Query generateLostQuery() throws RepositoryException
RepositoryException
protected MutableRepositoryItem createAbandonmentInfo(RepositoryItem pOrder) throws RepositoryException
pOrder
- the order repository item that needs an abandonmentInfo item created and
associated with it
RepositoryException
protected RepositoryItem updateAbandonedOrder(RepositoryItem pOrder) throws RepositoryException
pOrder
- the order that has been identified as abandoned
RepositoryException
protected RepositoryItem updateLostOrder(RepositoryItem pOrder) throws RepositoryException, CommerceException
pOrder
- the order that has been identified as lost
RepositoryException
CommerceException
public RepositoryItem[] getAbandonedOrders() throws RepositoryException
findAbandonedOrders()
instead.
The number of loaded orders is limited to getMaxAbandonedOrdersPerTransaction()
RepositoryException
public RepositoryItem[] findAbandonedOrders() throws RepositoryException
getMaxAbandonedOrdersPerTransaction()
RepositoryException
public RepositoryItem[] getLostOrders() throws RepositoryException
findLostOrders()
instead.
getMaxLostOrdersPerTransaction()
RepositoryException
public RepositoryItem[] findLostOrders() throws RepositoryException
getMaxLostOrdersPerTransaction()
RepositoryException
public void processAbandonedOrders() throws CommerceException
CommerceException
getMaxAbandonedOrdersPerTransaction()
public void processLostOrders() throws CommerceException
CommerceException
getMaxLostOrdersPerTransaction()
public void doScheduledTask(Scheduler pScheduler, ScheduledJob pScheduledJob)
doScheduledTask
in class SingletonSchedulableService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |