Package org.duracloud.sync.mgmt
Class SyncManager
java.lang.Object
org.duracloud.sync.mgmt.SyncManager
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionSyncManager(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
Modifier and TypeMethodDescriptionvoidAllows 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.protected FilegetWatchDir(File changedFile) booleanhandleChangedFile(ChangedFile changedFile) Notifies the SyncManager that a file has changedvoid
-
Constructor Details
-
SyncManager
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 Details
-
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
Notifies the SyncManager that a file has changed- Specified by:
handleChangedFilein interfaceChangeHandler- Parameters:
changedFile- the changed file
-
getWatchDir
-
getFilesInTransfer
-