Class LogbookElasticsearchAccess
- java.lang.Object
-
- fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
-
- fr.gouv.vitam.logbook.common.server.database.collections.LogbookElasticsearchAccess
-
- All Implemented Interfaces:
DatabaseConnection
public class LogbookElasticsearchAccess extends ElasticsearchAccess
ElasticSearch model with MongoDB as main database with management of index and index entries
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAPPING_LOGBOOK_OPERATION_FILE
-
Fields inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
clusterName, DEFAULT_LIMIT_SCROLL, DEFAULT_SCROLL_TIMEOUT, nodes, SCROLL_ACTIVATE_KEYWORD
-
-
Constructor Summary
Constructors Constructor Description LogbookElasticsearchAccess(java.lang.String clusterName, java.util.List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createIndexesAndAliases()
void
deleteIndexByAliasForTesting(LogbookCollections collection, int tenantId)
<T> void
indexEntry(LogbookCollections collection, java.lang.Integer tenantId, java.lang.String id, VitamDocument<T> vitamDocument)
void
purgeIndexForTesting(LogbookCollections collection, java.lang.Integer tenantId)
void
refreshIndex(LogbookCollections collection, int tenantId)
org.elasticsearch.action.search.SearchResponse
search(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder<?>> sorts, int offset, int limit)
Search entries in the ElasticSearch index.org.elasticsearch.action.search.SearchResponse
searchCrossIndices(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder<?>> sorts, int offset, int limit)
-
Methods inherited from class fr.gouv.vitam.common.database.server.elasticsearch.ElasticsearchAccess
checkConnection, clearScroll, close, createIndexAndAliasIfAliasNotExists, createIndexWithoutAlias, delete, deleteIndexByAliasForTesting, deleteIndexForTesting, existsAlias, existsIndex, getAlias, getClient, getClusterName, getInfo, getNodes, indexEntries, indexEntry, purgeIndexForTesting, purgeIndexForTesting, refreshIndex, search, search, searchCrossIndices, switchIndex, updateEntry
-
-
-
-
Field Detail
-
MAPPING_LOGBOOK_OPERATION_FILE
public static final java.lang.String MAPPING_LOGBOOK_OPERATION_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogbookElasticsearchAccess
public LogbookElasticsearchAccess(java.lang.String clusterName, java.util.List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager) throws VitamException
- Parameters:
clusterName
- cluster namenodes
- elasticsearch nodeindexManager
-- Throws:
VitamException
- if elasticsearch nodes list is empty/null
-
-
Method Detail
-
createIndexesAndAliases
public void createIndexesAndAliases()
-
search
public final org.elasticsearch.action.search.SearchResponse search(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder<?>> sorts, int offset, int limit) throws LogbookException
Search entries in the ElasticSearch index.- Parameters:
collection
- collection of indextenantId
- tenant Idquery
- as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { " values" : [list of id] } }"filter
- the filtersorts
- the list of sortoffset
- the offsetlimit
- the limit- Returns:
- a structure as SearchResponse
- Throws:
LogbookException
- thrown of an error occurred while executing the request
-
searchCrossIndices
public final org.elasticsearch.action.search.SearchResponse searchCrossIndices(LogbookCollections collection, java.lang.Integer tenantId, org.elasticsearch.index.query.QueryBuilder query, org.elasticsearch.index.query.QueryBuilder filter, java.util.List<org.elasticsearch.search.sort.SortBuilder<?>> sorts, int offset, int limit) throws LogbookException
- Throws:
LogbookException
-
deleteIndexByAliasForTesting
public void deleteIndexByAliasForTesting(LogbookCollections collection, int tenantId) throws LogbookExecutionException
- Throws:
LogbookExecutionException
-
indexEntry
public <T> void indexEntry(LogbookCollections collection, java.lang.Integer tenantId, java.lang.String id, VitamDocument<T> vitamDocument) throws LogbookExecutionException
- Throws:
LogbookExecutionException
-
refreshIndex
public void refreshIndex(LogbookCollections collection, int tenantId) throws LogbookExecutionException
- Throws:
LogbookExecutionException
-
purgeIndexForTesting
public void purgeIndexForTesting(LogbookCollections collection, java.lang.Integer tenantId) throws LogbookExecutionException
- Throws:
LogbookExecutionException
-
-