Class RestoreBackupServiceImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.reconstruction.RestoreBackupServiceImpl
- All Implemented Interfaces:
RestoreBackupService
Service used to recover a Backup copy of the given Vitam collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLatestSavedFileName
(String strategy, String offerId, DataCategory type, FunctionalAdminCollections collection) get the latest file name according to the name suffix.getListing
(String strategy, DataCategory dataCategory, Long offset, int limit, Order order) Retrieve list of offer log defining objects to reconstruct from offer logloadData
(String strategy, FunctionalAdminCollections collection, String filename, long offset) Load data from storagereadLatestSavedFile
(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
-
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 interfaceRestoreBackupService
- Parameters:
strategy
- the storage strategy to be appliedofferId
- offer from the object should be readedtype
- 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 interfaceRestoreBackupService
- Parameters:
strategy
- the storage strategy to be appliedcollection
- 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 interfaceRestoreBackupService
- Parameters:
strategy
- storage strategydataCategory
- collectionoffset
- offsetlimit
- limit- Returns:
- list of offer log by bulk
- Throws:
VitamRuntimeException
- storage errorIllegalArgumentException
- input errorStorageServerClientException
StorageNotFoundClientException
-
loadData
public AccessionRegisterBackupModel loadData(String strategy, FunctionalAdminCollections collection, String filename, long offset) Load data from storage- Specified by:
loadData
in interfaceRestoreBackupService
- Parameters:
strategy
- storage strategycollection
- collectionfilename
- name of file to loadoffset
- offset- Returns:
- data
- Throws:
VitamRuntimeException
- storage errorIllegalArgumentException
- input error
-