Class RestoreManagerImpl
- java.lang.Object
-
- org.duracloud.snapshot.service.impl.RestoreManagerImpl
-
- All Implemented Interfaces:
RestoreManager
@Component public class RestoreManagerImpl extends java.lang.Object implements 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(java.lang.String restoreId)protected java.lang.StringextractAccountId(java.lang.String host)voidfinalizeRestores()Restorationget(java.lang.String restorationId)RestorationgetBySnapshotId(java.lang.String snapshotId)RestorationgetRestoration(java.lang.String restorationId)voidinit(RestoreManagerConfig config, SnapshotJobManager jobManager)SnapshotrequestRestoreSnapshot(java.lang.String snapshotId, DuracloudEndPointConfig destination, java.lang.String userEmail)RestorationrestartRestore(java.lang.String restoreId)RestorationrestoreCompleted(java.lang.String restorationId)RestorationrestoreSnapshot(java.lang.String snapshotId, DuracloudEndPointConfig destination, java.lang.String userEmail)protected voidsetBridgeConfig(BridgeConfiguration bridgeConfig)For testing purposes onlyprotected voidsetEventLog(EventLog eventLog)For testing purposes onlyprotected voidsetNotificationManager(org.duracloud.common.notification.NotificationManager notificationManager)For testing purposes onlyprotected voidsetRestoreRepo(RestoreRepo restoreRepo)For testing purposes onlyprotected voidsetSnapshotManager(SnapshotManager snapshotManager)For testing purposes onlyprotected voidsetSnapshotRepo(SnapshotRepo snapshotRepo)For testing purposes onlyprotected voidsetStoreClientHelper(StoreClientHelper storeClientHelper)For testing purposes onlyRestorationtransitionRestoreStatus(java.lang.String restorationId, org.duracloud.snapshot.dto.RestoreStatus status, java.lang.String message)
-
-
-
Method Detail
-
setSnapshotRepo
protected void setSnapshotRepo(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(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(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(SnapshotManager snapshotManager)
For testing purposes only- Parameters:
snapshotManager- The snapshot manager
-
restoreSnapshot
public Restoration restoreSnapshot(java.lang.String snapshotId, DuracloudEndPointConfig destination, java.lang.String userEmail) throws SnapshotNotFoundException, SnapshotInProcessException, SnapshotException
- Specified by:
restoreSnapshotin interfaceRestoreManager- Throws:
SnapshotNotFoundExceptionSnapshotInProcessExceptionSnapshotException
-
requestRestoreSnapshot
public Snapshot requestRestoreSnapshot(java.lang.String snapshotId, DuracloudEndPointConfig destination, java.lang.String userEmail) throws SnapshotException
- Specified by:
requestRestoreSnapshotin interfaceRestoreManager- Throws:
SnapshotException
-
extractAccountId
protected java.lang.String extractAccountId(java.lang.String host)
-
getRestoration
public Restoration getRestoration(java.lang.String restorationId) throws RestorationNotFoundException
- Parameters:
restorationId- of the restore object- Returns:
- the restoration
- Throws:
RestorationNotFoundException- if the restoration is not found
-
restoreCompleted
public Restoration restoreCompleted(java.lang.String restorationId) throws SnapshotNotFoundException, SnapshotInProcessException, NoRestorationInProcessException, SnapshotException
- Specified by:
restoreCompletedin interfaceRestoreManager- Throws:
SnapshotNotFoundExceptionSnapshotInProcessExceptionNoRestorationInProcessExceptionSnapshotException
-
init
public void init(RestoreManagerConfig config, SnapshotJobManager jobManager)
- Specified by:
initin interfaceRestoreManager
-
get
public Restoration get(java.lang.String restorationId) throws RestorationNotFoundException
- Specified by:
getin interfaceRestoreManager- Throws:
RestorationNotFoundException
-
getBySnapshotId
public Restoration getBySnapshotId(java.lang.String snapshotId) throws RestorationNotFoundException
- Specified by:
getBySnapshotIdin interfaceRestoreManager- Throws:
RestorationNotFoundException
-
transitionRestoreStatus
@Transactional public Restoration transitionRestoreStatus(java.lang.String restorationId, org.duracloud.snapshot.dto.RestoreStatus status, java.lang.String message) throws InvalidStateTransitionException, RestorationNotFoundException
- Specified by:
transitionRestoreStatusin interfaceRestoreManager- Throws:
InvalidStateTransitionExceptionRestorationNotFoundException
-
finalizeRestores
@Transactional public void finalizeRestores()
- Specified by:
finalizeRestoresin interfaceRestoreManager
-
cancelRestore
@Transactional public void cancelRestore(java.lang.String restoreId) throws SnapshotException- Specified by:
cancelRestorein interfaceRestoreManager- Throws:
SnapshotException
-
restartRestore
@Transactional public Restoration restartRestore(java.lang.String restoreId) throws SnapshotException
- Specified by:
restartRestorein interfaceRestoreManager- Throws:
SnapshotException
-
-