atg.purge
Class PurgeProducer

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.PagedQueryIteratorFactory
              extended by atg.purge.PurgeProducer
All Implemented Interfaces:
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, java.util.EventListener

public class PurgeProducer
extends atg.repository.PagedQueryIteratorFactory

Purge producer is obtaining candidate items for purging and pass them to purge executor for actual purge work. It also keeps track of purge results and update corresponding purge progress item. We are checking purge progress repository to allow only a single purge to be executed at a time.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
PurgeProducer()
           
 
Method Summary
 atg.repository.PagedQueryIterator createPagedQueryIterator(PurgeConfiguration pPurgeConfiguration)
          Create a new PagedQueryIterator, using property values set on this factory and purge configuration.
protected  PurgeItem createPurgeItem(RepositoryItem pRepositoryItem, PurgeConfiguration pPurgeConfiguration)
          Construct purge item object based on current repository item and purge configuration
 atg.purge.PurgeSummary createPurgeSummary(PurgeConfiguration pPurgeConfiguration)
          Create purge summary results based on purge configuration
 void doStartService()
          Ensure that all required properties are set
 ProcessConfiguration getProcessConfiguration()
          Returns property processConfiguration
 PurgeConfiguration getPurgeConfiguration()
          Returns property purgeConfiguration
 PurgeExecutor getPurgeExecutor()
          Returns property purgeExecutor
 atg.purge.PurgeProgressTools getPurgeProgressTools()
          Returns property purgeProgressTools
 boolean isPurgeRunning()
          Returns true if purge is currently running or hanging and false otherwise.
 void performTask()
          Start purge process work using current purge configuration in a new thread so that we are not blocking method execution until purge completed.
 void performTask(PurgeConfiguration pPurgeConfiguration)
          Start purge process work using selected purge configuration in a new thread so that we are not blocking method execution until purge completed.
 void performTaskAndWait()
          Start purge process work using current purge configuration.
 void performTaskAndWait(PurgeConfiguration pPurgeConfiguration)
          Start purge process work using selected purge configuration.
 void setProcessConfiguration(ProcessConfiguration pProcessConfiguration)
          Sets property processConfiguration
 void setPurgeConfiguration(PurgeConfiguration pPurgeConfiguration)
          Sets property purgeConfiguration
 void setPurgeExecutor(PurgeExecutor pPurgeExecutor)
          Sets property purgeExecutor
 void setPurgeProgressTools(atg.purge.PurgeProgressTools pPurgeProgressTools)
          Sets property purgeProgressTools
 void startPurge()
          Start purge process work using current purge configuration.
 void startPurge(PurgeConfiguration pPurgeConfiguration)
          Start purge process work using selected purge configuration.
 
Methods inherited from class atg.repository.PagedQueryIteratorFactory
countItems, countItemsUsingInnerClass, createPagedQueryIterator, getBaseQuery, getItemDescriptorName, getPageSize, getPagingPropertyName, getQueryOptions, getRepository, getRepositoryItemGroup, getRepositoryView, getTransactionManager, setBaseQuery, setItemDescriptorName, setPageSize, setPagingPropertyName, setQueryOptions, setRepository, setRepositoryItemGroup, setRepositoryView, setTransactionManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, 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

PurgeProducer

public PurgeProducer()
Method Detail

getPurgeExecutor

public PurgeExecutor getPurgeExecutor()
Returns property purgeExecutor

Returns:
the purge executor

setPurgeExecutor

public void setPurgeExecutor(PurgeExecutor pPurgeExecutor)
Sets property purgeExecutor

Parameters:
pPurgeExecutor - the purge executor

getPurgeConfiguration

public PurgeConfiguration getPurgeConfiguration()
Returns property purgeConfiguration

Returns:
the purge configuration

setPurgeConfiguration

public void setPurgeConfiguration(PurgeConfiguration pPurgeConfiguration)
Sets property purgeConfiguration

Parameters:
pPurgeConfiguration - the purge configuration

getProcessConfiguration

public ProcessConfiguration getProcessConfiguration()
Returns property processConfiguration

Returns:
the process configuration

setProcessConfiguration

public void setProcessConfiguration(ProcessConfiguration pProcessConfiguration)
Sets property processConfiguration

Parameters:
pProcessConfiguration - the process configuration

getPurgeProgressTools

public atg.purge.PurgeProgressTools getPurgeProgressTools()
Returns property purgeProgressTools

Returns:
the purge progress tools to work with purge progress repository

setPurgeProgressTools

public void setPurgeProgressTools(atg.purge.PurgeProgressTools pPurgeProgressTools)
Sets property purgeProgressTools

Parameters:
pPurgeProgressTools - the purge progress tools to work with purge progress repository

doStartService

public void doStartService()
                    throws ServiceException
Ensure that all required properties are set

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

isPurgeRunning

public boolean isPurgeRunning()
Returns true if purge is currently running or hanging and false otherwise.


startPurge

public void startPurge()
                throws java.lang.Exception
Start purge process work using current purge configuration.

Throws:
java.lang.Exception - if there is an error

startPurge

public void startPurge(PurgeConfiguration pPurgeConfiguration)
                throws java.lang.Exception
Start purge process work using selected purge configuration.

Parameters:
pPurgeConfiguration - the purge configuration
Throws:
java.lang.Exception - if there is an error

performTask

public void performTask()
Start purge process work using current purge configuration in a new thread so that we are not blocking method execution until purge completed. Check if another purge is currently running/hanging at the beginning and exit current task execution in this case.


performTask

public void performTask(PurgeConfiguration pPurgeConfiguration)
Start purge process work using selected purge configuration in a new thread so that we are not blocking method execution until purge completed. Check if another purge is currently running/hanging at the beginning and exit current task execution in this case.

Parameters:
pPurgeConfiguration - the purge configuration

performTaskAndWait

public void performTaskAndWait()
Start purge process work using current purge configuration. Check if another purge is currently running/hanging at the beginning and exit current task execution in this case.


performTaskAndWait

public void performTaskAndWait(PurgeConfiguration pPurgeConfiguration)
Start purge process work using selected purge configuration. Check if another purge is currently running/hanging at the beginning and exit current task execution in this case.

Parameters:
pPurgeConfiguration - the purge configuration

createPurgeSummary

public atg.purge.PurgeSummary createPurgeSummary(PurgeConfiguration pPurgeConfiguration)
                                          throws RepositoryException
Create purge summary results based on purge configuration

Parameters:
pPurgeConfiguration - the purge configuration
Returns:
the purge summary results
Throws:
RepositoryException - if there is an error while performing the query operation

createPagedQueryIterator

public atg.repository.PagedQueryIterator createPagedQueryIterator(PurgeConfiguration pPurgeConfiguration)
                                                           throws RepositoryException
Create a new PagedQueryIterator, using property values set on this factory and purge configuration.

Parameters:
pPurgeConfiguration - the purge configuration
Returns:
PagedQueryIterator object
Throws:
RepositoryException - if there is an error while performing the query operation

createPurgeItem

protected PurgeItem createPurgeItem(RepositoryItem pRepositoryItem,
                                    PurgeConfiguration pPurgeConfiguration)
Construct purge item object based on current repository item and purge configuration

Parameters:
pRepositoryItem - the repository item
pPurgeConfiguration - the purge configuration
Returns:
the purge item object