Package org.duracloud.syncui.service
Class SyncProcessManagerImpl
- java.lang.Object
-
- org.duracloud.syncui.service.SyncProcessManagerImpl
-
- All Implemented Interfaces:
SyncProcess,SyncProcessManager
@Component("syncProcessManager") public class SyncProcessManagerImpl extends Object implements SyncProcessManagerThe SyncProcessManagerImpl is an implementation of the SyncProcessManager interface. It coordinates the various elements from synctool that perform the synchronization activites.- Author:
- Daniel Bernstein
-
-
Constructor Summary
Constructors Constructor Description SyncProcessManagerImpl(SyncConfigurationManager syncConfigurationManager, ContentStoreManagerFactory contentStoreManagerFactory, SyncOptimizeManager syncOptimizeManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener)protected voidautomaticallyRestartIfAppropriate()voidclearError()voidclearFailures()SyncProcessErrorgetError()List<SyncSummary>getFailures()List<MonitoredFile>getMonitoredFiles()Returns a list of actively transfering (uploading) filesSyncProcessStategetProcessState()Returns an enum designating the runtime state of the sync processSyncProcessStatsgetProcessStats()Returns stats related the sync processList<File>getQueuedFiles()List<SyncSummary>getRecentlyCompleted()voidinit()voidpause()Pauses the sync process.voidremoveSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener)voidrestart()Equivalent to a stop and a restart.voidresume()Resumes the sync process from the paused state.voidshutdown()protected voidsleep()voidstart()Starts the sync process.voidstop()Stops the sync process.
-
-
-
Constructor Detail
-
SyncProcessManagerImpl
@Autowired public SyncProcessManagerImpl(SyncConfigurationManager syncConfigurationManager, ContentStoreManagerFactory contentStoreManagerFactory, SyncOptimizeManager syncOptimizeManager)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
automaticallyRestartIfAppropriate
protected void automaticallyRestartIfAppropriate()
-
getError
public SyncProcessError getError()
- Specified by:
getErrorin interfaceSyncProcessManager- Returns:
-
clearError
public void clearError()
- Specified by:
clearErrorin interfaceSyncProcessManager
-
start
public void start() throws SyncProcessExceptionDescription copied from interface:SyncProcessStarts the sync process. Invocations are ignored if the sync process is already running.- Specified by:
startin interfaceSyncProcess- Throws:
SyncProcessException
-
resume
public void resume() throws SyncProcessExceptionDescription copied from interface:SyncProcessResumes the sync process from the paused state. Invocations are ignored if the sync process is already running.- Specified by:
resumein interfaceSyncProcess- Throws:
SyncProcessException
-
stop
public void stop()
Description copied from interface:SyncProcessStops the sync process. Invocations are ignored if the sync process is already stopped. All work state is deleted. On start, the sync will start from scratch after this method has been invoked.- Specified by:
stopin interfaceSyncProcess
-
pause
public void pause()
Description copied from interface:SyncProcessPauses the sync process. Any any stored queue state information will be preserved when the sync process is restarted. It can be invoked from any state.- Specified by:
pausein interfaceSyncProcess
-
restart
public void restart()
Description copied from interface:SyncProcessEquivalent to a stop and a restart.- Specified by:
restartin interfaceSyncProcess
-
getProcessState
public SyncProcessState getProcessState()
Description copied from interface:SyncProcessReturns an enum designating the runtime state of the sync process- Specified by:
getProcessStatein interfaceSyncProcess- Returns:
-
getProcessStats
public SyncProcessStats getProcessStats()
Description copied from interface:SyncProcessReturns stats related the sync process- Specified by:
getProcessStatsin interfaceSyncProcess- Returns:
-
addSyncStateChangeListener
public void addSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener)
- Specified by:
addSyncStateChangeListenerin interfaceSyncProcessManager
-
removeSyncStateChangeListener
public void removeSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener)
- Specified by:
removeSyncStateChangeListenerin interfaceSyncProcessManager
-
sleep
protected void sleep()
-
getMonitoredFiles
public List<MonitoredFile> getMonitoredFiles()
Description copied from interface:SyncProcessManagerReturns a list of actively transfering (uploading) files- Specified by:
getMonitoredFilesin interfaceSyncProcessManager- Returns:
-
getFailures
public List<SyncSummary> getFailures()
- Specified by:
getFailuresin interfaceSyncProcessManager
-
getRecentlyCompleted
public List<SyncSummary> getRecentlyCompleted()
- Specified by:
getRecentlyCompletedin interfaceSyncProcessManager
-
getQueuedFiles
public List<File> getQueuedFiles()
- Specified by:
getQueuedFilesin interfaceSyncProcessManager- Returns:
-
clearFailures
public void clearFailures()
- Specified by:
clearFailuresin interfaceSyncProcessManager
-
shutdown
@PreDestroy public void shutdown()
-
-