Class SnapshotJobManagerImpl

  • All Implemented Interfaces:
    org.duracloud.snapshot.service.SnapshotJobManager

    @Component
    public class SnapshotJobManagerImpl
    extends Object
    implements org.duracloud.snapshot.service.SnapshotJobManager
    The default implementation of the SnapshotJobManager interface. Uses spring-batch componentry.
    Author:
    Daniel Bernstein Date: Feb 11, 2014
    • Constructor Detail

      • SnapshotJobManagerImpl

        @Autowired
        public SnapshotJobManagerImpl​(org.duracloud.snapshot.db.repo.SnapshotRepo snapshotRepo,
                                      org.duracloud.snapshot.db.repo.RestoreRepo restoreRepo,
                                      org.springframework.batch.core.launch.JobLauncher jobLauncher,
                                      org.springframework.batch.core.repository.JobRepository jobRepository,
                                      BatchJobBuilderManager manager,
                                      StoreClientHelper storeClientHelper,
                                      org.duracloud.snapshot.service.EventLog eventLog)
    • Method Detail

      • init

        public void init​(org.duracloud.snapshot.service.SnapshotJobManagerConfig config)
                  throws org.duracloud.snapshot.service.AlreadyInitializedException
        Specified by:
        init in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.service.AlreadyInitializedException
      • init

        protected void init​(org.duracloud.snapshot.service.SnapshotJobManagerConfig config,
                            boolean attemptRestart)
                     throws org.duracloud.snapshot.service.AlreadyInitializedException
        Throws:
        org.duracloud.snapshot.service.AlreadyInitializedException
      • isInitialized

        public boolean isInitialized()
        Specified by:
        isInitialized in interface org.duracloud.snapshot.service.SnapshotJobManager
      • executeRestoration

        public org.springframework.batch.core.BatchStatus executeRestoration​(String restorationId)
                                                                      throws org.duracloud.snapshot.SnapshotException
        Specified by:
        executeRestoration in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • executeSnapshot

        public org.springframework.batch.core.BatchStatus executeSnapshot​(String snapshotId)
                                                                   throws org.duracloud.snapshot.SnapshotException
        Specified by:
        executeSnapshot in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • cancelSnapshot

        @Transactional
        public void cancelSnapshot​(String snapshotId)
                            throws org.duracloud.snapshot.SnapshotException
        Specified by:
        cancelSnapshot in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • stopRestore

        @Transactional
        public org.duracloud.snapshot.db.model.Restoration stopRestore​(String restoreId)
                                                                throws org.duracloud.snapshot.SnapshotException
        Specified by:
        stopRestore in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • cancelRestore

        @Transactional
        public void cancelRestore​(String restoreId)
                           throws org.duracloud.snapshot.SnapshotException
        Specified by:
        cancelRestore in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotException
      • getStatus

        public org.springframework.batch.core.BatchStatus getStatus​(String snapshotId)
                                                             throws org.duracloud.snapshot.SnapshotNotFoundException,
                                                                    org.duracloud.snapshot.SnapshotException
        Specified by:
        getStatus in interface org.duracloud.snapshot.service.SnapshotJobManager
        Throws:
        org.duracloud.snapshot.SnapshotNotFoundException
        org.duracloud.snapshot.SnapshotException
      • getConfig

        public org.duracloud.snapshot.service.SnapshotJobManagerConfig getConfig()
        Specified by:
        getConfig in interface org.duracloud.snapshot.service.SnapshotJobManager