Package com.flowable.indexing.impl
Class IndexingServiceImpl
java.lang.Object
com.flowable.indexing.impl.IndexingServiceImpl
- All Implemented Interfaces:
IndexingService,LowLevelIndexingService
public class IndexingServiceImpl extends java.lang.Object implements IndexingService, LowLevelIndexingService
-
Field Summary
Fields Modifier and Type Field Description protected org.flowable.spring.job.service.SpringAsyncHistoryExecutorasyncHistoryExecutorprotected java.util.List<BulkIndexRequestInterceptor>bulkIndexRequestInterceptorsprotected ElasticsearchClientelasticsearchClientprotected booleanindexingEnabledprotected IndexManagerindexManagerprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected ObjectSerializationServiceobjectSerializationService -
Constructor Summary
Constructors Constructor Description IndexingServiceImpl(boolean indexingEnabled, ElasticsearchClient elasticsearchClient, ObjectSerializationService objectSerializationService, IndexManager indexManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.spring.job.service.SpringAsyncHistoryExecutor asyncHistoryExecutor, java.util.List<BulkIndexRequestInterceptor> bulkIndexRequestInterceptors) -
Method Summary
Modifier and Type Method Description voidaddToBulkIndexRequest(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)protected org.flowable.job.service.impl.persistence.entity.HistoryJobEntitycreateHistoryJobEntity(java.lang.String handlerType)voiddeleteByQuery(java.lang.String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query)Delete indexed objects based on a query.voiddeleteIndexedObject(java.lang.String aliasName, java.lang.String id)Delete the indexed object using the provided id.protected java.lang.StringdetermineIndex(com.fasterxml.jackson.databind.node.ObjectNode objectNode, IndexedDataObject indexedDataObject)protected java.lang.StringdetermineIndex(IndexMapping indexMapping)voidindexObject(java.lang.Object object, java.lang.String idFieldName)Similar toLowLevelIndexingService.indexObject(Object), but by providing an alternative field name that contains the id, instead of depending on theIndexingJsonConstants.PROPERTY_IDin the json.booleanisIndexingEnabled()voidscheduleIndexedObjectDelete(java.lang.String aliasName, java.lang.String id)Schedule a delete of an object from an index.voidscheduleIndexing(java.lang.Object object, java.lang.String tenantId)Schedule to index a generic object, that will pass theIndexableObjectSerializerfirst.voidscheduleIndexing(java.lang.String type, com.fasterxml.jackson.databind.node.ObjectNode dataNode, java.lang.String tenantId)Schedule the json directly to be indexed using the provided type.voidscheduleUpdateByQuery(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode updateByQueryBody)Schedule an update by query with an abitrary body.protected com.fasterxml.jackson.databind.node.ObjectNodeserializeObject(java.lang.Object object)protected java.util.List<IndexedDataObject>transformObjectToIndexedDataObjects(com.fasterxml.jackson.databind.node.ObjectNode objectNode, java.lang.String idFieldName)voidupdateByQuery(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data)Perform Update by Query for the given Mapping type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.flowable.indexing.api.LowLevelIndexingService
addToBulkIndexRequest, indexObject
-
Field Details
-
indexingEnabled
protected boolean indexingEnabled -
elasticsearchClient
-
objectSerializationService
-
indexManager
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
asyncHistoryExecutor
protected org.flowable.spring.job.service.SpringAsyncHistoryExecutor asyncHistoryExecutor -
bulkIndexRequestInterceptors
-
-
Constructor Details
-
IndexingServiceImpl
public IndexingServiceImpl(boolean indexingEnabled, ElasticsearchClient elasticsearchClient, ObjectSerializationService objectSerializationService, IndexManager indexManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.spring.job.service.SpringAsyncHistoryExecutor asyncHistoryExecutor, java.util.List<BulkIndexRequestInterceptor> bulkIndexRequestInterceptors)
-
-
Method Details
-
isIndexingEnabled
public boolean isIndexingEnabled()- Specified by:
isIndexingEnabledin interfaceIndexingService
-
indexObject
public void indexObject(java.lang.Object object, java.lang.String idFieldName)Description copied from interface:LowLevelIndexingServiceSimilar toLowLevelIndexingService.indexObject(Object), but by providing an alternative field name that contains the id, instead of depending on theIndexingJsonConstants.PROPERTY_IDin the json.- Specified by:
indexObjectin interfaceLowLevelIndexingService
-
transformObjectToIndexedDataObjects
protected java.util.List<IndexedDataObject> transformObjectToIndexedDataObjects(com.fasterxml.jackson.databind.node.ObjectNode objectNode, java.lang.String idFieldName) -
serializeObject
protected com.fasterxml.jackson.databind.node.ObjectNode serializeObject(java.lang.Object object) -
scheduleIndexing
public void scheduleIndexing(java.lang.Object object, java.lang.String tenantId)Description copied from interface:IndexingServiceSchedule to index a generic object, that will pass theIndexableObjectSerializerfirst.- Specified by:
scheduleIndexingin interfaceIndexingService
-
scheduleIndexing
public void scheduleIndexing(java.lang.String type, com.fasterxml.jackson.databind.node.ObjectNode dataNode, java.lang.String tenantId)Description copied from interface:IndexingServiceSchedule the json directly to be indexed using the provided type.- Specified by:
scheduleIndexingin interfaceIndexingService
-
deleteIndexedObject
public void deleteIndexedObject(java.lang.String aliasName, java.lang.String id)Description copied from interface:LowLevelIndexingServiceDelete the indexed object using the provided id.- Specified by:
deleteIndexedObjectin interfaceLowLevelIndexingService
-
deleteByQuery
public void deleteByQuery(java.lang.String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query)Description copied from interface:LowLevelIndexingServiceDelete indexed objects based on a query.- Specified by:
deleteByQueryin interfaceLowLevelIndexingService
-
scheduleUpdateByQuery
public void scheduleUpdateByQuery(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode updateByQueryBody)Description copied from interface:IndexingServiceSchedule an update by query with an abitrary body. The mappingType parameter is used to determine which indexes this will be applied to.- Specified by:
scheduleUpdateByQueryin interfaceIndexingService
-
updateByQuery
public void updateByQuery(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data)Description copied from interface:LowLevelIndexingServicePerform Update by Query for the given Mapping type.- Specified by:
updateByQueryin interfaceLowLevelIndexingService- Parameters:
mappingType- the type of the mapping for which the update should be donedata- the update by query request data
-
scheduleIndexedObjectDelete
public void scheduleIndexedObjectDelete(java.lang.String aliasName, java.lang.String id)Description copied from interface:IndexingServiceSchedule a delete of an object from an index.- Specified by:
scheduleIndexedObjectDeletein interfaceIndexingService
-
addToBulkIndexRequest
public void addToBulkIndexRequest(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)- Specified by:
addToBulkIndexRequestin interfaceLowLevelIndexingService
-
determineIndex
protected java.lang.String determineIndex(com.fasterxml.jackson.databind.node.ObjectNode objectNode, IndexedDataObject indexedDataObject) -
determineIndex
-
createHistoryJobEntity
protected org.flowable.job.service.impl.persistence.entity.HistoryJobEntity createHistoryJobEntity(java.lang.String handlerType)
-