Package fr.gouv.vitam.metadata.core.database.collections

# Class MongoDbAccessMetadataImpl

java.lang.Object
fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess
fr.gouv.vitam.metadata.core.database.collections.MongoDbAccessMetadataImpl

All Implemented Interfaces:
  `DatabaseConnection`

public class MongoDbAccessMetadataImpl extends MongoDbAccess
MongoDbAccess Implement for Admin

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MongoDbAccessMetadataImpl(com.mongodb.client.MongoClient mongoClient, String dbname, boolean recreate, ElasticsearchAccessMetadata esClient, MetadataCollections unitCollection, MetadataCollections objectCollection)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `deleteObjectGroupByTenant(Integer... tenantIds)`
  Delete Object Group metadata by Tenant Not check, test feature !
  `void`
  `deleteUnitByTenant(Integer... tenantIds)`
  Delete Unit metadata by tenant Not check, test feature !
  `ElasticsearchAccessMetadata`
  `getEsClient()`
  `String`
  `getInfo()`
  Get information on a Database
  `static long`
  `getObjectGroupSize()`
  `static long`
  `getUnitSize()`

  ### Methods inherited from class fr.gouv.vitam.common.database.server.mongodb.MongoDbAccess

  `checkConnection, close, createMongoClient, createMongoClient, 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

  - ### MongoDbAccessMetadataImpl

    public MongoDbAccessMetadataImpl(com.mongodb.client.MongoClient mongoClient, String dbname, boolean recreate, ElasticsearchAccessMetadata esClient, MetadataCollections unitCollection, MetadataCollections objectCollection)
    Parameters:
      `mongoClient` - MongoClient
      `dbname` - MongoDB database name
      `recreate` - True to recreate the index
      `esClient` - Elasticsearch client
      `unitCollection` -
      `objectCollection` -

- ## Method Details

  - ### getInfo

    public String getInfo()
    Description copied from interface: `DatabaseConnection`
    Get information on a Database
    Specified by:
      `getInfo` in interface `DatabaseConnection`
    Overrides:
      `getInfo` in class `MongoDbAccess`
    Returns:
      information on the database

  - ### getUnitSize

    public static long getUnitSize()
    Returns:
      the current number of Unit

  - ### getObjectGroupSize

    public static long getObjectGroupSize()
    Returns:
      the current number of ObjectGroup

  - ### getEsClient

    public ElasticsearchAccessMetadata getEsClient()
    Returns:
      the Elasticsearch Acess Metadata client

  - ### deleteUnitByTenant

    public void deleteUnitByTenant(Integer... tenantIds) throws MetaDataExecutionException
    Delete Unit metadata by tenant Not check, test feature !
    Parameters:
      `tenantIds` - the list of tenants
    Throws:
      `MetaDataExecutionException`

  - ### deleteObjectGroupByTenant

    public void deleteObjectGroupByTenant(Integer... tenantIds) throws MetaDataExecutionException
    Delete Object Group metadata by Tenant Not check, test feature !
    Parameters:
      `tenantIds` - the list of tenants
    Throws:
      `MetaDataExecutionException`