- java.lang.Object
-
- org.duracloud.snapshot.service.impl.RestoreManagerImpl
-
- All Implemented Interfaces:
org.duracloud.snapshot.service.RestoreManager
@Component public class RestoreManagerImpl extends Object implements org.duracloud.snapshot.service.RestoreManager
- Author:
- Daniel Bernstein Date: Jul 15, 2014
-
-
Constructor Summary
Constructors Constructor Description RestoreManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelRestore(String restoreId)protected StringextractAccountId(String host)voidfinalizeRestores()org.duracloud.snapshot.db.model.Restorationget(String restorationId)org.duracloud.snapshot.db.model.RestorationgetBySnapshotId(String snapshotId)org.duracloud.snapshot.db.model.RestorationgetRestoration(String restorationId)voidinit(org.duracloud.snapshot.service.RestoreManagerConfig config, org.duracloud.snapshot.service.SnapshotJobManager jobManager)org.duracloud.snapshot.db.model.SnapshotrequestRestoreSnapshot(String snapshotId, org.duracloud.snapshot.db.model.DuracloudEndPointConfig destination, String userEmail)org.duracloud.snapshot.db.model.RestorationrestartRestore(String restoreId)org.duracloud.snapshot.db.model.RestorationrestoreCompleted(String restorationId)org.duracloud.snapshot.db.model.RestorationrestoreSnapshot(String snapshotId, org.duracloud.snapshot.db.model.DuracloudEndPointConfig destination, String userEmail)protected voidsetBridgeConfig(BridgeConfiguration bridgeConfig)For testing purposes onlyprotected voidsetEventLog(org.duracloud.snapshot.service.EventLog eventLog)For testing purposes onlyprotected voidsetNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)For testing purposes onlyprotected voidsetRestoreRepo(org.duracloud.snapshot.db.repo.RestoreRepo restoreRepo)For testing purposes onlyprotected voidsetSnapshotManager(org.duracloud.snapshot.service.SnapshotManager snapshotManager)For testing purposes onlyprotected voidsetSnapshotRepo(org.duracloud.snapshot.db.repo.SnapshotRepo snapshotRepo)For testing purposes onlyprotected voidsetStoreClientHelper(StoreClientHelper storeClientHelper)For testing purposes onlyorg.duracloud.snapshot.db.model.RestorationtransitionRestoreStatus(String restorationId, org.duracloud.snapshot.dto.RestoreStatus status, String message)
-
-
-
Method Detail
-
setSnapshotRepo
protected void setSnapshotRepo(org.duracloud.snapshot.db.repo.SnapshotRepo snapshotRepo)
For testing purposes only- Parameters:
snapshotRepo- the snapshotRepo to set
-
setNotificationManager
protected void setNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)
For testing purposes only- Parameters:
notificationManager- the notificationManager to set
-
setRestoreRepo
protected void setRestoreRepo(org.duracloud.snapshot.db.repo.RestoreRepo restoreRepo)
For testing purposes only- Parameters:
restoreRepo- the restoreRepo to set
-
setStoreClientHelper
protected void setStoreClientHelper(StoreClientHelper storeClientHelper)
For testing purposes only- Parameters:
storeClientHelper- the storeClientHelper to set
-
setEventLog
protected void setEventLog(org.duracloud.snapshot.service.EventLog eventLog)
For testing purposes only- Parameters:
eventLog- the event log to set
-
setBridgeConfig
protected void setBridgeConfig(BridgeConfiguration bridgeConfig)
For testing purposes only- Parameters:
bridgeConfig- the bridgeConfig to set
-
setSnapshotManager
protected void setSnapshotManager(org.duracloud.snapshot.service.SnapshotManager snapshotManager)
For testing purposes only- Parameters:
snapshotManager- The snapshot manager
-
restoreSnapshot
public org.duracloud.snapshot.db.model.Restoration restoreSnapshot(String snapshotId, org.duracloud.snapshot.db.model.DuracloudEndPointConfig destination, String userEmail) throws org.duracloud.snapshot.SnapshotNotFoundException, org.duracloud.snapshot.SnapshotInProcessException, org.duracloud.snapshot.SnapshotException
- Specified by:
restoreSnapshotin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.SnapshotNotFoundExceptionorg.duracloud.snapshot.SnapshotInProcessExceptionorg.duracloud.snapshot.SnapshotException
-
requestRestoreSnapshot
public org.duracloud.snapshot.db.model.Snapshot requestRestoreSnapshot(String snapshotId, org.duracloud.snapshot.db.model.DuracloudEndPointConfig destination, String userEmail) throws org.duracloud.snapshot.SnapshotException
- Specified by:
requestRestoreSnapshotin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.SnapshotException
-
getRestoration
public org.duracloud.snapshot.db.model.Restoration getRestoration(String restorationId) throws org.duracloud.snapshot.service.RestorationNotFoundException
- Parameters:
restorationId- of the restore object- Returns:
- the restoration
- Throws:
org.duracloud.snapshot.service.RestorationNotFoundException- if the restoration is not found
-
restoreCompleted
public org.duracloud.snapshot.db.model.Restoration restoreCompleted(String restorationId) throws org.duracloud.snapshot.SnapshotNotFoundException, org.duracloud.snapshot.SnapshotInProcessException, org.duracloud.snapshot.service.NoRestorationInProcessException, org.duracloud.snapshot.SnapshotException
- Specified by:
restoreCompletedin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.SnapshotNotFoundExceptionorg.duracloud.snapshot.SnapshotInProcessExceptionorg.duracloud.snapshot.service.NoRestorationInProcessExceptionorg.duracloud.snapshot.SnapshotException
-
init
public void init(org.duracloud.snapshot.service.RestoreManagerConfig config, org.duracloud.snapshot.service.SnapshotJobManager jobManager)- Specified by:
initin interfaceorg.duracloud.snapshot.service.RestoreManager
-
get
public org.duracloud.snapshot.db.model.Restoration get(String restorationId) throws org.duracloud.snapshot.service.RestorationNotFoundException
- Specified by:
getin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.service.RestorationNotFoundException
-
getBySnapshotId
public org.duracloud.snapshot.db.model.Restoration getBySnapshotId(String snapshotId) throws org.duracloud.snapshot.service.RestorationNotFoundException
- Specified by:
getBySnapshotIdin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.service.RestorationNotFoundException
-
transitionRestoreStatus
@Transactional public org.duracloud.snapshot.db.model.Restoration transitionRestoreStatus(String restorationId, org.duracloud.snapshot.dto.RestoreStatus status, String message) throws org.duracloud.snapshot.service.InvalidStateTransitionException, org.duracloud.snapshot.service.RestorationNotFoundException
- Specified by:
transitionRestoreStatusin interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.service.InvalidStateTransitionExceptionorg.duracloud.snapshot.service.RestorationNotFoundException
-
finalizeRestores
@Transactional public void finalizeRestores()
- Specified by:
finalizeRestoresin interfaceorg.duracloud.snapshot.service.RestoreManager
-
cancelRestore
@Transactional public void cancelRestore(String restoreId) throws org.duracloud.snapshot.SnapshotException
- Specified by:
cancelRestorein interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.SnapshotException
-
restartRestore
@Transactional public org.duracloud.snapshot.db.model.Restoration restartRestore(String restoreId) throws org.duracloud.snapshot.SnapshotException
- Specified by:
restartRestorein interfaceorg.duracloud.snapshot.service.RestoreManager- Throws:
org.duracloud.snapshot.SnapshotException
-
-