Class DefaultMerchCatalogListener
java.lang.Object
com.hybris.merchandising.indexer.listeners.DefaultMerchCatalogListener
- All Implemented Interfaces:
IndexerBatchListener,IndexerListener
public class DefaultMerchCatalogListener
extends Object
implements IndexerBatchListener, IndexerListener
DefaultMerchCatalogListener is a listener which listens to Solr indexing and handles synchronising
MerchProductDirectoryConfigModel definitions to CDS.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final com.google.common.cache.LoadingCache<String,DefaultMerchCatalogListener.MerchSyncInfo> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterBatch(IndexerBatchContext indexerBatchContext) Handles a notification that the processing for a particularIndexerBatchContexthas just been completed.voidafterBatchError(IndexerBatchContext indexerBatchContext) Handles a notification that the processing for a particularIndexerBatchContextfailed.protected voidafterBatchInternal(IndexerBatchContext indexerBatchContext) voidafterIndex(IndexerContext indexerContext) Handles a notification that the indexing for a particularIndexerContexthas just been completed.voidafterIndexError(IndexerContext indexerContext) Handles a notification that the indexing for a particularIndexerContextfailed.protected voidafterIndexErrorInternal(IndexerContext indexerContext) protected voidafterIndexInternal(IndexerContext indexerContext) voidbeforeBatch(IndexerBatchContext indexerBatchContext) Handles a notification that the processing for a particularIndexerBatchContextis about to begin.voidbeforeIndex(IndexerContext context) Handles a notification that the indexing for a particularIndexerContextis about to begin.protected voidbeforeIndexInternal(IndexerContext context) protected voidprotected voidcompleteSyncProcess(IndexerContext context) protected voidcreateMerchSync(MerchProductDirectoryConfigModel config, IndexerContext context) protected voidexecuteWithExceptionHandling(String operationId, String step, DefaultMerchCatalogListener.Method method) protected MerchSyncServiceprotected LonggetNumberOfProducts(String operationId) protected StringgetOperationId(IndexerContext indexerContext) protected Optional<MerchProductDirectoryConfigModel>getProductDirectoryConfig(String indexedTypeId) protected booleanisMerchSyncFailed(String indexOperationId) protected voidsaveBatchInfo(IndexerBatchContext indexerBatchContext, int productNumber) protected voidsaveErrorInfo(String operationId, String step, Exception e) voidsetBaseSiteService(BaseSiteService baseSiteService) protected voidsetLogContextOperationId(String operationId) voidsetMerchCatalogService(MerchCatalogService merchCatalogService) voidsetMerchCatalogServiceProductDirectoryClient(MerchCatalogServiceProductDirectoryClient merchCatalogServiceProductDirectoryClient) voidsetMerchCategoryExporter(MerchCategoryExporter merchCategoryExporter) voidsetMerchProductDirectoryConfigService(MerchProductDirectoryConfigService merchProductDirectoryConfigService) voidsetMerchSyncService(MerchSyncService merchSyncService) voidsetProductDirectoryProcessor(ProductDirectoryProcessor productDirectoryProcessor)
-
Field Details
-
CATALOG_VERSION
- See Also:
-
merchSyncInfoCache
protected static final com.google.common.cache.LoadingCache<String,DefaultMerchCatalogListener.MerchSyncInfo> merchSyncInfoCache
-
-
Constructor Details
-
DefaultMerchCatalogListener
public DefaultMerchCatalogListener()
-
-
Method Details
-
beforeBatch
Handles a notification that the processing for a particularIndexerBatchContextis about to begin.- Specified by:
beforeBatchin interfaceIndexerBatchListener- Parameters:
indexerBatchContext- - theIndexerBatchContext
-
afterBatch
Handles a notification that the processing for a particularIndexerBatchContexthas just been completed.- Specified by:
afterBatchin interfaceIndexerBatchListener- Parameters:
indexerBatchContext- - theIndexerBatchContext
-
afterBatchInternal
- Throws:
IndexerException
-
afterBatchError
Handles a notification that the processing for a particularIndexerBatchContextfailed.- Specified by:
afterBatchErrorin interfaceIndexerBatchListener- Parameters:
indexerBatchContext- - theIndexerBatchContext
-
afterIndex
Handles a notification that the indexing for a particularIndexerContexthas just been completed.- Specified by:
afterIndexin interfaceIndexerListener- Parameters:
indexerContext- - theIndexerContext
-
afterIndexInternal
-
beforeIndex
Description copied from interface:IndexerListenerHandles a notification that the indexing for a particularIndexerContextis about to begin.- Specified by:
beforeIndexin interfaceIndexerListener- Parameters:
context- - theIndexerContext
-
beforeIndexInternal
-
afterIndexError
Handles a notification that the indexing for a particularIndexerContextfailed.- Specified by:
afterIndexErrorin interfaceIndexerListener- Parameters:
indexerContext- - theIndexerContext
-
afterIndexErrorInternal
-
getOperationId
-
getProductDirectoryConfig
protected Optional<MerchProductDirectoryConfigModel> getProductDirectoryConfig(String indexedTypeId) -
executeWithExceptionHandling
protected void executeWithExceptionHandling(String operationId, String step, DefaultMerchCatalogListener.Method method) -
createMerchSync
-
isMerchSyncFailed
-
completeSyncProcess
-
saveBatchInfo
-
getNumberOfProducts
-
saveErrorInfo
-
setLogContextOperationId
-
cleanLogContextOperationId
protected void cleanLogContextOperationId() -
setMerchProductDirectoryConfigService
public void setMerchProductDirectoryConfigService(MerchProductDirectoryConfigService merchProductDirectoryConfigService) -
setMerchCatalogService
-
setMerchCatalogServiceProductDirectoryClient
public void setMerchCatalogServiceProductDirectoryClient(MerchCatalogServiceProductDirectoryClient merchCatalogServiceProductDirectoryClient) -
setMerchCategoryExporter
-
setBaseSiteService
-
setProductDirectoryProcessor
-
getMerchSyncService
-
setMerchSyncService
-