public class MongoDbAccessAdminImpl extends MongoDbAccess implements MongoDbAccessReferential
Modifier | Constructor and Description |
---|---|
protected |
MongoDbAccessAdminImpl(com.mongodb.MongoClient mongoClient,
String dbname,
boolean recreate) |
Modifier and Type | Method and Description |
---|---|
DbRequestResult |
deleteCollection(FunctionalAdminCollections collection)
Delete FileFormat collections
|
DbRequestResult |
deleteCollection(FunctionalAdminCollections collection,
Delete delete) |
DbRequestResult |
findDocuments(com.fasterxml.jackson.databind.JsonNode select,
FunctionalAdminCollections collection) |
VitamDocument<?> |
getDocumentById(String id,
FunctionalAdminCollections collection) |
VitamDocument<?> |
getDocumentByUniqueId(String id,
FunctionalAdminCollections collection,
String field) |
DbRequestResult |
insertDocument(com.fasterxml.jackson.databind.JsonNode json,
FunctionalAdminCollections collection)
insert documents
|
DbRequestResult |
insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode,
FunctionalAdminCollections collection)
insert documents
|
DbRequestResult |
insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode,
FunctionalAdminCollections collection,
Integer version)
insert documents
|
DbRequestResult |
updateData(com.fasterxml.jackson.databind.JsonNode update,
FunctionalAdminCollections collection)
Update with queryDsl
|
DbRequestResult |
updateData(com.fasterxml.jackson.databind.JsonNode update,
FunctionalAdminCollections collection,
Integer version)
Update with queryDsl
|
checkConnection, close, createMongoClient, getInfo, getMongoAdmin, getMongoClient, getMongoDatabase, setDatabase, setMongoAdmin, setMongoClient, setMongoDatabase
protected MongoDbAccessAdminImpl(com.mongodb.MongoClient mongoClient, String dbname, boolean recreate)
mongoClient
- client of mongodbname
- name of databaserecreate
- true if recreate typepublic DbRequestResult insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException
MongoDbAccessReferential
insertDocuments
in interface MongoDbAccessReferential
arrayNode
- of documentscollection
- collection of Mongo for insertReferentialException
- when error occursSchemaValidationException
public DbRequestResult insertDocuments(com.fasterxml.jackson.databind.node.ArrayNode arrayNode, FunctionalAdminCollections collection, Integer version) throws ReferentialException, SchemaValidationException
MongoDbAccessReferential
insertDocuments
in interface MongoDbAccessReferential
arrayNode
- of documentscollection
- collection of Mongo for insertReferentialException
- when error occursSchemaValidationException
public DbRequestResult deleteCollection(FunctionalAdminCollections collection, Delete delete) throws DatabaseException, ReferentialException
deleteCollection
in interface MongoDbAccessReferential
DatabaseException
ReferentialException
public DbRequestResult deleteCollection(FunctionalAdminCollections collection) throws DatabaseException, ReferentialException, SchemaValidationException
MongoDbAccessReferential
deleteCollection
in interface MongoDbAccessReferential
collection
- collection of Mongo for deleteDatabaseException
- thrown when error on deleteReferentialException
- when error occursSchemaValidationException
public VitamDocument<?> getDocumentById(String id, FunctionalAdminCollections collection) throws ReferentialException
getDocumentById
in interface MongoDbAccessReferential
id
- of vitam documentcollection
- collection of MongoReferentialException
- when error occurspublic VitamDocument<?> getDocumentByUniqueId(String id, FunctionalAdminCollections collection, String field) throws ReferentialException
getDocumentByUniqueId
in interface MongoDbAccessReferential
id
- functional id valuecollection
- Mongo collectionfield
- unique field in collection as functional idReferentialException
public DbRequestResult findDocuments(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection) throws ReferentialException
findDocuments
in interface MongoDbAccessReferential
select
- filtercollection
- collection of Mongo for findReferentialException
- when error occurspublic DbRequestResult updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection, Integer version) throws ReferentialException, SchemaValidationException
MongoDbAccessReferential
updateData
in interface MongoDbAccessReferential
update
- JsonNode to updatecollection
- collection of Mongo Type for updateReferentialException
- when error occurs;SchemaValidationException
public DbRequestResult updateData(com.fasterxml.jackson.databind.JsonNode update, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException
MongoDbAccessReferential
updateData
in interface MongoDbAccessReferential
update
- JsonNode to updatecollection
- collection of Mongo Type for updateReferentialException
- when error occurs;SchemaValidationException
public DbRequestResult insertDocument(com.fasterxml.jackson.databind.JsonNode json, FunctionalAdminCollections collection) throws ReferentialException, SchemaValidationException
MongoDbAccessReferential
insertDocument
in interface MongoDbAccessReferential
json
- of documentscollection
- collection of Mongo for insertReferentialException
- when error occursSchemaValidationException
Copyright © 2018 Vitam. All rights reserved.