Class DefaultIndexerQueryContextFactory
java.lang.Object
de.hybris.platform.solrfacetsearch.indexer.impl.DefaultIndexerQueryContextFactory
- All Implemented Interfaces:
IndexerQueryContextFactory<DefaultIndexerQueryContext>
public class DefaultIndexerQueryContextFactory
extends Object
implements IndexerQueryContextFactory<DefaultIndexerQueryContext>
Default implementation of
IndexerQueryContextFactory. It uses a thread local variable for storing the
context.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String query, Map<String, Object> queryParameters) Creates a new indexer context and sets it as current.protected voidvoidDestroys the current context.voiddestroyContext(Exception failureException) Destroys the current context because an exception occurred.protected voidprotected voidprotected voidReturns the current context.protected List<IndexerQueryListener>getListeners(DefaultIndexerQueryContext context) voidInitializes the current context and executes the before index listeners (seeIndexerListener.beforeIndex(IndexerContext)).protected voidvoidsetListenersFactory(ListenersFactory listenersFactory) voidsetSessionService(SessionService sessionService)
-
Field Details
-
INDEXER_QUERY_LISTENERS_KEY
- See Also:
-
-
Constructor Details
-
DefaultIndexerQueryContextFactory
public DefaultIndexerQueryContextFactory()
-
-
Method Details
-
getSessionService
-
setSessionService
-
getListenersFactory
-
setListenersFactory
-
createContext
public DefaultIndexerQueryContext createContext(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String query, Map<String, Object> queryParameters) throws IndexerExceptionDescription copied from interface:IndexerQueryContextFactoryCreates a new indexer context and sets it as current.- Specified by:
createContextin interfaceIndexerQueryContextFactory<DefaultIndexerQueryContext>- Parameters:
facetSearchConfig- - the facet search configurationindexedType- - the indexed typequery- - the queryqueryParameters- - the query parameters- Returns:
- the new context
- Throws:
IndexerException- if an error occurs during the listeners execution
-
initializeContext
Description copied from interface:IndexerQueryContextFactoryInitializes the current context and executes the before index listeners (seeIndexerListener.beforeIndex(IndexerContext)).- Specified by:
initializeContextin interfaceIndexerQueryContextFactory<DefaultIndexerQueryContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
getContext
Description copied from interface:IndexerQueryContextFactoryReturns the current context.- Specified by:
getContextin interfaceIndexerQueryContextFactory<DefaultIndexerQueryContext>- Returns:
- the current context
-
destroyContext
Description copied from interface:IndexerQueryContextFactoryDestroys the current context. Before destroying an active context it executes the after query listeners (seeIndexerQueryListener.afterQuery(IndexerQueryContext)).- Specified by:
destroyContextin interfaceIndexerQueryContextFactory<DefaultIndexerQueryContext>- Throws:
IndexerException- if an error occurs during the listeners execution
-
destroyContext
Description copied from interface:IndexerQueryContextFactoryDestroys the current context because an exception occurred. Before destroying an active context it executes the after query error listeners (seeIndexerQueryListener.afterQueryError(IndexerQueryContext)).- Specified by:
destroyContextin interfaceIndexerQueryContextFactory<DefaultIndexerQueryContext>
-
executeBeforeQueryListeners
protected void executeBeforeQueryListeners(DefaultIndexerQueryContext context) throws IndexerException - Throws:
IndexerException
-
executeAfterQueryListeners
protected void executeAfterQueryListeners(DefaultIndexerQueryContext context) throws IndexerException - Throws:
IndexerException
-
executeAfterQueryErrorListeners
-
getListeners
-
createLocalSessionContext
protected void createLocalSessionContext() -
removeLocalSessionContext
protected void removeLocalSessionContext()
-