public class DefaultIndexerContextFactory extends java.lang.Object implements IndexerContextFactory<DefaultIndexerContext>
IndexerContextFactory. It uses a thread local variable for storing the context.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXTENDED_LISTENERS_KEY |
static java.lang.String |
LISTENERS_KEY |
| Constructor and Description |
|---|
DefaultIndexerContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
DefaultIndexerContext |
createContext(long indexOperationId,
IndexOperation indexOperation,
boolean externalIndexOperation,
FacetSearchConfig facetSearchConfig,
IndexedType indexedType,
java.util.Collection<IndexedProperty> indexedProperties)
Creates a new indexer context and sets it as the current one.
|
protected void |
createLocalSessionContext() |
void |
destroyContext()
Destroys the current context.
|
void |
destroyContext(java.lang.Exception failureException)
Destroys the current context because an exception occurred.
|
protected void |
executeAfterIndexErrorListeners(DefaultIndexerContext context) |
protected void |
executeAfterIndexListeners(DefaultIndexerContext context) |
protected void |
executeAfterPrepareListeners(DefaultIndexerContext context) |
protected void |
executeBeforeIndexListeners(DefaultIndexerContext context) |
DefaultIndexerContext |
getContext()
Returns the current context.
|
protected java.util.List<ExtendedIndexerListener> |
getExtendedListeners(DefaultIndexerContext context) |
protected java.util.List<IndexerListener> |
getListeners(DefaultIndexerContext context) |
ListenersFactory |
getListenersFactory() |
SessionService |
getSessionService() |
void |
initializeContext()
Initializes the current context and executes the before index listeners (see
IndexerListener.beforeIndex(IndexerContext)). |
void |
prepareContext()
Prepares the context and executes the after prepare context listeners (see
ExtendedIndexerListener.afterPrepareContext(IndexerContext)). |
protected void |
removeLocalSessionContext() |
void |
setListenersFactory(ListenersFactory listenersFactory) |
void |
setSessionService(SessionService sessionService) |
public static final java.lang.String LISTENERS_KEY
public static final java.lang.String EXTENDED_LISTENERS_KEY
public SessionService getSessionService()
public void setSessionService(SessionService sessionService)
public ListenersFactory getListenersFactory()
public void setListenersFactory(ListenersFactory listenersFactory)
public DefaultIndexerContext createContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, java.util.Collection<IndexedProperty> indexedProperties)
IndexerContextFactorycreateContext in interface IndexerContextFactory<DefaultIndexerContext>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 indexpublic void prepareContext()
throws IndexerException
IndexerContextFactoryExtendedIndexerListener.afterPrepareContext(IndexerContext)).prepareContext in interface IndexerContextFactory<DefaultIndexerContext>IndexerException - if an error occurs during the listeners executionpublic void initializeContext()
throws IndexerException
IndexerContextFactoryIndexerListener.beforeIndex(IndexerContext)).initializeContext in interface IndexerContextFactory<DefaultIndexerContext>IndexerException - if an error occurs during the listeners executionpublic DefaultIndexerContext getContext()
IndexerContextFactorygetContext in interface IndexerContextFactory<DefaultIndexerContext>public void destroyContext()
throws IndexerException
IndexerContextFactoryIndexerListener.afterIndex(IndexerContext)).destroyContext in interface IndexerContextFactory<DefaultIndexerContext>IndexerException - if an error occurs during the listeners executionpublic void destroyContext(java.lang.Exception failureException)
IndexerContextFactoryIndexerListener.afterIndexError(IndexerContext)).destroyContext in interface IndexerContextFactory<DefaultIndexerContext>protected void executeAfterPrepareListeners(DefaultIndexerContext context) throws IndexerException
IndexerExceptionprotected void executeBeforeIndexListeners(DefaultIndexerContext context) throws IndexerException
IndexerExceptionprotected void executeAfterIndexListeners(DefaultIndexerContext context) throws IndexerException
IndexerExceptionprotected void executeAfterIndexErrorListeners(DefaultIndexerContext context)
protected java.util.List<ExtendedIndexerListener> getExtendedListeners(DefaultIndexerContext context)
protected java.util.List<IndexerListener> getListeners(DefaultIndexerContext context)
protected void createLocalSessionContext()
protected void removeLocalSessionContext()
Copyright © 2018 SAP SE. All Rights Reserved.