Package fr.gouv.vitam.logbook.common.server.database.collections

# 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 final 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(String clusterName, List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `createIndexesAndAliases()`
  `void`
  `deleteIndexByAliasForTesting(LogbookCollections collection, int tenantId)`
  `<T> void`
  `indexEntry(LogbookCollections collection, Integer tenantId, String id, VitamDocument<T> vitamDocument)`
  `void`
  `purgeIndexForTesting(LogbookCollections collection, Integer tenantId)`
  `void`
  `refreshIndex(LogbookCollections collection, int tenantId)`
  `final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode>`
  `search(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit)`
  Search entries in the ElasticSearch index.
  `final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode>`
  `searchCrossIndices(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MAPPING_LOGBOOK_OPERATION_FILE

    public static final String MAPPING_LOGBOOK_OPERATION_FILE
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### LogbookElasticsearchAccess

    public LogbookElasticsearchAccess(String clusterName, List<ElasticsearchNode> nodes, ElasticsearchLogbookIndexManager indexManager) throws VitamException
    Parameters:
      `clusterName` - cluster name
      `nodes` - elasticsearch node
      `indexManager` -
    Throws:
      `VitamException` - if elasticsearch nodes list is empty/null

- ## Method Details

  - ### createIndexesAndAliases

    public void createIndexesAndAliases()

  - ### search

    public final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode> search(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> sorts, int offset, int limit) throws LogbookException
    Search entries in the ElasticSearch index.
    Parameters:
      `collection` - collection of index
      `tenantId` - tenant Id
      `query` - as in DSL mode "{ "fieldname" : "value" }" "{ "match" : { "fieldname" : "value" } }" "{ "ids" : { " values" : [list of id] } }"
      `sorts` - the list of sort
      `offset` - the offset
      `limit` - the limit
    Returns:
      a structure as SearchResponse
    Throws:
      `LogbookException` - thrown of an error occurred while executing the request

  - ### searchCrossIndices

    public final co.elastic.clients.elasticsearch.core.search.ResponseBody<com.fasterxml.jackson.databind.node.ObjectNode> searchCrossIndices(LogbookCollections collection, Integer tenantId, co.elastic.clients.elasticsearch._types.query_dsl.Query query, List<co.elastic.clients.elasticsearch._types.SortOptions> 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, Integer tenantId, 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, Integer tenantId) throws LogbookExecutionException
    Throws:
      `LogbookExecutionException`