Package fr.gouv.vitam.functional.administration.core.reconstruction

# Class RestoreBackupServiceImpl

java.lang.Object
fr.gouv.vitam.functional.administration.core.reconstruction.RestoreBackupServiceImpl

All Implemented Interfaces:
  `RestoreBackupService`

public class RestoreBackupServiceImpl extends Object implements RestoreBackupService
Service used to recover a Backup copy of the given Vitam collection.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RestoreBackupServiceImpl()`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<String>`
  `getLatestSavedFileName(String strategy, String offerId, DataCategory type, FunctionalAdminCollections collection)`
  get the latest file name according to the name suffix.
  `Iterator<List<OfferLog>>`
  `getListing(String strategy, DataCategory dataCategory, Long offset, int limit, Order order)`
  Retrieve list of offer log defining objects to reconstruct from offer log
  `AccessionRegisterBackupModel`
  `loadData(String strategy, FunctionalAdminCollections collection, String filename, long offset)`
  Load data from storage
  `Optional<CollectionBackupModel>`
  `readLatestSavedFile(String strategy, String offerId, FunctionalAdminCollections collection)`
  Read the latest file using the name requested by getLatestSavedFileName.
  Be careful, this method use tenant that is requested from the VitamSession

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

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

- ## Constructor Details

  - ### RestoreBackupServiceImpl

    public RestoreBackupServiceImpl()
    Constructor

- ## Method Details

  - ### getLatestSavedFileName

    public Optional<String> getLatestSavedFileName(String strategy, String offerId, DataCategory type, FunctionalAdminCollections collection)
    Description copied from interface: `RestoreBackupService`
    get the latest file name according to the name suffix.
    Specified by:
      `getLatestSavedFileName` in interface `RestoreBackupService`
    Parameters:
      `strategy` - the storage strategy to be applied
      `offerId` - offer from the object should be readed
      `type` - the storage collection type.
      `collection` - the collection to be restored
    Returns:
      the last version.

  - ### readLatestSavedFile

    public Optional<CollectionBackupModel> readLatestSavedFile(String strategy, String offerId, FunctionalAdminCollections collection)
    Description copied from interface: `RestoreBackupService`
    Read the latest file using the name requested by getLatestSavedFileName.
    Be careful, this method use tenant that is requested from the VitamSession
    Specified by:
      `readLatestSavedFile` in interface `RestoreBackupService`
    Parameters:
      `strategy` - the storage strategy to be applied
      `collection` - the collection to be restored
    Returns:
      the backup copy.

  - ### getListing

    public Iterator<List<OfferLog>> getListing(String strategy, DataCategory dataCategory, Long offset, int limit, Order order) throws StorageServerClientException, StorageNotFoundClientException
    Retrieve list of offer log defining objects to reconstruct from offer log
    Specified by:
      `getListing` in interface `RestoreBackupService`
    Parameters:
      `strategy` - storage strategy
      `dataCategory` - collection
      `offset` - offset
      `limit` - limit
    Returns:
      list of offer log by bulk
    Throws:
      `VitamRuntimeException` - storage error
      `IllegalArgumentException` - input error
      `StorageServerClientException`
      `StorageNotFoundClientException`

  - ### loadData

    public AccessionRegisterBackupModel loadData(String strategy, FunctionalAdminCollections collection, String filename, long offset)
    Load data from storage
    Specified by:
      `loadData` in interface `RestoreBackupService`
    Parameters:
      `strategy` - storage strategy
      `collection` - collection
      `filename` - name of file to load
      `offset` - offset
    Returns:
      data
    Throws:
      `VitamRuntimeException` - storage error
      `IllegalArgumentException` - input error