public class AdminApsisBatchMgr extends AdminCustomerBatchMgr
AdminCustomerBatchMgr.CustRetListAdminBatchBaseMgr.CustTagCounterAdminBaseMgr.StaticDatalogadminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir| Constructor and Description |
|---|
AdminApsisBatchMgr(KKAdminIf eng) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
createSubscriber(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToCreate,
int mailingListId,
AdminCustomer cust,
java.util.HashMap<java.lang.String,AdminCustomerTag> currentKKCustTags,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
Create a new APSIS subscriber.
|
protected int |
createSubscribers(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToCreate,
int mailingListId,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
Create a batch of new APSIS subscribers.
|
protected boolean |
customerExcluded(AdminCustomer cust,
java.lang.String[] excludedEmails)
Should we exclude this customer?
|
protected com.konakart.db.KKCriteria |
getApsisCustomerCriteria(int size)
Get the criteria object to retrieve customers for updating APSIS
|
private boolean |
subscriberChangesMade(com.konakart.bl.modules.others.apsismail.SubscriberResponse sub,
com.konakart.bl.modules.others.apsismail.Subscriber newSub,
java.util.Set<java.lang.String> tagsToUpdate)
Return true if changes have been made between the two Subscriber records
|
java.lang.String |
updateApsisSubscribersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String mailingListName,
java.lang.String tagNames,
java.lang.String excludedEmailsRE)
This is an example of how you might update APSIS Email Subscribers in a batch job.
|
protected int |
updateSubscriber(com.konakart.bl.modules.others.apsismail.SubscriberResponse sub,
java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToUpdate,
int mailingListId,
AdminCustomer cust,
java.util.HashMap<java.lang.String,AdminCustomerTag> currentKKCustTags,
java.util.Set<java.lang.String> tagsToUpdate,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
Update an APSIS subscriber.
|
protected int |
updateSubscribers(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToUpdate,
int mailingListId,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
Create a batch of APSIS subscriber updates.
|
countCustomersBatch, deleteCustomer, deleteTemporaryDataBatch, expiredRewardPointBatch, getCustomerCriteria, getCustomers, getCustomerTagsHash, getGenderValueFromCustomer, getLiteCustomerCriteria, getNewsletterValue, getSessionCriteria, getTagsFromAllOrders, getTagsFromLastOrder, getTimeInSecs, getUnpaidOrders, hasSessionExpired, insertOrUpdateCustomerTag, removeExpiredCustomersBatch, resetAggregateOrderTotalCustomerTag, updateCustomerTagsBatch, updateSummaryCustomerTagsBatchensureCustomerTagIsPresent, 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 AdminApsisBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng - the engjava.lang.Exception - an unexpected exceptionpublic java.lang.String updateApsisSubscribersBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String mailingListName,
java.lang.String tagNames,
java.lang.String excludedEmailsRE)
throws java.lang.Exception
Each existing customer is read from the database in a loop, and for each customer object we synchronise subscriber records and KonaKart customer records.
A set of customer tags are updated. These are stored as "Demographic Data" against the subscriber in APSIS.
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.mailingListName - The mailing list to subscribe the KonaKart customers to.tagNames - A comma-separated set of Customer Tag names to update in APSIS against the
customer's subscriber record..excludedEmailsRE - A comma-separated set of regular expressions that define the email addresses that
will not be created in APSISjava.lang.Exception - an unexpected exceptionprotected com.konakart.db.KKCriteria getApsisCustomerCriteria(int size)
size - the number of records to retrieve at a timeprotected boolean customerExcluded(AdminCustomer cust, java.lang.String[] excludedEmails)
cust - the customerexcludedEmails - an array of regular expressions to define the excluded customersprotected int createSubscriber(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToCreate,
int mailingListId,
AdminCustomer cust,
java.util.HashMap<java.lang.String,AdminCustomerTag> currentKKCustTags,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
throws com.konakart.app.KKException
subscribersToCreate - of list of Subscribers that is passed back and forth. When it reaches 10
subscribers we send it off to Apsis and clear it.mailingListId - the mailing list Id of the Apsis mailing list to subscribe tocust - the KonaKart customer to become the new subscribercurrentKKCustTags - the current customer tags of the KonaKart customer that are to be sent to APSIS
with the new subscriber record.apsisMail - an instance of ApsisMail for Apsis operationscom.konakart.app.KKException - If something unexpected happened in the KonaKart Engine or in the Apsis moduleprotected int createSubscribers(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToCreate,
int mailingListId,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
throws com.konakart.app.KKException
subscribersToCreate - of list of Subscribers to send to Apsis.mailingListId - the mailing list Id of the Apsis mailing list to subscribe toapsisMail - an instance of ApsisMail for Apsis operationscom.konakart.app.KKException - If something unexpected happened in the KonaKart Engine or in the Apsis moduleprotected int updateSubscriber(com.konakart.bl.modules.others.apsismail.SubscriberResponse sub,
java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToUpdate,
int mailingListId,
AdminCustomer cust,
java.util.HashMap<java.lang.String,AdminCustomerTag> currentKKCustTags,
java.util.Set<java.lang.String> tagsToUpdate,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
throws com.konakart.app.KKException
sub - the subscriber record returned from APSISsubscribersToUpdate - of list of Subscribers that is passed back and forth. When it reaches 10
subscribers we send it off to Apsis and clear it.mailingListId - the mailing list Id of the Apsis mailing list to subscribe tocust - the KonaKart customer being updatedcurrentKKCustTags - the current customer tags of the KonaKart customer that are to be sent to APSIS
with the updated subscriber record.tagsToUpdate - a set of tag names that are candidates to be updated in APSISapsisMail - an instance of ApsisMail for Apsis operationscom.konakart.app.KKException - If something unexpected happened in the KonaKart Engine or in the Apsis moduleprivate boolean subscriberChangesMade(com.konakart.bl.modules.others.apsismail.SubscriberResponse sub,
com.konakart.bl.modules.others.apsismail.Subscriber newSub,
java.util.Set<java.lang.String> tagsToUpdate)
sub - a subcriber responsenewSub - a new subscribertagsToUpdate - a set of tag names that are candidates to be updated in APSISprotected int updateSubscribers(java.util.List<com.konakart.bl.modules.others.apsismail.Subscriber> subscribersToUpdate,
int mailingListId,
com.konakart.bl.modules.others.apsismail.ApsisMail apsisMail)
throws com.konakart.app.KKException
subscribersToUpdate - of list of Subscribers to send to Apsis.mailingListId - the mailing list Id of the Apsis mailing list to subscribe toapsisMail - an instance of ApsisMail for Apsis operationscom.konakart.app.KKException - If something unexpected happened in the KonaKart Engine or in the Apsis moduleCopyright © 2018 DS Data Systems UK Ltd.