Package org.duracloud.sync.mgmt
Class SyncManager
- java.lang.Object
-
- org.duracloud.sync.mgmt.SyncManager
-
- All Implemented Interfaces:
ChangeHandler
public class SyncManager extends Object implements ChangeHandler
The SyncManager is responsible to watch for new entries in the ChangedList and make sure those changes are pushed to the SyncEndpoint.
-
-
Constructor Summary
Constructors Constructor Description SyncManager(List<File> watchDirs, SyncEndpoint endpoint, int threads, long frequency)Creates a SyncManager which, when started, will watch for updates to the ChangedList and kick off SyncWorkers to handle any changed files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginSync()Allows the SyncManager to begin watching for updates to the ChangedListvoidendSync()Stops the sync, no further changed files will be handled after those which are in progress have completed.List<MonitoredFile>getFilesInTransfer()protected FilegetWatchDir(File changedFile)booleanhandleChangedFile(ChangedFile changedFile)Notifies the SyncManager that a file has changedvoidterminateSync()
-
-
-
Constructor Detail
-
SyncManager
public SyncManager(List<File> watchDirs, SyncEndpoint endpoint, int threads, long frequency)
Creates a SyncManager which, when started, will watch for updates to the ChangedList and kick off SyncWorkers to handle any changed files.- Parameters:
endpoint-threads-frequency-
-
-
Method Detail
-
beginSync
public void beginSync()
Allows the SyncManager to begin watching for updates to the ChangedList
-
endSync
public void endSync()
Stops the sync, no further changed files will be handled after those which are in progress have completed.
-
terminateSync
public void terminateSync()
-
handleChangedFile
public boolean handleChangedFile(ChangedFile changedFile)
Notifies the SyncManager that a file has changed- Specified by:
handleChangedFilein interfaceChangeHandler- Parameters:
changedFile- the changed file
-
getFilesInTransfer
public List<MonitoredFile> getFilesInTransfer()
-
-