|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminBatchBaseMgr
com.konakartadmin.bl.AdminOrderBatchMgr
public class AdminOrderBatchMgr
The OrderBatchMgr
Nested Class Summary | |
---|---|
protected class |
AdminOrderBatchMgr.OrderProdList
A return object containing a list of OrderProducts and the last OrderId processed |
protected class |
AdminOrderBatchMgr.OrderProdStatus
Object stored in the hash maps |
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
AdminBaseMgr.StaticData |
Field Summary |
---|
Fields inherited from class com.konakartadmin.bl.AdminBatchBaseMgr |
---|
log |
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminOrderBatchMgr(KKAdminIf eng)
|
Method Summary | |
---|---|
java.lang.String |
createInvoicesBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
The method creates invoices for all orders that currently have a null invoice_filename. |
protected com.konakart.bl.KKCriteria |
getInvoiceOrderCriteria(int size)
Create a criteria object for reading the Orders for creating invoices |
protected AdminOrder[] |
getOrderArrayFromList(java.util.List<AdminOrder> ordersForCustomer)
Creates an array of Orders from a list. |
protected AdminOrderProduct[] |
getOrderProdArrayFromList(java.util.List<AdminOrderProduct> opForOrderList)
Creates an array of Order Products from a list. |
protected com.konakart.bl.KKCriteria |
getOrderProductCriteria(int size)
Create a criteria object for reading the OrderProducts |
protected AdminOrderBatchMgr.OrderProdList |
getOrderProducts(com.konakart.bl.KKCriteria c,
int orderId,
java.util.HashMap<java.lang.String,AdminOrderBatchMgr.OrderProdStatus> skuHM,
java.util.HashMap<java.lang.Integer,AdminOrderBatchMgr.OrderProdStatus> idHM)
The method returns null when all of the order products have been read. |
protected AdminOrder[] |
getOrders(com.konakart.bl.KKCriteria c,
int orderId)
The method returns an array of orders which will be empty when all of the orders have been read. |
protected com.konakart.bl.KKCriteria |
getUnpaidOrderCriteria(int size,
int numDays,
int[] validOrderStates)
Create a criteria object for reading unpaid orders |
protected java.util.List<AdminOrder> |
getUnpaidOrders(com.konakart.bl.KKCriteria c)
The method returns null when all of the orders have been read. |
java.lang.String |
productAvailabilityNotificationBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String emailTemplateName,
java.lang.String numEmailThreadsStr)
The method detects orders that haven't been fully delivered because one or more products were out of stock when the order was placed. |
java.lang.String |
recurringBillingBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
The method loops through all active subscriptions that have a next billing date set to the current date. |
protected void |
sendProductAvailabilityEmail(java.io.BufferedWriter bw,
AdminOrderMgrIf orderMgr,
AdminCustomerMgrIf custMgr,
AdminOrderProduct[] opArray,
com.konakart.bl.KKCriteria selectCrit,
com.konakart.bl.KKCriteria updateCrit,
java.lang.String templateName,
java.util.concurrent.ExecutorService executor)
protected method to send the mail and then reset the order products |
protected void |
sendUnpaidOrderEmail(java.io.BufferedWriter bw,
AdminOrderMgrIf orderMgr,
AdminCustomerMgrIf custMgr,
AdminOrder[] orderArray,
com.konakart.bl.KKCriteria selectCrit,
com.konakart.bl.KKCriteria updateCrit,
java.lang.String templateName,
java.util.concurrent.ExecutorService executor,
int newState)
protected method to send the eMail and then change the order states. |
protected void |
setOrderProductState(AdminOrderProduct[] orderProds,
int newState,
com.konakart.bl.KKCriteria selectCrit,
com.konakart.bl.KKCriteria updateCrit)
Set the state of the list of order products passed in. |
protected void |
setOrderState(AdminOrder[] orders,
int newState,
com.konakart.bl.KKCriteria selectCrit,
com.konakart.bl.KKCriteria updateCrit)
Set the state of the list of orders passed in. |
java.lang.String |
unpaidOrderNotificationBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String emailTemplateName,
java.lang.String numEmailThreadsStr,
java.lang.String numDaysStr,
java.lang.String validOrderStatesStr,
java.lang.String newStateStr)
An email is sent to all customers when a number of days has passed since they submitted their order and the order is not in one of the valid order states. |
Methods inherited from class com.konakartadmin.bl.AdminBatchBaseMgr |
---|
executeQuery, getBoolean, getInt, getIntArray, getLogName, validateTemplate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdminOrderBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng
-
java.lang.Exception
Method Detail |
---|
public java.lang.String unpaidOrderNotificationBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String emailTemplateName, java.lang.String numEmailThreadsStr, java.lang.String numDaysStr, java.lang.String validOrderStatesStr, java.lang.String newStateStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.emailTemplateName
- The name of the eMail template if the batch involves sending eMails to customers.
The name should not include the extension or the underscore+country code. i.e. It
should be myTemplate rather than myTemplate_en.vm. The country code and file
extension will be added automatically.numEmailThreadsStr
- If the batch involves sending eMails to customers, this determines how many eMail
sender threads are used. It defaults to 5.numDaysStr
- The number of days that needs to have passed before a mail is sentvalidOrderStatesStr
- An array of integers that determine valid order states. If the order is in a valid
state then a mail is not sent. They are in a format "1-4-7" where "-" is the
delimiter.newStateStr
- The state that the order should be set to once a mail has been sent.
java.lang.Exception
public java.lang.String productAvailabilityNotificationBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String emailTemplateName, java.lang.String numEmailThreadsStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.emailTemplateName
- The name of the eMail template if the batch involves sending eMails to customers.
The name should not include the extension or the underscore+country code. i.e. It
should be myTemplate rather than myTemplate_en.vm. The country code and file
extension will be added automatically.numEmailThreadsStr
- If the batch involves sending eMails to customers, this determines how many eMail
sender threads are used. It defaults to 5.
java.lang.Exception
public java.lang.String createInvoicesBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
Once the invoice has been created the order is updated with the name of the filename of the invoice.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.
java.lang.Exception
public java.lang.String recurringBillingBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.
java.lang.Exception
protected AdminOrderProduct[] getOrderProdArrayFromList(java.util.List<AdminOrderProduct> opForOrderList)
opForOrderList
-
protected AdminOrder[] getOrderArrayFromList(java.util.List<AdminOrder> ordersForCustomer)
ordersForCustomer
-
protected void sendUnpaidOrderEmail(java.io.BufferedWriter bw, AdminOrderMgrIf orderMgr, AdminCustomerMgrIf custMgr, AdminOrder[] orderArray, com.konakart.bl.KKCriteria selectCrit, com.konakart.bl.KKCriteria updateCrit, java.lang.String templateName, java.util.concurrent.ExecutorService executor, int newState) throws java.lang.Exception
bw
- orderMgr
- custMgr
- orderArray
- selectCrit
- updateCrit
- templateName
- executor
- newState
-
java.lang.Exception
protected void sendProductAvailabilityEmail(java.io.BufferedWriter bw, AdminOrderMgrIf orderMgr, AdminCustomerMgrIf custMgr, AdminOrderProduct[] opArray, com.konakart.bl.KKCriteria selectCrit, com.konakart.bl.KKCriteria updateCrit, java.lang.String templateName, java.util.concurrent.ExecutorService executor) throws java.lang.Exception
bw
- orderMgr
- custMgr
- opArray
- selectCrit
- updateCrit
- templateName
- executor
-
java.lang.Exception
protected java.util.List<AdminOrder> getUnpaidOrders(com.konakart.bl.KKCriteria c) throws java.lang.Exception
c
-
java.lang.Exception
protected AdminOrderBatchMgr.OrderProdList getOrderProducts(com.konakart.bl.KKCriteria c, int orderId, java.util.HashMap<java.lang.String,AdminOrderBatchMgr.OrderProdStatus> skuHM, java.util.HashMap<java.lang.Integer,AdminOrderBatchMgr.OrderProdStatus> idHM) throws java.lang.Exception
c
- orderId
- We only fetch order products for orders with an id >= to thisskuHM
- idHM
-
java.lang.Exception
protected AdminOrder[] getOrders(com.konakart.bl.KKCriteria c, int orderId) throws java.lang.Exception
c
-
java.lang.Exception
protected void setOrderProductState(AdminOrderProduct[] orderProds, int newState, com.konakart.bl.KKCriteria selectCrit, com.konakart.bl.KKCriteria updateCrit) throws org.apache.torque.TorqueException
orderProds
- newState
- selectCrit
- updateCrit
-
org.apache.torque.TorqueException
protected void setOrderState(AdminOrder[] orders, int newState, com.konakart.bl.KKCriteria selectCrit, com.konakart.bl.KKCriteria updateCrit) throws org.apache.torque.TorqueException
orders
- newState
- selectCrit
- updateCrit
-
org.apache.torque.TorqueException
protected com.konakart.bl.KKCriteria getUnpaidOrderCriteria(int size, int numDays, int[] validOrderStates)
size
- validOrderStates
-
protected com.konakart.bl.KKCriteria getOrderProductCriteria(int size)
size
-
protected com.konakart.bl.KKCriteria getInvoiceOrderCriteria(int size)
size
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |