Package fr.gouv.vitam.metadata.core.reconstruction.service

# Class RestoreBackupService

java.lang.Object
fr.gouv.vitam.metadata.core.reconstruction.service.RestoreBackupService

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RestoreBackupService()`
  Constructor
  `RestoreBackupService(StorageClientFactory storageClientFactory)`
  Constructor for tests

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Iterator<OfferLog>`
  `getListing(String strategy, String offerId, DataCategory category, Long offset, Integer limit, Order order, int batchSize)`
  Retrieve list of offer log defining objects to reconstruct from offer log
  `MetadataBackupModel`
  `loadData(String strategy, String referentOffer, MetadataCollections collection, String filename, long offset)`
  Load data from storage
  `InputStream`
  `loadData(String strategy, String referentOffer, DataCategory category, String filename)`

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

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

- ## Constructor Details

  - ### RestoreBackupService

    public RestoreBackupService()
    Constructor

  - ### RestoreBackupService

    public RestoreBackupService(StorageClientFactory storageClientFactory)
    Constructor for tests
    Parameters:
      `storageClientFactory` - storage client factory

- ## Method Details

  - ### getListing

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

  - ### loadData

    public MetadataBackupModel loadData(String strategy, String referentOffer, MetadataCollections collection, String filename, long offset) throws StorageNotFoundException
    Load data from storage
    Parameters:
      `strategy` - storage strategy
      `collection` - collection
      `filename` - name of file to load
      `offset` - offset
    Returns:
      data
    Throws:
      `VitamRuntimeException` - storage error
      `IllegalArgumentException` - input error
      `StorageNotFoundException`

  - ### loadData

    public InputStream loadData(String strategy, String referentOffer, DataCategory category, String filename) throws StorageNotFoundException
    Throws:
      `StorageNotFoundException`