Class DefaultMerchSnIndexerListener
java.lang.Object
com.hybris.merchandising.indexer.listeners.DefaultMerchSnIndexerListener
- All Implemented Interfaces:
SnIndexerBatchListener,SnIndexerListener
public class DefaultMerchSnIndexerListener
extends Object
implements SnIndexerBatchListener, SnIndexerListener
Listener which listens to search service indexing and handles synchronising products to catalog service (CDS/ISS).
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final com.google.common.cache.Cache<String,MerchSnSynchContext> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterBatchInternal(SnIndexerBatchContext indexerBatchContext) voidafterIndex(SnIndexerContext indexerContext) Handles a notification that the indexer operation has just completed.voidafterIndexBatch(SnIndexerBatchContext indexerBatchContext) Handles a notification that the indexer batch operation has just completed.voidafterIndexBatchError(SnIndexerBatchContext indexerBatchContext) Handles a notification that the indexer batch operation failed (this may also be due to listeners failing).voidafterIndexError(SnIndexerContext indexerContext) Handles a notification that the indexer operation failed (this may also be due to listeners failing).protected voidafterIndexErrorInternal(SnIndexerContext indexerContext) protected voidafterIndexInternal(SnIndexerContext indexerContext) voidbeforeIndex(SnIndexerContext indexerContext) Handles a notification that the indexer operation is about to begin execution.voidbeforeIndexBatch(SnIndexerBatchContext indexerContext) Handles a notification that the indexer batch operation is about to begin execution.protected voidbeforeIndexInternal(SnIndexerContext indexerContext) protected voidprotected voidcompleteSyncProcess(SnIndexerContext indexerContext) protected Map<LanguageModel,Locale> protected MerchSnSynchContextcreateMerchContext(SnIndexerContext indexerContext) createMerchSnFieldsMapping(List<MerchSnFieldModel> merchSnFields) protected voidcreateMerchSync(MerchSnConfigModel config, SnIndexerContext context) protected voidexecuteWithExceptionHandling(String operationId, String step, DefaultMerchSnIndexerListener.Method method) protected CommonI18NServiceprotected Localeprotected ImpersonationServiceprotected MerchCatalogServiceprotected MerchSnSynchContextgetMerchContext(SnIndexerContext indexerContext) protected MerchSnConfigServiceprotected MerchSyncServiceprotected LonggetNumberOfProducts(String operationId) protected StringgetOperationId(SnIndexerContext indexerContext) protected Optional<MerchSnConfigModel>getProductDirectoryConfig(String indexedType) protected SnSearchServiceprotected voidhandleError(String operationId, String step, Exception e) protected voidinvalidateMerchContext(SnIndexerContext indexerContext) protected booleanisMerchSyncFailed(String operationId) protected voidsaveBatchInfo(MerchSnSynchContext merchContext, long productNumber) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetImpersonationService(ImpersonationService impersonationService) protected voidsetLogContextOperationId(String operationId) voidsetMerchCatalogService(MerchCatalogService merchCatalogService) voidsetMerchCatalogServiceProductDirectoryClient(MerchCatalogServiceProductDirectoryClient merchCatalogServiceProductDirectoryClient) protected voidsetMerchFacetMapping(MerchSnSynchContext merchContext, SnIndexerContext context, MerchSnConfigModel pdc) voidsetMerchSnConfigService(MerchSnConfigService merchSnConfigService) voidsetMerchSyncService(MerchSyncService merchSyncService) voidsetSnSearchService(SnSearchService snSearchService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.searchservices.indexer.service.SnIndexerBatchListener
afterIndexBatch, afterIndexBatchError, beforeIndexBatch
-
Field Details
-
LOG_CONTEXT_MERCH_OPERATION_ID
- See Also:
-
merchContextCache
-
-
Constructor Details
-
DefaultMerchSnIndexerListener
public DefaultMerchSnIndexerListener()
-
-
Method Details
-
beforeIndex
Description copied from interface:SnIndexerListenerHandles a notification that the indexer operation is about to begin execution.- Specified by:
beforeIndexin interfaceSnIndexerListener- Parameters:
indexerContext- - the indexer context
-
beforeIndexInternal
-
afterIndex
Description copied from interface:SnIndexerListenerHandles a notification that the indexer operation has just completed.- Specified by:
afterIndexin interfaceSnIndexerListener- Parameters:
indexerContext- - the indexer context
-
afterIndexInternal
-
afterIndexError
Description copied from interface:SnIndexerListenerHandles a notification that the indexer operation failed (this may also be due to listeners failing).- Specified by:
afterIndexErrorin interfaceSnIndexerListener- Parameters:
indexerContext- - the indexer context
-
afterIndexErrorInternal
-
beforeIndexBatch
Description copied from interface:SnIndexerBatchListenerHandles a notification that the indexer batch operation is about to begin execution.- Specified by:
beforeIndexBatchin interfaceSnIndexerBatchListener- Parameters:
indexerContext- - the indexer batch context
-
afterIndexBatch
Description copied from interface:SnIndexerBatchListenerHandles a notification that the indexer batch operation has just completed.- Specified by:
afterIndexBatchin interfaceSnIndexerBatchListener- Parameters:
indexerBatchContext- - the indexer batch context
-
afterBatchInternal
-
afterIndexBatchError
Description copied from interface:SnIndexerBatchListenerHandles a notification that the indexer batch operation failed (this may also be due to listeners failing).- Specified by:
afterIndexBatchErrorin interfaceSnIndexerBatchListener- Parameters:
indexerBatchContext- - the indexer context
-
getOperationId
-
getProductDirectoryConfig
-
getMerchContext
-
createMerchContext
-
invalidateMerchContext
-
createMerchSnFieldsMapping
-
getDefaultLocale
-
createLocaleMap
-
setMerchFacetMapping
protected void setMerchFacetMapping(MerchSnSynchContext merchContext, SnIndexerContext context, MerchSnConfigModel pdc) throws MerchSynchException - Throws:
MerchSynchException
-
createMerchSync
-
executeWithExceptionHandling
protected void executeWithExceptionHandling(String operationId, String step, DefaultMerchSnIndexerListener.Method method) -
handleError
-
isMerchSyncFailed
-
completeSyncProcess
-
saveBatchInfo
-
getNumberOfProducts
-
setLogContextOperationId
-
cleanLogContextOperationId
protected void cleanLogContextOperationId() -
getMerchSnConfigService
-
setMerchSnConfigService
-
getMerchCatalogService
-
setMerchCatalogService
-
getMerchCatalogServiceProductDirectoryClient
-
setMerchCatalogServiceProductDirectoryClient
public void setMerchCatalogServiceProductDirectoryClient(MerchCatalogServiceProductDirectoryClient merchCatalogServiceProductDirectoryClient) -
getMerchSyncService
-
setMerchSyncService
-
getImpersonationService
-
setImpersonationService
-
getSnSearchService
-
setSnSearchService
-
getCommonI18NService
-
setCommonI18NService
-