atg.repository.search.indexing
Class IndexingPeriodicService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.scheduler.SchedulableService
              extended by atg.repository.search.indexing.IndexingPeriodicService
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, atg.nucleus.PostStartupAction, Service, ServiceListener, Schedulable, java.util.EventListener

public class IndexingPeriodicService
extends SchedulableService
implements atg.nucleus.PostStartupAction

The indexing periodic service. This service checks for claimed but expired configurations, and for configurations that have incremental updates due.

Created: April 21 2005


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.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
IndexingPeriodicService()
           
 
Method Summary
 void checkForExpiredConfigurationClaims()
          Look for expirations that have expired.
 void doStartService()
          The default implementation is to just start our scheduled job.
 long getCheckExpiredConfigurationClaimsIntervalMSecs()
          The minimum interval in milliseconds between checks for expired configuration claims.
 ConfigStatePersister getConfigStatePersister()
          Get the configuration state persister.
 IncrementalLoader getIncrementalLoader()
          Get the incremental loader to use.
 java.util.List getIncrementalLoaders()
           
 boolean isEnabled()
          Return whether this service is enabled.
 boolean isPostStartup()
          If true, Nucleus has called performAction()
protected  boolean needsIncrementalUpdate(ConfigStatePersister.ConfigState pConfigState, IndexingOutputConfig pConfig)
          Whether the specified configuration needs an incremental update based on the last update indexed times.
 void performAction()
          Implementation of PostStartupAction interface.
 void performScheduledTask()
          Perform our scheduled task.
 void performScheduledTask(Scheduler pScheduler, ScheduledJob pJob)
          Called by the scheduler when it is time for this service to perform its function.
 void scanForIncrementalUpdates()
          Look for configurations to claim.
protected  void scanForIncrementalUpdates(IncrementalLoader pLoader)
           
 void setCheckExpiredConfigurationClaimsIntervalMSecs(long pCheckExpiredConfigurationClaimsIntervalMSecs)
          Set the minimum interval in milliseconds between checks for expired configuration claims.
 void setConfigStatePersister(ConfigStatePersister pConfigStatePersister)
          Set the configuration state persister.
 void setEnabled(boolean pEnabled)
          Set whether this service is enabled.
 void setIncrementalLoader(IncrementalLoader pIncrementalLoader)
          Set the incremental loader to use.
 void setIncrementalLoaders(java.util.List pLoaders)
           
 void setPostStartup(boolean pPostStartup)
          If true, Nucleus has called performAction()
 
Methods inherited from class atg.service.scheduler.SchedulableService
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, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

IndexingPeriodicService

public IndexingPeriodicService()
Method Detail

setConfigStatePersister

public void setConfigStatePersister(ConfigStatePersister pConfigStatePersister)
Set the configuration state persister.


getConfigStatePersister

public ConfigStatePersister getConfigStatePersister()
Get the configuration state persister.


setEnabled

public void setEnabled(boolean pEnabled)
Set whether this service is enabled.


isEnabled

public boolean isEnabled()
Return whether this service is enabled.


isPostStartup

public boolean isPostStartup()
If true, Nucleus has called performAction()

Returns:
true if performAction() has been called

setPostStartup

public void setPostStartup(boolean pPostStartup)
If true, Nucleus has called performAction()


setIncrementalLoader

public void setIncrementalLoader(IncrementalLoader pIncrementalLoader)
Set the incremental loader to use.


getIncrementalLoader

public IncrementalLoader getIncrementalLoader()
Get the incremental loader to use.


getIncrementalLoaders

public java.util.List getIncrementalLoaders()

setIncrementalLoaders

public void setIncrementalLoaders(java.util.List pLoaders)

setCheckExpiredConfigurationClaimsIntervalMSecs

public void setCheckExpiredConfigurationClaimsIntervalMSecs(long pCheckExpiredConfigurationClaimsIntervalMSecs)
Set the minimum interval in milliseconds between checks for expired configuration claims. NOTE: The actual interval can be longer if the IndexingPeriodicService runs less frequently than this interval value.


getCheckExpiredConfigurationClaimsIntervalMSecs

public long getCheckExpiredConfigurationClaimsIntervalMSecs()
The minimum interval in milliseconds between checks for expired configuration claims. NOTE: The actual interval can be longer if the IndexingPeriodicService runs less frequently than this interval value.


doStartService

public void doStartService()
                    throws ServiceException
The default implementation is to just start our scheduled job. Subclasses should override this to perform any extra initialization they may require.

Overrides:
doStartService in class SchedulableService
Throws:
ServiceException - if an error occurred during the operation

performAction

public void performAction()
Implementation of PostStartupAction interface. Called after Nucleus is started. Defers the start of the scheduled jobs until after nucleus is started so all IndexingOutputConfig have a chance to start first.

Specified by:
performAction in interface atg.nucleus.PostStartupAction

performScheduledTask

public void performScheduledTask(Scheduler pScheduler,
                                 ScheduledJob pJob)
Called by the scheduler when it is time for this service to perform its function.

Specified by:
performScheduledTask in interface Schedulable
Specified by:
performScheduledTask in class SchedulableService
Parameters:
pScheduler - the scheduler managing this job
pJob - the scheduled job associated with this service

performScheduledTask

public void performScheduledTask()
                          throws IndexingException
Perform our scheduled task.

Throws:
IndexingException

checkForExpiredConfigurationClaims

public void checkForExpiredConfigurationClaims()
                                        throws IndexingException
Look for expirations that have expired.

Throws:
IndexingException

scanForIncrementalUpdates

public void scanForIncrementalUpdates()
Look for configurations to claim.


scanForIncrementalUpdates

protected void scanForIncrementalUpdates(IncrementalLoader pLoader)

needsIncrementalUpdate

protected boolean needsIncrementalUpdate(ConfigStatePersister.ConfigState pConfigState,
                                         IndexingOutputConfig pConfig)
Whether the specified configuration needs an incremental update based on the last update indexed times.

Parameters:
pConfigState - the configuration state to check
pConfig - the configuration.