atg.endeca.index
Class DeleteMissingIndexingSynchronization

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.endeca.index.DeleteMissingIndexingSynchronization
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 DeleteMissingIndexingSynchronization
extends GenericService

This IndexingSynchronization stores all generated IDs to a file, and then later, on a non-baseline index, issues a delete for those IDs not regenerated during the current session.

Created: January 06 2012


Field Summary
static java.lang.String ATTR_FILE
          The calculated name of the file.
static java.lang.String ATTR_IDS
          The attribute name for the set of IDs which are both stored on the context, and stored on the IndexingTask.
static java.lang.String CLASS_VERSION
          Class version string from source code control system.
 
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
DeleteMissingIndexingSynchronization()
           
 
Method Summary
 void afterDocument(atg.repository.search.indexing.Context pContext)
           
 void afterSessionStart(atg.repository.search.indexing.Context pContext)
          This method is invoked immediately after a DocumentSubmitter session is started.
 void beforeSessionEnd(atg.repository.search.indexing.Context pContext)
          This method is invoked immediately before a DocumentSubmitter session is closed.
 void cleanup(IndexingTask pTask, boolean pSuccess)
           
protected  PersistUtils createPersistUtils()
          Create a new PersistUtils instance.
protected  IndexingTask getIndexingTask(atg.repository.search.indexing.Context pContext)
          Get the indexing task.
 java.io.File getPersistIdsDir()
          Returns property persistIdsDir.
protected  java.io.File getPersistIdsFile(atg.repository.search.indexing.Context pContext, IndexingTask pTask)
          Get the file name to persist IDss.
 java.util.Set<java.lang.String> getPreviouslyPersistedIds(atg.repository.search.indexing.Context pContext)
          Get the IDs previously persisted, reads from the persistIdsFile.
protected  void persistIds(atg.repository.search.indexing.Context pContext, IndexingTask pTask, java.util.Set<java.lang.String> pSetIds)
          Persist IDs to a file.
 void setPersistIdsDir(java.io.File pPersistIdsDir)
          Sets property persistIdsDir.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, 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 final java.lang.String CLASS_VERSION
Class version string from source code control system.

See Also:
Constant Field Values

ATTR_IDS

public static final java.lang.String ATTR_IDS
The attribute name for the set of IDs which are both stored on the context, and stored on the IndexingTask.

See Also:
Constant Field Values

ATTR_FILE

public static final java.lang.String ATTR_FILE
The calculated name of the file.

See Also:
Constant Field Values
Constructor Detail

DeleteMissingIndexingSynchronization

public DeleteMissingIndexingSynchronization()
Method Detail

setPersistIdsDir

public void setPersistIdsDir(java.io.File pPersistIdsDir)
Sets property persistIdsDir. The file to which document IDs should be saved at the end of a session.


getPersistIdsDir

public java.io.File getPersistIdsDir()
Returns property persistIdsDir. The file to which document IDs should be saved at the end of a session.


afterSessionStart

public void afterSessionStart(atg.repository.search.indexing.Context pContext)
                       throws atg.repository.search.indexing.IndexingException
This method is invoked immediately after a DocumentSubmitter session is started.

Parameters:
pContext - the Context for the current indexing operation. The DocumentSubmitterSession is available as a property, as is the IndexingOutputConfig and other state information.
Throws:
atg.repository.search.indexing.IndexingException

getPersistIdsFile

protected java.io.File getPersistIdsFile(atg.repository.search.indexing.Context pContext,
                                         IndexingTask pTask)
Get the file name to persist IDss.

Parameters:
pContext - the current indexing Context
pTask - the current IndexingTask

createPersistUtils

protected PersistUtils createPersistUtils()
Create a new PersistUtils instance.


getPreviouslyPersistedIds

public java.util.Set<java.lang.String> getPreviouslyPersistedIds(atg.repository.search.indexing.Context pContext)
                                                          throws atg.repository.search.indexing.IndexingException
Get the IDs previously persisted, reads from the persistIdsFile.

Parameters:
pContext - the current context, if any.
Throws:
atg.repository.search.indexing.IndexingException

beforeSessionEnd

public void beforeSessionEnd(atg.repository.search.indexing.Context pContext)
                      throws atg.repository.search.indexing.IndexingException
This method is invoked immediately before a DocumentSubmitter session is closed.

Parameters:
pContext - the Context for the current indexing operation. The DocumentSubmitterSession is available as a property, as is the IndexingOutputConfig and other state information.
Throws:
atg.repository.search.indexing.IndexingException

getIndexingTask

protected IndexingTask getIndexingTask(atg.repository.search.indexing.Context pContext)
Get the indexing task. Attempst to get the current indexing task via IndexingTask.getCurrentIndexingTask(), and failing that, attempts to get it from a global attribute on pContext.

Parameters:
pContext - the current indexing context.

persistIds

protected void persistIds(atg.repository.search.indexing.Context pContext,
                          IndexingTask pTask,
                          java.util.Set<java.lang.String> pSetIds)
                   throws atg.repository.search.indexing.IndexingException
Persist IDs to a file. Note that one of task or context must be non-null.

Parameters:
pContext - the current context
pTask - the current indexing task.
pSetIds - the set of IDs to persist.
Throws:
atg.repository.search.indexing.IndexingException

afterDocument

public void afterDocument(atg.repository.search.indexing.Context pContext)
                   throws atg.repository.search.indexing.IndexingException
Throws:
atg.repository.search.indexing.IndexingException

cleanup

public void cleanup(IndexingTask pTask,
                    boolean pSuccess)
             throws atg.repository.search.indexing.IndexingException
Throws:
atg.repository.search.indexing.IndexingException