public class AdminCustomerBatchMgr extends AdminBatchBaseMgr
| Modifier and Type | Class and Description |
|---|---|
protected class |
AdminCustomerBatchMgr.CustRetList
A return object containing a list of Customers and the last customer Id processed
|
AdminBatchBaseMgr.CustTagCounterAdminBaseMgr.StaticDatalogadminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir| Constructor and Description |
|---|
AdminCustomerBatchMgr(KKAdminIf eng) |
| Modifier and Type | Method and Description |
|---|---|
void |
countCustomersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String sessId)
This batch is a simple example that can be used to demonstrate how the ExecuteMultiStoreBatch
class can be used to execute batch jobs for each store.
|
protected int |
deleteCustomer(AdminCustomer cust,
com.konakart.db.KKCriteria sessionCrit,
com.konakart.db.KKCriteria sessionDelCrit,
AdminCustomerMgrIf custMgr) |
void |
deleteTemporaryDataBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numDaysStr,
java.lang.String cookieBlockSizeStr)
This batch is used to delete temporary data in order to keep your KonaKart store running
efficiently.
|
void |
expiredRewardPointBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numDaysStr)
This batch is used to expire reward points after a certain time limit, which is entered as a
number of days in the
numDays parameter. |
protected com.konakart.db.KKCriteria |
getCustomerCriteria(int size,
int[] permanentCustTypes)
Get the criteria object to search for customers
|
protected AdminCustomerBatchMgr.CustRetList |
getCustomers(com.konakart.db.KKCriteria c,
int custId)
The method returns a null list within the return object when all of the customers have been
read.
|
protected java.util.HashMap<java.lang.String,AdminCustomerTag> |
getCustomerTagsHash(int customerId,
java.util.Set<java.lang.String> tagsToUpdate,
AdminCustomerTagMgrIf tagMgr)
Get the customer tags for the specified customerId.
|
protected java.lang.String |
getGenderValueFromCustomer(AdminCustomer cust,
java.io.BufferedWriter bw) |
protected com.konakart.db.KKCriteria |
getLiteCustomerCriteria(int size)
Get the criteria object to retrieve customers
|
protected java.lang.String |
getNewsletterValue(AdminCustomer cust) |
protected com.konakart.db.KKCriteria |
getSessionCriteria()
Get the criteria object to search for a customer's session
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
getTagsFromAllOrders(AdminCustomer cust) |
protected java.util.HashMap<java.lang.String,java.lang.String> |
getTagsFromLastOrder(AdminCustomer cust) |
int |
getTimeInSecs()
Utility method to return the current time in seconds
|
protected java.util.List<AdminOrder> |
getUnpaidOrders(com.konakart.db.KKCriteria c)
The method returns null when all of the orders have been read.
|
protected boolean |
hasSessionExpired(int expiryInSecs) |
protected void |
insertOrUpdateCustomerTag(java.lang.String tagName,
java.lang.String tagValue,
AdminCustomer cust,
AdminBatchBaseMgr.CustTagCounter count,
AdminCustomerTagMgrIf tagMgr,
java.io.BufferedWriter bw) |
java.lang.String |
removeExpiredCustomersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String permanentCustTypesStr)
Each existing customer is read from the database in a loop, and for each customer object we
detect whether it has one or more expired session records and no non expired record.
|
java.lang.String |
resetAggregateOrderTotalCustomerTag(java.lang.String logName,
java.lang.String appendLogStr)
This batch job should be run at regular intervals (e.g.
|
java.lang.String |
updateCustomerTagsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
This is an example of how you might update Customer Tags in a batch job.
|
java.lang.String |
updateSummaryCustomerTagsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
This is an example of how you might update Summary Customer Tags in a batch job.
|
ensureCustomerTagIsPresent, getAdEngConf, getAdminJsonEngine, getBatchLogName, getBoolean, getCustomerTagsHash, getInt, getIntArray, getIntArray, getLiteCustomers, getLogName, getOrders, getSkuForProduct, insertOrUpdateCustomerTag, trimMultiTag, validateTemplateaddInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkAPICallEnabled, checkIntInRange, checkIntIsSet, checkRequired, executeQuery, executeQuery, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminContentMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustPwdHistMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminEngineCacheMgr, getAdminEventMgr, getAdminExecuteMgr, getAdminFileMgr, getAdminFilterMgr, getAdminHtmlMgr, getAdminImportMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminMiscPriceMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminServletMgr, getAdminShipmentMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminSuggestionMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getDebugStackTraceExclusions, getEmailThreadGracefulShutdownTimeout, getExportMgr, getExportMgr, getExportXMLData, getIntFromString, getKkAdminPropsFilePath, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getNewCriteria, getNewCriteria, getOtherModuleByName, getPostSearchText, getPreSearchText, getProductsToCategoresCriteria, getPropertyValue, getPropertyValue, getPropertyValueAsBool, getPropertyValueAsInt, getPropertyValueAsLong, getRecordCount, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isCommunity, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, isUnix, isWindows, manageException, manageThrowable, refreshConfigs, removeCData, sendMQMessages, setAdminEng, setDebugStackTraceExclusions, setKkAdminPropsFilePath, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr, updateStaticVariablesNowpublic AdminCustomerBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng - the engjava.lang.Exception - an unexpected exceptionpublic java.lang.String removeExpiredCustomersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String permanentCustTypesStr)
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.permanentCustTypesStr - An array of customer types that won't be deleted. They are in a format "3-6-8"
where "-" is a delimiter between the integers.java.lang.Exception - an unexpected exceptionprotected int deleteCustomer(AdminCustomer cust, com.konakart.db.KKCriteria sessionCrit, com.konakart.db.KKCriteria sessionDelCrit, AdminCustomerMgrIf custMgr) throws java.lang.Exception
java.lang.Exceptionprotected boolean hasSessionExpired(int expiryInSecs)
protected AdminCustomerBatchMgr.CustRetList getCustomers(com.konakart.db.KKCriteria c, int custId) throws java.lang.Exception
c - the ccustId - the customerId (only customers with customerId greater than this will be returned)java.lang.Exception - an unexpected exceptionprotected com.konakart.db.KKCriteria getSessionCriteria()
protected com.konakart.db.KKCriteria getCustomerCriteria(int size,
int[] permanentCustTypes)
size - the sizepermanentCustTypes - the permanentCustTypespublic void expiredRewardPointBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numDaysStr)
throws java.lang.Exception
numDays parameter. The expired attribute of each expired
reward points record is set to non zero by the batch.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.numDaysStr - If current time - numDays is greater than the date when the reward point
transaction was added, then the points added in that transaction are expired.java.lang.Exception - an unexpected exceptionpublic void deleteTemporaryDataBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numDaysStr,
java.lang.String cookieBlockSizeStr)
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.numDaysStr - kk_cookie records are deleted if current time - numDays is greater than the date
when the cookie was last read or actually created (for the case when it has never
been read).cookieBlockSizeStr - The number of kk_cookie records read and deleted at a time using an IN clause. A
good starting value for this parameter is 250. It can be increased in order to
speed up the batch job if there are many kk_cookie records to delete.java.lang.Exception - an unexpected exceptionpublic int getTimeInSecs()
protected java.util.List<AdminOrder> getUnpaidOrders(com.konakart.db.KKCriteria c) throws java.lang.Exception
c - the cjava.lang.Exception - an unexpected exceptionpublic void countCustomersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String sessId)
throws java.lang.Exception
It simply counts the number of customers in the store and writes out this number.
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.sessId - The sessionId. The sessionId is a special parameter defined in the
konakart_jobs.xml file. If a parameter is defined with value "SESSION_ID",
KonaKart will replace this value with the sessionId of the logged in session.java.lang.Exception - an unexpected exceptionpublic java.lang.String updateCustomerTagsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
throws java.lang.Exception
Each existing customer is read from the database in a loop, and for each customer object we update the IS_MALE customer tags if is has changed or we insert it if it isn't present.
This is a somewhat trivial example but is expected to be extended to suit specific requirements for a store.
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 - an unexpected exceptionprotected java.lang.String getGenderValueFromCustomer(AdminCustomer cust, java.io.BufferedWriter bw) throws java.io.IOException
java.io.IOExceptionprotected void insertOrUpdateCustomerTag(java.lang.String tagName,
java.lang.String tagValue,
AdminCustomer cust,
AdminBatchBaseMgr.CustTagCounter count,
AdminCustomerTagMgrIf tagMgr,
java.io.BufferedWriter bw)
throws KKAdminException,
org.apache.torque.TorqueException,
java.text.ParseException,
com.workingdogs.village.DataSetException,
java.io.IOException
KKAdminExceptionorg.apache.torque.TorqueExceptionjava.text.ParseExceptioncom.workingdogs.village.DataSetExceptionjava.io.IOExceptionprotected com.konakart.db.KKCriteria getLiteCustomerCriteria(int size)
getLiteCustomerCriteria in class AdminBatchBaseMgrsize - the number of records to retrieve at a timepublic java.lang.String resetAggregateOrderTotalCustomerTag(java.lang.String logName,
java.lang.String appendLogStr)
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.java.lang.Exception - an unexpected exceptionpublic java.lang.String updateSummaryCustomerTagsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
throws java.lang.Exception
Each existing customer is read from the database in a loop, and for each customer object we update a number of summary customer tags.
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 - an unexpected exceptionprotected java.lang.String getNewsletterValue(AdminCustomer cust)
protected java.util.HashMap<java.lang.String,java.lang.String> getTagsFromLastOrder(AdminCustomer cust) throws java.lang.Exception
java.lang.Exceptionprotected java.util.HashMap<java.lang.String,java.lang.String> getTagsFromAllOrders(AdminCustomer cust) throws java.lang.Exception
java.lang.Exceptionprotected java.util.HashMap<java.lang.String,AdminCustomerTag> getCustomerTagsHash(int customerId, java.util.Set<java.lang.String> tagsToUpdate, AdminCustomerTagMgrIf tagMgr) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
customerId - the customerIdtagsToUpdate - a set of tag names that we wish to updatetagMgr - the AdminCustomerTagMgrorg.apache.torque.TorqueException - an unexpected exception in the database layerKKAdminException - an unexpected exception in the KKAdmin enginecom.workingdogs.village.DataSetException - an unexpected exception in the database layerCopyright © 2018 DS Data Systems UK Ltd.