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
 
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()
          Return the hostname of our CAS service.
 int getCASPort()
          Return out CAS port.
 java.lang.String getDefaultLanguageForRecordStores()
           
 java.util.Locale getDefaultLocale()
           
 java.lang.String getDefaultRecordStoreName()
          The "default" record store name.
 java.lang.String getEndecaDataStoreType()
          Returns property endecaDataStoreType.
 java.util.Map<java.lang.String,java.lang.String> getEveryRecordPropertyValues()
          Returns property everyRecordPropertyValues.
 java.lang.String getIdPropertyName()
          Returns property idPropertyName.
 IndexingApplicationConfiguration getIndexingApplicationConfiguration()
          Returns property indexingApplicationConfiguration.
protected  java.lang.String getLanguageNameForLocale(java.util.Locale pLocale)
          Returns the language code of given locale
 java.io.File getPersistVariantSuffixesDir()
          Returns property persistVariantSuffixesDir.
 java.util.Map<java.lang.String,java.lang.String> getPropertyNameReplacementMap()
          Returns property propertyNameReplacementMap.
 java.lang.String getRecordStoreName(java.util.Locale pLocale, java.lang.Object pObject)
          Build up the record store name from endecaBaseApplicationName + "_" + the language of the passed in locale + endecaDataStoreType.
protected  void initSession(AbstractRecordStoreAggregateSession pSession, java.lang.String pIndexingMode)
           
 boolean isEnabled()
          Returns property enabled.
 boolean isFlushAfterEveryRecord()
          Returns property flushAfterEveryRecord.
 boolean isPersistVariantsPerRepositoryId()
          Returns property persistVariantsPerRepositoryId.
 boolean isResetActive()
           
 boolean isSynchronizeAroundGetService()
          Returns property synchronizeAroundGetService.
 void setDefaultLanguageForRecordStores(java.lang.String pDefaultLanguageForRecordStores)
           
 void setDefaultLocale(java.util.Locale pDefaultLocale)
           
 void setEnabled(boolean pEnabled)
          Sets property enabled.
 void setEndecaDataStoreType(java.lang.String pEndecaDataStoreType)
          Sets property endecaDataStoreType.
 void setEveryRecordPropertyValues(java.util.Map<java.lang.String,java.lang.String> pEveryRecordPropertyValues)
          Sets property everyRecordPropertyValues.
 void setFlushAfterEveryRecord(boolean pFlushAfterEveryRecord)
          Sets property flushAfterEveryRecord.
 void setIdPropertyName(java.lang.String pIdPropertyName)
          Sets property idPropertyName.
 void setIndexingApplicationConfiguration(IndexingApplicationConfiguration pIndexingApplicationConfiguration)
          Sets property indexingApplicationConfiguration.
 void setPersistVariantsPerRepositoryId(boolean pPersistVariantsPerRepositoryId)
          Sets property persistVariantsPerRepositoryId.
 void setPersistVariantSuffixesDir(java.io.File pPersistVariantSuffixesDir)
          Sets property persistVariantSuffixesDir.
 void setPropertyNameReplacementMap(java.util.Map<java.lang.String,java.lang.String> pPropertyNameReplacementMap)
          Sets property propertyNameReplacementMap.
 void setResetActive(boolean pResetActive)
           
 void setSynchronizeAroundGetService(boolean pSynchronizeAroundGetService)
          Sets property synchronizeAroundGetService.
 
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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RecordStoreDocumentSubmitter

public RecordStoreDocumentSubmitter()
Method Detail

getCASHostName

public java.lang.String getCASHostName()
Return the hostname of our CAS service.


getCASPort

public int getCASPort()
Return out CAS port.


setDefaultLocale

public void setDefaultLocale(java.util.Locale pDefaultLocale)

getDefaultLocale

public java.util.Locale getDefaultLocale()

setDefaultLanguageForRecordStores

public void setDefaultLanguageForRecordStores(java.lang.String pDefaultLanguageForRecordStores)

getDefaultLanguageForRecordStores

public java.lang.String getDefaultLanguageForRecordStores()

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,
                                           java.lang.Object pObject)
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.


setSynchronizeAroundGetService

public void setSynchronizeAroundGetService(boolean pSynchronizeAroundGetService)
Sets property synchronizeAroundGetService. Whether to do a class synchronization around getService().


isSynchronizeAroundGetService

public boolean isSynchronizeAroundGetService()
Returns property synchronizeAroundGetService. Whether to do a class synchronization around getService().


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).


setIndexingApplicationConfiguration

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


getIndexingApplicationConfiguration

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


setPropertyNameReplacementMap

public void setPropertyNameReplacementMap(java.util.Map<java.lang.String,java.lang.String> pPropertyNameReplacementMap)
Sets property propertyNameReplacementMap. A map for translating property names.


getPropertyNameReplacementMap

public java.util.Map<java.lang.String,java.lang.String> getPropertyNameReplacementMap()
Returns property propertyNameReplacementMap. A map for translating property names.


setEveryRecordPropertyValues

public void setEveryRecordPropertyValues(java.util.Map<java.lang.String,java.lang.String> pEveryRecordPropertyValues)
Sets property everyRecordPropertyValues. Property values that should be added to every record submitted.


getEveryRecordPropertyValues

public java.util.Map<java.lang.String,java.lang.String> getEveryRecordPropertyValues()
Returns property everyRecordPropertyValues. Property values that should be added to every record submitted.


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)