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 SyncProcessManager
The 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
ConstructorsConstructorDescriptionSyncProcessManagerImpl(SyncConfigurationManager syncConfigurationManager, ContentStoreManagerFactory contentStoreManagerFactory, SyncOptimizeManager syncOptimizeManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSyncStateChangeListener(SyncStateChangeListener syncStateChangeListener) protected voidvoidvoidgetError()Returns a list of actively transfering (uploading) filesReturns an enum designating the runtime state of the sync processReturns stats related the sync processvoidinit()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 Details
-
SyncProcessManagerImpl
@Autowired public SyncProcessManagerImpl(SyncConfigurationManager syncConfigurationManager, ContentStoreManagerFactory contentStoreManagerFactory, SyncOptimizeManager syncOptimizeManager)
-
-
Method Details
-
init
@PostConstruct public void init() -
automaticallyRestartIfAppropriate
protected void automaticallyRestartIfAppropriate() -
getError
- Specified by:
getErrorin interfaceSyncProcessManager- Returns:
-
clearError
public void clearError()- Specified by:
clearErrorin interfaceSyncProcessManager
-
start
Description copied from interface:SyncProcessStarts the sync process. Invocations are ignored if the sync process is already running.- Specified by:
startin interfaceSyncProcess- Throws:
SyncProcessException
-
resume
Description 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
Description copied from interface:SyncProcessReturns an enum designating the runtime state of the sync process- Specified by:
getProcessStatein interfaceSyncProcess- Returns:
-
getProcessStats
Description copied from interface:SyncProcessReturns stats related the sync process- Specified by:
getProcessStatsin interfaceSyncProcess- Returns:
-
addSyncStateChangeListener
- Specified by:
addSyncStateChangeListenerin interfaceSyncProcessManager
-
removeSyncStateChangeListener
- Specified by:
removeSyncStateChangeListenerin interfaceSyncProcessManager
-
sleep
protected void sleep() -
getMonitoredFiles
Description copied from interface:SyncProcessManagerReturns a list of actively transfering (uploading) files- Specified by:
getMonitoredFilesin interfaceSyncProcessManager- Returns:
-
getFailures
- Specified by:
getFailuresin interfaceSyncProcessManager
-
getRecentlyCompleted
- Specified by:
getRecentlyCompletedin interfaceSyncProcessManager
-
getQueuedFiles
- Specified by:
getQueuedFilesin interfaceSyncProcessManager- Returns:
-
clearFailures
public void clearFailures()- Specified by:
clearFailuresin interfaceSyncProcessManager
-
shutdown
@PreDestroy public void shutdown()
-