Class DefaultIndexerContextFactory
java.lang.Object
de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerContextFactory
- All Implemented Interfaces:
IndexerContextFactory<DefaultIndexerContext>
public class DefaultIndexerContextFactory
extends Object
implements IndexerContextFactory<DefaultIndexerContext>
Default implementation of
IndexerContextFactory. It uses a thread local variable for storing the context.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, Collection<IndexedProperty> indexedProperties) Creates a new indexer context and sets it as the current one.protected voidvoidDestroys the current context.voiddestroyContext(Exception failureException) Destroys the current context because an exception occurred.protected voidprotected voidprotected voidprotected voidReturns the current context.protected List<ExtendedIndexerListener>protected List<IndexerListener>getListeners(DefaultIndexerContext context) voidInitializes the current context and executes the before index listeners (seeIndexerListener.beforeIndex(IndexerContext)).voidPrepares the context and executes the after prepare context listeners (seeExtendedIndexerListener.afterPrepareContext(IndexerContext)).protected voidvoidsetListenersFactory(ListenersFactory listenersFactory) voidsetSessionService(SessionService sessionService)
-
Field Details
-
LISTENERS_KEY
- See Also:
-
EXTENDED_LISTENERS_KEY
- See Also:
-
-
Constructor Details
-
DefaultIndexerContextFactory
public DefaultIndexerContextFactory()
-
-
Method Details
-
getSessionService
-
setSessionService
-
getListenersFactory
-
setListenersFactory
-
createContext
public DefaultIndexerContext createContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, Collection<IndexedProperty> indexedProperties) Description copied from interface:IndexerContextFactoryCreates a new indexer context and sets it as the current one.- Specified by:
createContextin interfaceIndexerContextFactory<DefaultIndexerContext>- Parameters:
indexOperationId- - the index operation idindexOperation- - the index operationexternalIndexOperation- - indicates if the index operation is externalfacetSearchConfig- - the facet search configurationindexedType- - the indexed typeindexedProperties- - the properties to index- Returns:
- the new context
-
prepareContext
Description copied from interface:IndexerContextFactoryPrepares the context and executes the after prepare context listeners (seeExtendedIndexerListener.afterPrepareContext(IndexerContext)).- Specified by:
prepareContextin interfaceIndexerContextFactory<DefaultIndexerContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
initializeContext
Description copied from interface:IndexerContextFactoryInitializes the current context and executes the before index listeners (seeIndexerListener.beforeIndex(IndexerContext)).- Specified by:
initializeContextin interfaceIndexerContextFactory<DefaultIndexerContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
getContext
Description copied from interface:IndexerContextFactoryReturns the current context.- Specified by:
getContextin interfaceIndexerContextFactory<DefaultIndexerContext>- Returns:
- the current context
-
destroyContext
Description copied from interface:IndexerContextFactoryDestroys the current context. Before destroying an active context it executes the after index listeners (seeIndexerListener.afterIndex(IndexerContext)).- Specified by:
destroyContextin interfaceIndexerContextFactory<DefaultIndexerContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
destroyContext
Description copied from interface:IndexerContextFactoryDestroys the current context because an exception occurred. Before destroying an active context it executes the after index error listeners (seeIndexerListener.afterIndexError(IndexerContext)).- Specified by:
destroyContextin interfaceIndexerContextFactory<DefaultIndexerContext>
-
executeAfterPrepareListeners
- Throws:
IndexerException
-
executeBeforeIndexListeners
- Throws:
IndexerException
-
executeAfterIndexListeners
- Throws:
IndexerException
-
executeAfterIndexErrorListeners
-
getExtendedListeners
-
getListeners
-
createLocalSessionContext
protected void createLocalSessionContext() -
removeLocalSessionContext
protected void removeLocalSessionContext()
-