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
public class MongoDbAccessAdminImpl extends MongoDbAccess implements MongoDbAccessReferential
MongoDbAccess Implement for Admin
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MongoDbAccessAdminImpl(com.mongodb.client.MongoClient mongoClient, java.lang.String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbRequestResult
deleteCollectionForTesting(FunctionalAdminCollections collection)
Delete FileFormat collectionsDbRequestResult
deleteCollectionForTesting(FunctionalAdminCollections collection, Delete delete)
DbRequestResult
deleteDocument(com.fasterxml.jackson.databind.JsonNode delete, FunctionalAdminCollections collection)
DbRequestResult
findDocuments(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection)
VitamDocument<?>
getDocumentById(java.lang.String id, FunctionalAdminCollections collection)
VitamDocument<?>
getDocumentByUniqueId(java.lang.String id, FunctionalAdminCollections collection, java.lang.String field)
DbRequestResult
insertDocument(com.fasterxml.jackson.databind.JsonNode json, FunctionalAdminCollections collection)
insert documentsDbRequestResult
insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection)
insert documentsDbRequestResult
insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection, java.lang.Integer version)
insert documentsvoid
replaceDocument(com.fasterxml.jackson.databind.JsonNode document, java.lang.String identifierValue, java.lang.String identifierKey, FunctionalAdminCollections vitamCollection)
void
replaceDocuments(java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> documentByIdentifier, java.lang.String identifierKey, FunctionalAdminCollections vitamCollection)
DbRequestResult
updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection)
Update with queryDslDbRequestResult
updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection, java.lang.Integer version)
Update with queryDsl-
Methods 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 Detail
-
MongoDbAccessAdminImpl
protected MongoDbAccessAdminImpl(com.mongodb.client.MongoClient mongoClient, java.lang.String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader)
- Parameters:
mongoClient
- client of mongodbname
- name of databaserecreate
- true if recreate typeindexManager
-ontologyLoader
-
-
-
Method Detail
-
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, java.lang.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
public VitamDocument<?> getDocumentById(java.lang.String id, FunctionalAdminCollections collection)
- Specified by:
getDocumentById
in interfaceMongoDbAccessReferential
- Parameters:
id
- of vitam documentcollection
- collection of Mongo- Returns:
- vitam document
-
getDocumentByUniqueId
public VitamDocument<?> getDocumentByUniqueId(java.lang.String id, FunctionalAdminCollections collection, java.lang.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
-
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, java.lang.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, java.lang.String identifierValue, java.lang.String identifierKey, FunctionalAdminCollections vitamCollection) throws DatabaseException
- Specified by:
replaceDocument
in interfaceMongoDbAccessReferential
- Throws:
DatabaseException
-
replaceDocuments
public void replaceDocuments(java.util.Map<java.lang.String,com.fasterxml.jackson.databind.JsonNode> documentByIdentifier, java.lang.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
-
-