Package fr.gouv.vitam.functional.administration.common.server

# 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, String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DbRequestResult`
  `deleteCollectionForTesting(FunctionalAdminCollections collection)`
  Delete FileFormat collections
  `DbRequestResult`
  `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)`
  `DbRequestResult`
  `findDocumentsWithoutRestrictionOnCurrentTenant(com.fasterxml.jackson.databind.JsonNode select, FunctionalAdminCollections collection)`
  find documents Without Restriction On CurrentTenant
  `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
  `void`
  `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)`
  `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

  ### 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MongoDbAccessAdminImpl

    protected MongoDbAccessAdminImpl(com.mongodb.client.MongoClient mongoClient, String dbname, boolean recreate, ElasticsearchFunctionalAdminIndexManager indexManager, OntologyLoader ontologyLoader)
    Parameters:
      `mongoClient` - client of mongo
      `dbname` - name of database
      `recreate` - true if recreate type
      `indexManager` -
      `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 interface `MongoDbAccessReferential`
    Parameters:
      `arrayNode` - of documents
      `collection` - collection of Mongo for insert
    Returns:
      DbRequestResult
    Throws:
      `ReferentialException` - when error occurs
      `SchemaValidationException`
      `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 interface `MongoDbAccessReferential`
    Parameters:
      `arrayNode` - of documents
      `collection` - collection of Mongo for insert
    Returns:
      DbRequestResult
    Throws:
      `ReferentialException` - when error occurs
      `DocumentAlreadyExistsException`
      `SchemaValidationException`

  - ### deleteCollectionForTesting

    public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection, Delete delete) throws DatabaseException
    Specified by:
      `deleteCollectionForTesting` in interface `MongoDbAccessReferential`
    Throws:
      `DatabaseException`

  - ### deleteCollectionForTesting

    public DbRequestResult deleteCollectionForTesting(FunctionalAdminCollections collection) throws DatabaseException, SchemaValidationException
    Description copied from interface: `MongoDbAccessReferential`
    Delete FileFormat collections
    Specified by:
      `deleteCollectionForTesting` in interface `MongoDbAccessReferential`
    Parameters:
      `collection` - collection of Mongo for delete
    Returns:
      DbRequestResult
    Throws:
      `DatabaseException` - thrown when error on delete
      `SchemaValidationException`

  - ### getDocumentById

    public VitamDocument<?> getDocumentById(String id, FunctionalAdminCollections collection)
    Specified by:
      `getDocumentById` in interface `MongoDbAccessReferential`
    Parameters:
      `id` - of vitam document
      `collection` - collection of Mongo
    Returns:
      vitam document

  - ### getDocumentByUniqueId

    public VitamDocument<?> getDocumentByUniqueId(String id, FunctionalAdminCollections collection, String field)
    Specified by:
      `getDocumentByUniqueId` in interface `MongoDbAccessReferential`
    Parameters:
      `id` - functional id value
      `collection` - Mongo collection
      `field` - 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 interface `MongoDbAccessReferential`
    Parameters:
      `select` - filter
      `collection` - 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 interface `MongoDbAccessReferential`
    Parameters:
      `select` - filter
      `collection` - 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 interface `MongoDbAccessReferential`
    Parameters:
      `delete` - filter
      `collection` - collection of Mongo for delete
    Returns:
      DbRequestResult
    Throws:
      `ReferentialException` - when error occurs
      `BadRequestException`
      `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 interface `MongoDbAccessReferential`
    Parameters:
      `update` - JsonNode to update
      `collection` - collection of Mongo Type for update
      `version` -
    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 interface `MongoDbAccessReferential`
    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 interface `MongoDbAccessReferential`
    Parameters:
      `update` - JsonNode to update
      `collection` - 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 interface `MongoDbAccessReferential`
    Parameters:
      `json` - of documents
      `collection` - collection of Mongo for insert
    Returns:
      DbRequestResult
    Throws:
      `ReferentialException` - when error occurs
      `SchemaValidationException`
      `DocumentAlreadyExistsException`