Class VitamElasticsearchRepository
- java.lang.Object
-
- fr.gouv.vitam.common.database.api.impl.VitamElasticsearchRepository
-
public class VitamElasticsearchRepository extends java.lang.Object
Implementation for Elasticsearch
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ID
static java.lang.String
IDENTIFIER
Identifier
-
Constructor Summary
Constructors Constructor Description VitamElasticsearchRepository(org.elasticsearch.client.RestHighLevelClient client, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver)
VitamElasticsearchRepository Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(java.util.List<java.lang.String> ids, int tenant)
java.util.Optional<org.bson.Document>
findByIdentifier(java.lang.String identifier)
java.util.Optional<org.bson.Document>
findByIdentifierAndTenant(java.lang.String identifier, java.lang.Integer tenant)
java.util.Optional<org.bson.Document>
getByID(java.lang.String id, java.lang.Integer tenant)
java.util.Optional<org.bson.Document>
getDocumentById(java.lang.String id)
long
purge()
long
purge(java.lang.Integer tenant)
void
remove(java.lang.String id, java.lang.Integer tenant)
void
save(ElasticsearchCollections elasticsearchCollections, java.util.List<org.bson.Document> documents)
void
save(java.util.List<org.bson.Document> documents)
VitamRepositoryStatus
save(org.bson.Document document)
org.elasticsearch.action.search.SearchResponse
search(java.lang.String index, org.elasticsearch.index.query.QueryBuilder qb)
-
-
-
Field Detail
-
IDENTIFIER
public static final java.lang.String IDENTIFIER
Identifier- See Also:
- Constant Field Values
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VitamElasticsearchRepository
public VitamElasticsearchRepository(org.elasticsearch.client.RestHighLevelClient client, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver)
VitamElasticsearchRepository Constructor- Parameters:
client
- the es clientelasticsearchIndexAliasResolver
- the name of the index
-
-
Method Detail
-
save
public VitamRepositoryStatus save(org.bson.Document document) throws DatabaseException
- Throws:
DatabaseException
-
save
public void save(java.util.List<org.bson.Document> documents) throws DatabaseException
- Throws:
DatabaseException
-
save
public void save(ElasticsearchCollections elasticsearchCollections, java.util.List<org.bson.Document> documents) throws DatabaseException
- Throws:
DatabaseException
-
remove
public void remove(java.lang.String id, java.lang.Integer tenant) throws DatabaseException
- Throws:
DatabaseException
-
purge
public long purge(java.lang.Integer tenant) throws DatabaseException
- Throws:
DatabaseException
-
purge
public long purge() throws DatabaseException
- Throws:
DatabaseException
-
getByID
public java.util.Optional<org.bson.Document> getByID(java.lang.String id, java.lang.Integer tenant) throws DatabaseException
- Throws:
DatabaseException
-
getDocumentById
public java.util.Optional<org.bson.Document> getDocumentById(java.lang.String id) throws DatabaseException
- Parameters:
id
-- Returns:
- Throws:
DatabaseException
-
findByIdentifierAndTenant
public java.util.Optional<org.bson.Document> findByIdentifierAndTenant(java.lang.String identifier, java.lang.Integer tenant) throws DatabaseException
- Throws:
DatabaseException
-
search
public org.elasticsearch.action.search.SearchResponse search(java.lang.String index, org.elasticsearch.index.query.QueryBuilder qb) throws java.io.IOException
- Throws:
java.io.IOException
-
findByIdentifier
public java.util.Optional<org.bson.Document> findByIdentifier(java.lang.String identifier) throws DatabaseException
- Throws:
DatabaseException
-
delete
public void delete(java.util.List<java.lang.String> ids, int tenant) throws DatabaseException
- Throws:
DatabaseException
-
-