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
ConstructorsModifierConstructorDescriptionprotectedMongoDbAccessAdminImpl(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 documentsvoidreplaceDocument(com.fasterxml.jackson.databind.JsonNode document, String identifierValue, String identifierKey, FunctionalAdminCollections vitamCollection) voidreplaceDocuments(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:MongoDbAccessReferentialinsert documents- Specified by:
insertDocumentsin interfaceMongoDbAccessReferential- Parameters:
arrayNode- of documentscollection- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occursSchemaValidationExceptionDocumentAlreadyExistsException
-
insertDocuments
public DbRequestResult insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection, Integer version) throws DocumentAlreadyExistsException, ReferentialException, SchemaValidationException Description copied from interface:MongoDbAccessReferentialinsert documents- Specified by:
insertDocumentsin interfaceMongoDbAccessReferential- Parameters:
arrayNode- of documentscollection- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occursDocumentAlreadyExistsExceptionSchemaValidationException
-
deleteCollectionForTesting
public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection, Delete delete) throws DatabaseException - Specified by:
deleteCollectionForTestingin interfaceMongoDbAccessReferential- Throws:
DatabaseException
-
deleteCollectionForTesting
public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection) throws DatabaseException, SchemaValidationException Description copied from interface:MongoDbAccessReferentialDelete FileFormat collections- Specified by:
deleteCollectionForTestingin interfaceMongoDbAccessReferential- Parameters:
collection- collection of Mongo for delete- Returns:
- DbRequestResult
- Throws:
DatabaseException- thrown when error on deleteSchemaValidationException
-
getDocumentById
- Specified by:
getDocumentByIdin interfaceMongoDbAccessReferential- Parameters:
id- of vitam documentcollection- collection of Mongo- Returns:
- vitam document
-
getDocumentByUniqueId
public VitamDocument<?> getDocumentByUniqueId(String id, FunctionalAdminCollections collection, String field) - Specified by:
getDocumentByUniqueIdin 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:
findDocumentsin 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:MongoDbAccessReferentialfind documents Without Restriction On CurrentTenant- Specified by:
findDocumentsWithoutRestrictionOnCurrentTenantin 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:
deleteDocumentin interfaceMongoDbAccessReferential- Parameters:
delete- filtercollection- collection of Mongo for delete- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occursBadRequestExceptionSchemaValidationException
-
updateData
public DbRequestResult updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection, Integer version) throws ReferentialException, SchemaValidationException, BadRequestException Description copied from interface:MongoDbAccessReferentialUpdate with queryDsl- Specified by:
updateDatain interfaceMongoDbAccessReferential- Parameters:
update- JsonNode to updatecollection- collection of Mongo Type for update- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occurs;SchemaValidationExceptionBadRequestException
-
replaceDocument
public void replaceDocument(com.fasterxml.jackson.databind.JsonNode document, String identifierValue, String identifierKey, FunctionalAdminCollections vitamCollection) throws DatabaseException - Specified by:
replaceDocumentin 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:MongoDbAccessReferentialUpdate with queryDsl- Specified by:
updateDatain interfaceMongoDbAccessReferential- Parameters:
update- JsonNode to updatecollection- collection of Mongo Type for update- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occurs;SchemaValidationExceptionBadRequestException
-
insertDocument
public DbRequestResult insertDocument(com.fasterxml.jackson.databind.JsonNode json, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException, DocumentAlreadyExistsException Description copied from interface:MongoDbAccessReferentialinsert documents- Specified by:
insertDocumentin interfaceMongoDbAccessReferential- Parameters:
json- of documentscollection- collection of Mongo for insert- Returns:
- DbRequestResult
- Throws:
ReferentialException- when error occursSchemaValidationExceptionDocumentAlreadyExistsException
-