Package fr.gouv.vitam.common.database.api

# Class VitamRepositoryFactory

java.lang.Object
fr.gouv.vitam.common.database.api.VitamRepositoryFactory

All Implemented Interfaces:
  `VitamRepositoryProvider`

public class VitamRepositoryFactory extends Object implements VitamRepositoryProvider
Reconstruction instance for instantiating mongoDB and elasticsearch repository.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VitamRepositoryFactory`
  `get()`
  get Thread-Safe instance instance.
  `VitamElasticsearchRepository`
  `getVitamESRepository(VitamCollection collection, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver)`
  `VitamMongoRepository`
  `getVitamMongoRepository(VitamCollection collection)`

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

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

- ## Method Details

  - ### get

    public static VitamRepositoryFactory get()
    get Thread-Safe instance instance.
    Returns:
      current instance of VitamRepositoryFactory, create if null

  - ### getVitamMongoRepository

    public VitamMongoRepository getVitamMongoRepository(VitamCollection collection)
    Specified by:
      `getVitamMongoRepository` in interface `VitamRepositoryProvider`
    Parameters:
      `collection` - VitamCollection
    Returns:
      VitamMongoRepository

  - ### getVitamESRepository

    public VitamElasticsearchRepository getVitamESRepository(VitamCollection collection, ElasticsearchIndexAliasResolver elasticsearchIndexAliasResolver)
    Specified by:
      `getVitamESRepository` in interface `VitamRepositoryProvider`
    Parameters:
      `collection` - VitamCollection
    Returns:
      VitamElasticsearchRepository