Class 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 Detail

      • RestoreManagerImpl

        public RestoreManagerImpl()
    • 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:
        restoreSnapshot in interface org.duracloud.snapshot.service.RestoreManager
        Throws:
        org.duracloud.snapshot.SnapshotNotFoundException
        org.duracloud.snapshot.SnapshotInProcessException
        org.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:
        requestRestoreSnapshot in interface org.duracloud.snapshot.service.RestoreManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • extractAccountId

        protected String extractAccountId​(String host)
      • 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:
        restoreCompleted in interface org.duracloud.snapshot.service.RestoreManager
        Throws:
        org.duracloud.snapshot.SnapshotNotFoundException
        org.duracloud.snapshot.SnapshotInProcessException
        org.duracloud.snapshot.service.NoRestorationInProcessException
        org.duracloud.snapshot.SnapshotException
      • init

        public void init​(org.duracloud.snapshot.service.RestoreManagerConfig config,
                         org.duracloud.snapshot.service.SnapshotJobManager jobManager)
        Specified by:
        init in interface org.duracloud.snapshot.service.RestoreManager
      • get

        public org.duracloud.snapshot.db.model.Restoration get​(String restorationId)
                                                        throws org.duracloud.snapshot.service.RestorationNotFoundException
        Specified by:
        get in interface org.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:
        getBySnapshotId in interface org.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:
        transitionRestoreStatus in interface org.duracloud.snapshot.service.RestoreManager
        Throws:
        org.duracloud.snapshot.service.InvalidStateTransitionException
        org.duracloud.snapshot.service.RestorationNotFoundException
      • finalizeRestores

        @Transactional
        public void finalizeRestores()
        Specified by:
        finalizeRestores in interface org.duracloud.snapshot.service.RestoreManager
      • cancelRestore

        @Transactional
        public void cancelRestore​(String restoreId)
                           throws org.duracloud.snapshot.SnapshotException
        Specified by:
        cancelRestore in interface org.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:
        restartRestore in interface org.duracloud.snapshot.service.RestoreManager
        Throws:
        org.duracloud.snapshot.SnapshotException