atg.endeca.index
Class RecordStoreDocumentSubmitter

java.lang.Object
  extended by RecordSubmitterImpl
      extended by atg.endeca.index.RecordStoreDocumentSubmitter
All Implemented Interfaces:
atg.repository.search.indexing.DocumentSubmitter

public class RecordStoreDocumentSubmitter
extends RecordSubmitterImpl
implements atg.repository.search.indexing.DocumentSubmitter

A document submitter that sends documents to an CAS record store. Depends upon the IndexingOutputConfig being an EndecaIndexingOutputConfig and creating a RecordStoreDocumentSubmitterSession. Selects a CAS record store using an RecordStoreAggregateSessionImpl instance, so may send to multiple record stores (based on current locale) in a single session.

Created: November 04 2011

See Also:
EndecaIndexingOutputConfig

Field Summary
static java.lang.String CLASS_VERSION
          Class version string from source code control system.
 
Fields inherited from interface atg.repository.search.indexing.DocumentSubmitter
INDEXING_MODE_FULL, INDEXING_MODE_INCREMENTAL
 
Constructor Summary
RecordStoreDocumentSubmitter()
           
 
Method Summary
protected  AbstractRecordStoreAggregateSession createSession(java.lang.String pIndexingMode)
          Create an instance of RecordStoreAggregateSessionImpl.
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 java.lang.String getCASHostName()
          Returns property CASHostName.
 int getCASPort()
          Returns property CASPort.
 java.lang.String getDefaultRecordStoreName()
          The "default" record store name.
 java.lang.String getEndecaBaseApplicationName()
          Returns property endecaBaseApplicationName.
 java.lang.String getEndecaDataStoreType()
          Returns property endecaDataStoreType.
 java.lang.String getIdPropertyName()
          Returns property idPropertyName.
protected  java.lang.String getLanguageNameForLocale(java.util.Locale pLocale)
          Returns the language code of given locale
 java.io.File getPersistVariantSuffixesDir()
          Returns property persistVariantSuffixesDir.
 java.lang.String getRecordStoreName(java.util.Locale pLocale)
          Build up the record store name from endecaBaseApplicationName + "_" + the language of the passed in locale + endecaDataStoreType.
 java.lang.String getRecordStoreNameFormatString()
          Returns property recordStoreNameFormatString.
protected  void initSession(AbstractRecordStoreAggregateSession pSession, java.lang.String pIndexingMode)
          Initialize our session created by createSession().
 boolean isEnabled()
          Returns property enabled.
 boolean isFlushAfterEveryRecord()
          Returns property flushAfterEveryRecord.
 boolean isPersistVariantsPerRepositoryId()
          Returns property persistVariantsPerRepositoryId.
 boolean isResetActive()
           
 void setCASHostName(java.lang.String pCASHostName)
          Sets property CASHostName.
 void setCASPort(int pCASPort)
          Sets property CASPort.
 void setEnabled(boolean pEnabled)
          Sets property enabled.
 void setEndecaBaseApplicationName(java.lang.String pEndecaBaseApplicationName)
          Sets property endecaBaseApplicationName.
 void setEndecaDataStoreType(java.lang.String pEndecaDataStoreType)
          Sets property endecaDataStoreType.
 void setFlushAfterEveryRecord(boolean pFlushAfterEveryRecord)
          Sets property flushAfterEveryRecord.
 void setIdPropertyName(java.lang.String pIdPropertyName)
          Sets property idPropertyName.
 void setPersistVariantsPerRepositoryId(boolean pPersistVariantsPerRepositoryId)
          Sets property persistVariantsPerRepositoryId.
 void setPersistVariantSuffixesDir(java.io.File pPersistVariantSuffixesDir)
          Sets property persistVariantSuffixesDir.
 void setRecordStoreNameFormatString(java.lang.String pRecordStoreNameFormatString)
          Sets property recordStoreNameFormatString.
 void setResetActive(boolean pResetActive)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface atg.repository.search.indexing.DocumentSubmitter
beginSession, cancelSession, endSession
 

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

RecordStoreDocumentSubmitter

public RecordStoreDocumentSubmitter()
Method Detail

setCASHostName

public void setCASHostName(java.lang.String pCASHostName)
Sets property CASHostName. The hostname of the CAS service.


getCASHostName

public java.lang.String getCASHostName()
Returns property CASHostName. The hostname of the CAS service.


setCASPort

public void setCASPort(int pCASPort)
Sets property CASPort. The port number of the CAS service.


getCASPort

public int getCASPort()
Returns property CASPort. The port number of the CAS service.


setEndecaBaseApplicationName

public void setEndecaBaseApplicationName(java.lang.String pEndecaBaseApplicationName)
Sets property endecaBaseApplicationName. The base name of the Endeca project. This forms the first part of the CAS data store name.


getEndecaBaseApplicationName

public java.lang.String getEndecaBaseApplicationName()
Returns property endecaBaseApplicationName. The base name of the Endeca project. This forms the first part of the CAS data store name.


setEndecaDataStoreType

public void setEndecaDataStoreType(java.lang.String pEndecaDataStoreType)
Sets property endecaDataStoreType. The type of the endeca data store. This is typically one of "schema", "data", or "dimvals".


getEndecaDataStoreType

public java.lang.String getEndecaDataStoreType()
Returns property endecaDataStoreType. The type of the endeca data store. This is typically one of "schema", "data", or "dimvals".


setIdPropertyName

public void setIdPropertyName(java.lang.String pIdPropertyName)
Sets property idPropertyName. The name each record's ID property.


getIdPropertyName

public java.lang.String getIdPropertyName()
Returns property idPropertyName. The name of each records ID property.


setFlushAfterEveryRecord

public void setFlushAfterEveryRecord(boolean pFlushAfterEveryRecord)
Sets property flushAfterEveryRecord. Whether to flush after every record. This is much slower, but can be useful for debugging.


isFlushAfterEveryRecord

public boolean isFlushAfterEveryRecord()
Returns property flushAfterEveryRecord. Whether to flush after every record. This is much slower, but can be useful for debugging.


isResetActive

public boolean isResetActive()

setResetActive

public void setResetActive(boolean pResetActive)

getLanguageNameForLocale

protected java.lang.String getLanguageNameForLocale(java.util.Locale pLocale)
Returns the language code of given locale

Parameters:
pLocale - - locale

getRecordStoreName

public java.lang.String getRecordStoreName(java.util.Locale pLocale)
Build up the record store name from endecaBaseApplicationName + "_" + the language of the passed in locale + endecaDataStoreType.

Parameters:
pLocale - the locale to use for the language name. If null, the property defaultLocale will be used instead.

getDefaultRecordStoreName

public java.lang.String getDefaultRecordStoreName()
The "default" record store name.


setEnabled

public void setEnabled(boolean pEnabled)
Sets property enabled. Whether this document submitter is enabled. If false, does everything except create a record store connection and write records.


isEnabled

public boolean isEnabled()
Returns property enabled. Whether this document submitter is enabled. If false, does everything except create a record store connection and write records.


setPersistVariantSuffixesDir

public void setPersistVariantSuffixesDir(java.io.File pPersistVariantSuffixesDir)
Sets property persistVariantSuffixesDir. The file to which variant suffixes should be saved at the end of a session.


getPersistVariantSuffixesDir

public java.io.File getPersistVariantSuffixesDir()
Returns property persistVariantSuffixesDir. The file to which variant suffixes should be saved at the end of a session.


setPersistVariantsPerRepositoryId

public void setPersistVariantsPerRepositoryId(boolean pPersistVariantsPerRepositoryId)
Sets property persistVariantsPerRepositoryId. Whether to persist variants an a per-repository ID basis. Should only be set to true if persisting a relatively small number of items (not for products/skus, for example).


isPersistVariantsPerRepositoryId

public boolean isPersistVariantsPerRepositoryId()
Returns property persistVariantsPerRepositoryId. Whether to persist variants an a per-repository ID basis. Should only be set to true if persisting a relatively small number of items (not for products/skus, for example).


setRecordStoreNameFormatString

public void setRecordStoreNameFormatString(java.lang.String pRecordStoreNameFormatString)
Sets property recordStoreNameFormatString. The record store name format string. When format is called, argument 0 is the project name, argument 1 is the language name, argument 2 is the datastore type.


getRecordStoreNameFormatString

public java.lang.String getRecordStoreNameFormatString()
Returns property recordStoreNameFormatString. The record store name format string. Argument 0 is the project name, argument 1 is the language name, argument 3 is the datastore type.


doStartService

public void doStartService()
                    throws ServiceException
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.

Throws:
ServiceException - if the Service had a problem starting up hidden: true

createSession

protected AbstractRecordStoreAggregateSession createSession(java.lang.String pIndexingMode)
                                                     throws atg.repository.search.indexing.IndexingException
Create an instance of RecordStoreAggregateSessionImpl.

Parameters:
pIndexingMode - the indexing mode to use for the session
Throws:
atg.repository.search.indexing.IndexingException

initSession

protected void initSession(AbstractRecordStoreAggregateSession pSession,
                           java.lang.String pIndexingMode)
Initialize our session created by createSession().