atg.endeca.eacclient
Class ScriptIndexable

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.endeca.eacclient.ScriptRunner
              extended by atg.endeca.eacclient.ScriptIndexable
All Implemented Interfaces:
Indexable, 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 ScriptIndexable
extends ScriptRunner
implements Indexable

An Indexable implementation that is implemented by running Endeca EAC scripts for baseline and partial updates.

Created: November 28 2011


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.endeca.eacclient.ScriptRunner
DEFAULT_SLEEP_TIME, SERVICE_SUFFIX
 
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
ScriptIndexable()
           
 
Method Summary
 boolean cancel(IndexingTask pTask, boolean pBaseline)
          Cancel the currently in-process performBulkLoad or processQueuedIncrementalUpdates.
protected  boolean checkResult(StateType pResult, java.lang.String pAppName, java.lang.String pScriptName)
           
 java.lang.String getBaselineScriptName()
          Returns property baselineScriptName.
 java.lang.String getEACHost()
          Returns property EACHost.
 int getEACPort()
          Returns property EACPort.
 IndexingApplicationConfiguration getIndexingApplicationConfiguration()
          Returns property indexingApplicationConfiguration.
 java.util.Set<java.lang.String> getIndexingOutputConfigPaths()
          Return the set of IndexingOutputConfigs associated with this Indexable.
 java.lang.String getPartialScriptName()
          Returns property partialScriptName.
 boolean isEnabled()
          Returns property enabled.
 boolean isForceToBaseline()
          The method is called before starting partial indexing job for all Indexable to allow forcing the job to baseline indexing.
 boolean isNeededForIncremental()
          Whether this indexable is needed for an incremental update.
 boolean isSupportsStatusCounts()
          Whether this object supports returning/updating status counts.
 boolean mayNeedCleanup()
          Whether this task may need cleanup.
 atg.repository.search.indexing.BulkLoaderResults performBaselineUpdate(IndexingTask pTask)
          Do a full/bulk load.
 atg.repository.search.indexing.LoaderResults performPartialUpdate(IndexingTask pTask)
          Do an incremental load (that is, process any Queued incremental updates.
 void postIndexingCleanup(IndexingTask pTask, boolean pSuccess, atg.repository.search.indexing.LoaderResults pResults)
          Perform any post indexing cleanup.
protected  boolean runUpdateScript(java.lang.String pScriptName)
          Runs the update script with the given name.
 void setBaselineScriptName(java.lang.String pBaselineScriptName)
          Sets property baselineScriptName.
 void setEnabled(boolean pEnabled)
          Sets property enabled.
 void setIndexingApplicationConfiguration(IndexingApplicationConfiguration pIndexingApplicationConfiguration)
          Sets property indexingApplicationConfiguration.
 void setPartialScriptName(java.lang.String pPartialScriptName)
          Sets property partialScriptName.
 
Methods inherited from class atg.endeca.eacclient.ScriptRunner
calculateEndpointAddress, doStartService, exec, externalExec, getControlLocator, getControlPort, getEACScriptTimeout, getServiceProtocol, getSleepTime, setEACHost, setEACPort, setEACScriptTimeout, setServiceProtocol, setSleepTime, startScript, stopScript, testExec, testStartWait, waitForScript
 
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

ScriptIndexable

public ScriptIndexable()
Method Detail

setEnabled

public void setEnabled(boolean pEnabled)
Sets property enabled. Whether this component is enabled as an Indexable.


isEnabled

public boolean isEnabled()
Returns property enabled. Whether this component is enabled as an Indexable.


setIndexingApplicationConfiguration

public void setIndexingApplicationConfiguration(IndexingApplicationConfiguration pIndexingApplicationConfiguration)
Sets property indexingApplicationConfiguration. The Endeca host and application configuration.


getIndexingApplicationConfiguration

@NotNull
public IndexingApplicationConfiguration getIndexingApplicationConfiguration()
Returns property indexingApplicationConfiguration. The Endeca host and application configuration.


setBaselineScriptName

public void setBaselineScriptName(java.lang.String pBaselineScriptName)
Sets property baselineScriptName. The script name we use to do a baseline index.


getBaselineScriptName

public java.lang.String getBaselineScriptName()
Returns property baselineScriptName. The script name we use to do a baseline index.


setPartialScriptName

public void setPartialScriptName(java.lang.String pPartialScriptName)
Sets property partialScriptName. The script name used to do a partial index.


getPartialScriptName

public java.lang.String getPartialScriptName()
Returns property partialScriptName. The script name used to do a partial index.


getEACHost

public java.lang.String getEACHost()
Description copied from class: ScriptRunner
Returns property EACHost. The hostname or IP of EAC.

Overrides:
getEACHost in class ScriptRunner

getEACPort

public int getEACPort()
Description copied from class: ScriptRunner
Returns property EACPort. The port used by EAC service.

Overrides:
getEACPort in class ScriptRunner

performBaselineUpdate

public atg.repository.search.indexing.BulkLoaderResults performBaselineUpdate(IndexingTask pTask)
                                                                       throws atg.repository.search.indexing.IndexingException
Do a full/bulk load. Note that the any results property but "successful" may not be filled except by IndexingOutputConfigs.

This is called "performBulkLoad" rather than "bulkLoad" so that MultiConfigLoader could implement it.

Specified by:
performBaselineUpdate in interface Indexable
Parameters:
pTask - the current indexing task. May be null if not
Throws:
atg.repository.search.indexing.IndexingException

performPartialUpdate

public atg.repository.search.indexing.LoaderResults performPartialUpdate(IndexingTask pTask)
                                                                  throws atg.repository.search.indexing.IndexingException
Do an incremental load (that is, process any Queued incremental updates. Note that the any results property but "successful" may not be filled except by IndexingOutputConfigs.

Specified by:
performPartialUpdate in interface Indexable
Parameters:
pTask - the indexing task invoking the update. May be null if called via another means.
Throws:
atg.repository.search.indexing.IndexingException

runUpdateScript

protected boolean runUpdateScript(java.lang.String pScriptName)
                           throws atg.repository.search.indexing.IndexingException
Runs the update script with the given name. Returns true if script succeeded, that is no essential errors occurred during script run.

Parameters:
pScriptName - script name to run
Returns:
true if script succeeded.
Throws:
atg.repository.search.indexing.IndexingException

checkResult

protected boolean checkResult(StateType pResult,
                              java.lang.String pAppName,
                              java.lang.String pScriptName)

isNeededForIncremental

public boolean isNeededForIncremental()
Whether this indexable is needed for an incremental update.

Specified by:
isNeededForIncremental in interface Indexable
Returns:
true if this Indexable should be invoked for an incremental update, false if this Indexable should not be involved at an incremental update.

postIndexingCleanup

public void postIndexingCleanup(IndexingTask pTask,
                                boolean pSuccess,
                                atg.repository.search.indexing.LoaderResults pResults)
                         throws atg.repository.search.indexing.IndexingException
Description copied from interface: Indexable
Perform any post indexing cleanup.

Specified by:
postIndexingCleanup in interface Indexable
Parameters:
pTask - the current indexing task, if any.
pSuccess - true if we are cleaning up from a successful index, false otherwise.
pResults - the loader results (if any) returns from performBaselineUpdate and performPartialUpdate.
Throws:
atg.repository.search.indexing.IndexingException

mayNeedCleanup

public boolean mayNeedCleanup()
Whether this task may need cleanup. If true is returned, postIndexingCleanup will be called.

Specified by:
mayNeedCleanup in interface Indexable

cancel

public boolean cancel(IndexingTask pTask,
                      boolean pBaseline)
               throws atg.repository.search.indexing.IndexingException
Description copied from interface: Indexable
Cancel the currently in-process performBulkLoad or processQueuedIncrementalUpdates. Quick running indexables may not support cancel.

Specified by:
cancel in interface Indexable
pBaseline - true if this is a baseline/full index, false if this is an incremental/partial index.
Returns:
true if current task was found to cancel, false otherwise.
Throws:
atg.repository.search.indexing.IndexingException

isSupportsStatusCounts

public boolean isSupportsStatusCounts()
Whether this object supports returning/updating status counts.

Specified by:
isSupportsStatusCounts in interface Indexable

getIndexingOutputConfigPaths

public java.util.Set<java.lang.String> getIndexingOutputConfigPaths()
Return the set of IndexingOutputConfigs associated with this Indexable.

Specified by:
getIndexingOutputConfigPaths in interface Indexable

isForceToBaseline

public boolean isForceToBaseline()
The method is called before starting partial indexing job for all Indexable to allow forcing the job to baseline indexing.

Specified by:
isForceToBaseline in interface Indexable
Returns:
true if the job should be forced to baseline.