atg.commerce.catalog.custom
Class CatalogMaintenanceService

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.catalog.CMSService
                      extended by atg.commerce.catalog.StandardCatalogMaintenance
                          extended by atg.commerce.catalog.custom.CatalogMaintenanceService
All Implemented Interfaces:
atg.commerce.catalog.CMSConstants, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, Schedulable, java.util.EventListener

public class CatalogMaintenanceService
extends atg.commerce.catalog.StandardCatalogMaintenance

This service extends the standard catalog maintenance to provide processing specific to custom catalogs.


Nested Class Summary
 
Nested classes/interfaces inherited from class atg.commerce.catalog.CMSService
atg.commerce.catalog.CMSService.BookkeepingForThread
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.service.scheduler.SchedulableService
mJobId
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.commerce.catalog.CMSConstants
AGS_GENANCESTORS, AGS_GENANCESTORS_FOR_CATEGORY, AGS_GENANCESTORS_FOR_PRODUCT, AGS_GENCATALOGS, AGS_GENCATALOGS_FOR_CATEGORY, AGS_GENCATALOGS_FOR_PRODUCT, AGS_GENCATALOGS_FOR_SKU, AGS_GENPARENTCATS, AGS_GENPROPERTIES, AGS_GENPROPERTIES_FOR_CATEGORY, AGS_GENPROPERTIES_FOR_PRODUCT, ANCESTORS_GENERATED, CATALOGS_UPDATED, CATALOGS_VERIFIED, CATEGORIES_VERIFIED, CUS_INVALID_PARENT_BRANCH, CUS_NAME_ALREADY_IN_USE, CUS_UNABLE_TO_GET_WS, CUS_UPDATECATALOGS, CUS_USING_CHECKED_IN_WS, CUS_VM_NOT_SET, CUS_WS_NOT_CREATED, CUS_WS_NOT_CREATED_INVALID_PARENT_BRANCH, CUS_WS_REQUIRED, CVS_VERIFYCATALOGS, CVS_VERIFYCATEGORIES, CVS_VERIFYPRODUCTS, CVS_VERIFYSKUS, DEFAULT_CATALOG_FOLDER_ITEM_TYPE, DEFAULT_CATALOG_ITEM_TYPE, DEFAULT_MAP_SIZE, GENERATED_ANCESTORS_MAP, INFOS_GENERATED, IS_ANCESTORS_GENERATED_MAP, LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARNING, MY_RESOURCE_NAME, NO_PATH, NOT_GENERATOR, sResourceBundle, TYPE_ANCESTOR, TYPE_CATALOGMAINTENANCE, TYPE_CUSTOM_MIGRATION, TYPE_MIGRATION, TYPE_UPDATE, TYPE_VERIFY, VALID_PATH
 
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
CatalogMaintenanceService()
           
 
Method Summary
 void doScheduledTask(Scheduler pScheduler, ScheduledJob pScheudledJob)
          Callback method for the SingletonSchedulableService.
 AncestorGeneratorService getAncestorGeneratorService()
          This service will generate the ancestorCategories for categories and products
 java.lang.String[] getCatalogIdsToUpdate()
          The list of catalogs ids that will be updated the next time this service runs
 CatalogProperties getCatalogProperties()
          A helper class that holds commonly accessed reposority property and item names
 CustomCatalogTools getCatalogTools()
          Returns property catalogTools
 CatalogVerificationService getCatalogVerificationService()
          This class will verify that catalog only refers to items within the catalog
 boolean isPerformCategoryVerification()
          Deprecated. - category verification is always part of catalog verification
 boolean isPerformInfoVerification()
          If true, the CatalogVerificationService will execute by default.
 void performMaintenance()
          Perform the maintenance in this order (the last step only happens if performInfoVerification is true.
 void performMaintenance(boolean pGetLock)
          Perform the maintenance in this order (the last step only happens if performInfoVerification is true.
 void performMaintenance(boolean pGetLock, Repository pCatalogRepository, java.util.Collection pCatalogIds, boolean pRunAncestors, boolean pRunInfoVerification)
          Perform the maintenance on the given catalogs within the given repository.
 void performMaintenance(java.util.Collection pCatalogIds)
          Perform the maintenance on the given catalogs in this order (the last step only happens if performInfoVerification is true.
 void performMaintenance(java.util.Collection pCatalogIds, boolean pRunAncestors, boolean pRunInfoVerification)
          Perform the maintenance on the given catalogs in the following order.
 void performMaintenance(Repository pCatalogRepository, java.util.Collection pCatalogIds)
          Perform the maintenance on the given catalogs within the given repository.
 void performMaintenance(Repository pCatalogRepository, java.util.Collection pCatalogIds, boolean pRunAncestors, boolean pRunInfoVerification)
          Perform the maintenance on the given catalogs within the given repository.
 void postService(boolean pPerformServiceReturn, Repository pRepository, java.util.Collection pCatalogIds, java.util.List pServiceFunctions)
          Method called after maintenance completed.
 boolean preService(Repository pRepository, java.util.Collection pCatalogIds, java.util.List pServiceFunctions)
          Method called prior to start of maintenance.
 void setCatalogIdsToUpdate(java.lang.String[] pCatalogIdsToUpdate)
           
 void setCatalogProperties(CatalogProperties pCatalogProperties)
           
 void setCatalogTools(CustomCatalogTools pCatalogTools)
          Sets property catalogTools
 void setPerformCategoryVerification(boolean pPerformCategoryVerification)
           
 void setPerformInfoVerification(boolean pPerformInfoVerification)
           
 void showMessages()
          dumps out all current messages to the dynamo log
 
Methods inherited from class atg.commerce.catalog.StandardCatalogMaintenance
addCatalogMaintenanceListener, addServiceToMap, clearMessages, createServicesFunctions, getAllMessages, getAvailableFunctions, getAvailableServices, getCatalogMaintenanceListeners, getLastExecutionFinishTime, getLastExecutionStartTime, getLastRepository, getLastServicesPerformed, getService, getServiceName, getServices, getServicesMap, getServiceWithFunction, getStandardCatalogTools, getTotalNumberOfErrorMessages, getTotalNumberOfInfoMessages, getTotalNumberOfMessages, getTotalNumberOfWarningMessages, isFirstPhase, isSaveMessages, notifyListeners, performMaintenance, performService, removeCatalogMaintenanceListener, setAvailableFunctions, setAvailableServices, setCatalogMaintenanceListeners, setFirstPhase, setLastExecutionFinishTime, setLastExecutionStartTime, setLastRepository, setLastServicesPerformed, setSaveMessages, setStandardCatalogTools, stringIt, stringIt
 
Methods inherited from class atg.commerce.catalog.CMSService
addErrorMessage, addInfoMessage, addWarningMessage, clearBookkeepingForThread, createCMSMessage, doService, getBookkeepingForThread, getCurrentMessages, getErrorMessages, getFunctionsToPerformByDefault, getInfoMessages, getServiceLock, getTransactionManager, getWarningMessages, hasFunction, logDebug, logError, logInfo, logWarning, performService, removeServiceLock, setFunctionsToPerformByDefault, setTransactionManager
 
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, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logError, logError, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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

Constructor Detail

CatalogMaintenanceService

public CatalogMaintenanceService()
Method Detail

getAncestorGeneratorService

public AncestorGeneratorService getAncestorGeneratorService()
This service will generate the ancestorCategories for categories and products


getCatalogVerificationService

public CatalogVerificationService getCatalogVerificationService()
This class will verify that catalog only refers to items within the catalog


setCatalogIdsToUpdate

public void setCatalogIdsToUpdate(java.lang.String[] pCatalogIdsToUpdate)

getCatalogIdsToUpdate

public java.lang.String[] getCatalogIdsToUpdate()
The list of catalogs ids that will be updated the next time this service runs


setCatalogProperties

public void setCatalogProperties(CatalogProperties pCatalogProperties)

getCatalogProperties

public CatalogProperties getCatalogProperties()
A helper class that holds commonly accessed reposority property and item names


setCatalogTools

public void setCatalogTools(CustomCatalogTools pCatalogTools)
Sets property catalogTools


getCatalogTools

public CustomCatalogTools getCatalogTools()
Returns property catalogTools


setPerformCategoryVerification

public void setPerformCategoryVerification(boolean pPerformCategoryVerification)

isPerformCategoryVerification

public boolean isPerformCategoryVerification()
Deprecated. - category verification is always part of catalog verification

If true, the CatalogVerificationService will verify the categories.


setPerformInfoVerification

public void setPerformInfoVerification(boolean pPerformInfoVerification)

isPerformInfoVerification

public boolean isPerformInfoVerification()
If true, the CatalogVerificationService will execute by default.


doScheduledTask

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

Overrides:
doScheduledTask in class atg.commerce.catalog.CMSService

performMaintenance

public void performMaintenance()
Perform the maintenance in this order (the last step only happens if performInfoVerification is true.

Overrides:
performMaintenance in class atg.commerce.catalog.StandardCatalogMaintenance
See Also:
isPerformInfoVerification(), TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(boolean pGetLock)
Perform the maintenance in this order (the last step only happens if performInfoVerification is true. This method will use the same lock as the SingletonScheduledService if pGetLock is true.

Catalogs processed is limited to the preconfigured value specified by getCatalogIdsToUpdate() If no preconfigured catalogs, then all catalogs are processed.

Overrides:
performMaintenance in class atg.commerce.catalog.StandardCatalogMaintenance
Parameters:
pGetLock - If true, then the lock used by the SingletonScheduledService must be acquired before the maintenance is run. If false, no lock is acquired.
See Also:
isPerformInfoVerification(), TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(java.util.Collection pCatalogIds)
Perform the maintenance on the given catalogs in this order (the last step only happens if performInfoVerification is true.

Parameters:
pCatalogIds - The list of catalogs to update. If this is null, all catalogs are updated.
See Also:
isPerformInfoVerification(), TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(java.util.Collection pCatalogIds,
                               boolean pRunAncestors,
                               boolean pRunInfoVerification)
Perform the maintenance on the given catalogs in the following order. This is the method that gets called by the ACC.

Parameters:
pCatalogIds - The list of catalogs to update. If this is null, all catalogs are updated.
pRunAncestors - If true, then the AncestorGeneratorService is run. If false, it is not
pRunInfoVerification - If true, then the CatalogVerificationService is run.
See Also:
TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(Repository pCatalogRepository,
                               java.util.Collection pCatalogIds)
Perform the maintenance on the given catalogs within the given repository. The last step only takes place if isPerformInfoVerification is true.

Parameters:
pCatalogRepository - The catalog repository to update
pCatalogIds - The list of catalogs to update. If this is null, all catalogs in the given repository are updated.
See Also:
isPerformInfoVerification(), TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(Repository pCatalogRepository,
                               java.util.Collection pCatalogIds,
                               boolean pRunAncestors,
                               boolean pRunInfoVerification)
Perform the maintenance on the given catalogs within the given repository. This method will not attempt get the service lock.

Parameters:
pCatalogRepository - The catalog repository to update
pCatalogIds - The list of catalogs to update. If this is null, all catalogs in the given repository are updated.
pRunAncestors - If true, then the AncestorGeneratorService is run. If false, it is not
pRunInfoVerification - boolean to control the execution of CatalogVerificationService. If true, the verification service is executed.
See Also:
TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

performMaintenance

public void performMaintenance(boolean pGetLock,
                               Repository pCatalogRepository,
                               java.util.Collection pCatalogIds,
                               boolean pRunAncestors,
                               boolean pRunInfoVerification)
Perform the maintenance on the given catalogs within the given repository.

Parameters:
pGetLock - If true the service locked must be obtained before execution
pCatalogRepository - The catalog repository to update
pCatalogIds - The list of catalogs to update. If this is null, all catalogs in the given repository are updated.
pRunAncestors - If true, then the AncestorGeneratorService is run. If false, it is not
pRunInfoVerification - boolean to control the execution of CatalogVerificationService. If true, the verification service is executed.
See Also:
TreeWalkUpdateService.performService(atg.repository.Repository, java.util.Collection, java.util.List), CatalogVerificationService.performService(atg.repository.Repository, java.util.Collection, java.util.List)

preService

public boolean preService(Repository pRepository,
                          java.util.Collection pCatalogIds,
                          java.util.List pServiceFunctions)
Method called prior to start of maintenance.

Overrides:
preService in class atg.commerce.catalog.StandardCatalogMaintenance
Parameters:
pRepository - the catalogs repository
pCatalogIds - the catalog item ids. note this is only relevent for custom catalog services
Returns:
boolean - return true if maintenance should continue return false to terminate maintenance

postService

public void postService(boolean pPerformServiceReturn,
                        Repository pRepository,
                        java.util.Collection pCatalogIds,
                        java.util.List pServiceFunctions)
Method called after maintenance completed.

Overrides:
postService in class atg.commerce.catalog.StandardCatalogMaintenance
Parameters:
pRepository - the catalogs repository
pCatalogIds - the catalog item ids. note this is only relevent for custom catalog services

showMessages

public void showMessages()
dumps out all current messages to the dynamo log

Overrides:
showMessages in class atg.commerce.catalog.StandardCatalogMaintenance