Class MongoDbAccessAdminImpl
java.lang.Object
fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess
fr.gouv.vitam.functional.administration.common.server.MongoDbAccessAdminImpl
- All Implemented Interfaces:
DatabaseConnection
,MongoDbAccessReferential
MongoDbAccess Implement for Admin
-
Constructor Summary
ModifierConstructorDescriptionprotected
MongoDbAccessAdminImpl
(com.mongodb.client.MongoClient mongoClient, String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader) -
Method Summary
Modifier and TypeMethodDescriptiondeleteCollectionForTesting
(FunctionalAdminCollections collection) Delete FileFormat collectionsdeleteCollectionForTesting
(FunctionalAdminCollections collection, Delete delete) deleteDocument
(com.fasterxml.jackson.databind.JsonNode delete, FunctionalAdminCollections collection) findDocuments
(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection) findDocumentsWithoutRestrictionOnCurrentTenant
(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection) find documents Without Restriction On CurrentTenantgetDocumentById
(String id, FunctionalAdminCollections collection) getDocumentByUniqueId
(String id, FunctionalAdminCollections collection, String field) insertDocument
(com.fasterxml.jackson.databind.JsonNode json, FunctionalAdminCollections collection) insert documentsinsertDocuments
(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection) insert documentsinsertDocuments
(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection, Integer version) insert documentsvoid
replaceDocument
(com.fasterxml.jackson.databind.JsonNode document, String identifierValue, String identifierKey, FunctionalAdminCollections vitamCollection) void
replaceDocuments
(Map<String, com.fasterxml.jackson.databind.JsonNode> documentByIdentifier, String identifierKey, FunctionalAdminCollections vitamCollection) updateData
(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection) Update with queryDslupdateData
(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection, Integer version) Update with queryDslMethods inherited from class fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess
checkConnection, close, createMongoClient, createMongoClient, getInfo, getMongoAdmin, getMongoClient, getMongoClientSettingsBuilder, getMongoClientSettingsBuilder, getMongoDatabase, setDatabase, setMongoAdmin, setMongoClient, setMongoDatabase
-
Constructor Details
-
MongoDbAccessAdminImpl
protected MongoDbAccessAdminImpl(com.mongodb.client.MongoClient mongoClient, String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader) - Parameters:
mongoClient
- client of mongodbname
- name of databaserecreate
- true if recreate typeindexManager
-ontologyLoader
-
-
-
Method Details
-
insertDocuments
public DbRequestResult insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException, DocumentAlreadyExistsException Description copied from interface:MongoDbAccessReferential
insert documents- Specified by:
insertDocuments
in interfaceMongoDbAccessReferential
- Parameters:
arrayNode
- of documentscollection
- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occursSchemaValidationException
DocumentAlreadyExistsException
-
insertDocuments
public DbRequestResult insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection, Integer version) throws DocumentAlreadyExistsException, ReferentialException, SchemaValidationException Description copied from interface:MongoDbAccessReferential
insert documents- Specified by:
insertDocuments
in interfaceMongoDbAccessReferential
- Parameters:
arrayNode
- of documentscollection
- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occursDocumentAlreadyExistsException
SchemaValidationException
-
deleteCollectionForTesting
public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection, Delete delete) throws DatabaseException - Specified by:
deleteCollectionForTesting
in interfaceMongoDbAccessReferential
- Throws:
DatabaseException
-
deleteCollectionForTesting
public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection) throws DatabaseException, SchemaValidationException Description copied from interface:MongoDbAccessReferential
Delete FileFormat collections- Specified by:
deleteCollectionForTesting
in interfaceMongoDbAccessReferential
- Parameters:
collection
- collection of Mongo for delete- Returns:
- DbRequestResult
- Throws:
DatabaseException
- thrown when error on deleteSchemaValidationException
-
getDocumentById
- Specified by:
getDocumentById
in interfaceMongoDbAccessReferential
- Parameters:
id
- of vitam documentcollection
- collection of Mongo- Returns:
- vitam document
-
getDocumentByUniqueId
public VitamDocument<?> getDocumentByUniqueId(String id, FunctionalAdminCollections collection, String field) - Specified by:
getDocumentByUniqueId
in interfaceMongoDbAccessReferential
- Parameters:
id
- functional id valuecollection
- Mongo collectionfield
- unique field in collection as functional id- Returns:
-
findDocuments
public DbRequestResult findDocuments(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection) throws ReferentialException - Specified by:
findDocuments
in interfaceMongoDbAccessReferential
- Parameters:
select
- filtercollection
- collection of Mongo for find- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occurs
-
findDocumentsWithoutRestrictionOnCurrentTenant
public DbRequestResult findDocumentsWithoutRestrictionOnCurrentTenant(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection) throws ReferentialException Description copied from interface:MongoDbAccessReferential
find documents Without Restriction On CurrentTenant- Specified by:
findDocumentsWithoutRestrictionOnCurrentTenant
in interfaceMongoDbAccessReferential
- Parameters:
select
- filtercollection
- collection of Mongo for find- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occurs
-
deleteDocument
public DbRequestResult deleteDocument(com.fasterxml.jackson.databind.JsonNode delete, FunctionalAdminCollections collection) throws ReferentialException, BadRequestException, SchemaValidationException - Specified by:
deleteDocument
in interfaceMongoDbAccessReferential
- Parameters:
delete
- filtercollection
- collection of Mongo for delete- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occursBadRequestException
SchemaValidationException
-
updateData
public DbRequestResult updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection, Integer version) throws ReferentialException, SchemaValidationException, BadRequestException Description copied from interface:MongoDbAccessReferential
Update with queryDsl- Specified by:
updateData
in interfaceMongoDbAccessReferential
- Parameters:
update
- JsonNode to updatecollection
- collection of Mongo Type for update- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occurs;SchemaValidationException
BadRequestException
-
replaceDocument
public void replaceDocument(com.fasterxml.jackson.databind.JsonNode document, String identifierValue, String identifierKey, FunctionalAdminCollections vitamCollection) throws DatabaseException - Specified by:
replaceDocument
in interfaceMongoDbAccessReferential
- Throws:
DatabaseException
-
replaceDocuments
public void replaceDocuments(Map<String, com.fasterxml.jackson.databind.JsonNode> documentByIdentifier, String identifierKey, FunctionalAdminCollections vitamCollection) throws DatabaseException- Throws:
DatabaseException
-
updateData
public DbRequestResult updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException, BadRequestException Description copied from interface:MongoDbAccessReferential
Update with queryDsl- Specified by:
updateData
in interfaceMongoDbAccessReferential
- Parameters:
update
- JsonNode to updatecollection
- collection of Mongo Type for update- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occurs;SchemaValidationException
BadRequestException
-
insertDocument
public DbRequestResult insertDocument(com.fasterxml.jackson.databind.JsonNode json, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException, DocumentAlreadyExistsException Description copied from interface:MongoDbAccessReferential
insert documents- Specified by:
insertDocument
in interfaceMongoDbAccessReferential
- Parameters:
json
- of documentscollection
- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException
- when error occursSchemaValidationException
DocumentAlreadyExistsException
-