public class DefaultIndexerBatchContextFactory extends java.lang.Object implements IndexerBatchContextFactory<DefaultIndexerBatchContext>
IndexerBatchContextFactory. 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 |
|---|
DefaultIndexerBatchContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
DefaultIndexerBatchContext |
createContext(long indexOperationId,
IndexOperation indexOperation,
boolean externalIndexOperation,
FacetSearchConfig facetSearchConfig,
IndexedType indexedType,
java.util.Collection<IndexedProperty> indexedProperties)
Creates a new indexer batch context and sets it as 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 |
executeAfterBatchErrorListeners(DefaultIndexerBatchContext batchContext) |
protected void |
executeAfterBatchListeners(DefaultIndexerBatchContext batchContext) |
protected void |
executeAfterPrepareListeners(DefaultIndexerBatchContext context) |
protected void |
executeBeforeBatchListeners(DefaultIndexerBatchContext batchContext) |
DefaultIndexerBatchContext |
getContext()
Returns the current context.
|
protected java.util.List<ExtendedIndexerBatchListener> |
getExtendedListeners(DefaultIndexerBatchContext context) |
protected java.util.List<IndexerBatchListener> |
getListeners(DefaultIndexerBatchContext batchContext) |
ListenersFactory |
getListenersFactory() |
SessionService |
getSessionService() |
void |
initializeContext()
Initializes the current context and executes the before batch listeners (see
IndexerBatchListener.beforeBatch(IndexerBatchContext)). |
void |
prepareContext()
Prepares the context and executes the after prepare context listeners (see
ExtendedIndexerBatchListener.afterPrepareContext(IndexerBatchContext)). |
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 DefaultIndexerBatchContext createContext(long indexOperationId, IndexOperation indexOperation, boolean externalIndexOperation, FacetSearchConfig facetSearchConfig, IndexedType indexedType, java.util.Collection<IndexedProperty> indexedProperties)
IndexerBatchContextFactorycreateContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>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
IndexerBatchContextFactoryExtendedIndexerBatchListener.afterPrepareContext(IndexerBatchContext)).prepareContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>IndexerException - if an error occurs during the listeners executionpublic void initializeContext()
throws IndexerException
IndexerBatchContextFactoryIndexerBatchListener.beforeBatch(IndexerBatchContext)).initializeContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>IndexerException - if an error occurs during the listeners executionpublic DefaultIndexerBatchContext getContext()
IndexerBatchContextFactorygetContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>public void destroyContext()
throws IndexerException
IndexerBatchContextFactoryIndexerBatchListener.afterBatch(IndexerBatchContext)).destroyContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>IndexerException - if an error occurs during the listeners executionpublic void destroyContext(java.lang.Exception failureException)
IndexerBatchContextFactoryIndexerBatchListener.afterBatchError(IndexerBatchContext)).destroyContext in interface IndexerBatchContextFactory<DefaultIndexerBatchContext>protected void executeAfterPrepareListeners(DefaultIndexerBatchContext context) throws IndexerException
IndexerExceptionprotected void executeBeforeBatchListeners(DefaultIndexerBatchContext batchContext) throws IndexerException
IndexerExceptionprotected void executeAfterBatchListeners(DefaultIndexerBatchContext batchContext) throws IndexerException
IndexerExceptionprotected void executeAfterBatchErrorListeners(DefaultIndexerBatchContext batchContext)
protected java.util.List<ExtendedIndexerBatchListener> getExtendedListeners(DefaultIndexerBatchContext context)
protected java.util.List<IndexerBatchListener> getListeners(DefaultIndexerBatchContext batchContext)
protected void createLocalSessionContext()
protected void removeLocalSessionContext()
Copyright © 2018 SAP SE. All Rights Reserved.