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 from source code control system.
 
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 getApplicationNameFormatString()
          Returns property applicationIdFormatString.
protected  java.lang.String getAppNameForLocale(java.util.Locale pLocal)
          The the application name to use for the specified locale.
 java.lang.String getBaselineScriptName()
          Returns property baselineScriptName.
 java.lang.String getDefaultLanguageForRecordStores()
          Returns property mDefaultLanguageForRecordStores.
protected  java.util.Locale[] getEffeciveLocales()
          Get the effective locales.
 java.lang.String getEndecaBaseApplicationName()
           
 java.util.Set<java.lang.String> getIndexingOutputConfigPaths()
          Return the set of IndexingOutputConfigs associated with this Indexable.
 java.util.Locale[] getLocales()
          Returns property locales.
 java.lang.String getPartialScriptName()
          Returns property partialScriptName.
 boolean isEnabled()
          Returns property enabled.
 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 pStrScriptName)
          Runs the update script with the given name.
 void setApplicationNameFormatString(java.lang.String pApplicationNameFormatString)
          Sets property applicationIdFormatString.
 void setBaselineScriptName(java.lang.String pBaselineScriptName)
          Sets property baselineScriptName.
 void setDefaultLanguageForRecordStores(java.lang.String pDefaultLanguageForRecordStores)
          Sets property mDefaultLanguageForRecordStores.
 void setEnabled(boolean pEnabled)
          Sets property enabled.
 void setEndecaBaseApplicationName(java.lang.String pEndecaBaseApplicationName)
           
 void setLocales(java.util.Locale[] pLocales)
          Sets property locales.
 void setPartialScriptName(java.lang.String pPartialScriptName)
          Sets property partialScriptName.
 
Methods inherited from class atg.endeca.eacclient.ScriptRunner
calculateEndpointAddress, doStartService, exec, externalExec, getControlLocator, getControlPort, getEACHost, getEACPort, 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 final java.lang.String CLASS_VERSION
Class version string from source code control system.

See Also:
Constant Field Values
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.


setEndecaBaseApplicationName

public void setEndecaBaseApplicationName(java.lang.String pEndecaBaseApplicationName)

getEndecaBaseApplicationName

public java.lang.String getEndecaBaseApplicationName()

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.


setLocales

public void setLocales(java.util.Locale[] pLocales)
Sets property locales. List of locales to generate the schema in.


getLocales

public java.util.Locale[] getLocales()
Returns property locales. List of locales to generate the schema in.


setDefaultLanguageForRecordStores

public void setDefaultLanguageForRecordStores(java.lang.String pDefaultLanguageForRecordStores)
Sets property mDefaultLanguageForRecordStores. If set, everything is exported to a single record store for all locales


getDefaultLanguageForRecordStores

public java.lang.String getDefaultLanguageForRecordStores()
Returns property mDefaultLanguageForRecordStores. If set, everything is exported to a single record store for all locales


getAppNameForLocale

protected java.lang.String getAppNameForLocale(java.util.Locale pLocal)
The the application name to use for the specified locale.

Parameters:
pLocale - the locale to generate the EAC application name (app ID)
Returns:
the application name for the specified locale.

setApplicationNameFormatString

public void setApplicationNameFormatString(java.lang.String pApplicationNameFormatString)
Sets property applicationIdFormatString. The string used to format the name of the endeca project on a per locale basis. When format is called, argument 0 is the base endecaBaseApplicationName property, argument 1 is the language code of the current locale.


getApplicationNameFormatString

public java.lang.String getApplicationNameFormatString()
Returns property applicationIdFormatString. The string used to format the name of the endeca project on a per locale basis. Argument 0 is the base endecaBaseApplicationName property, argument 1 is the language code of the current locale.


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 pStrScriptName)
                           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:
pStrScriptName - 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

getEffeciveLocales

protected java.util.Locale[] getEffeciveLocales()
Get the effective locales. Returns the locales property, if it is non null. Otherwise returns a single element array containing the default Locale for the JVM.