Package org.duracloud.sync.endpoint
Interface SyncEndpoint
-
- All Known Implementing Classes:
DuraStoreChunkSyncEndpoint,DuraStoreSyncEndpoint,FileSystemSyncEndpoint
public interface SyncEndpointEndpoint to which files are synchronized.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddEndPointListener(EndPointListener listener)Registers a listenervoiddeleteContent(String spaceId, String contentId)Removes content from the endpoint.Iterator<String>getFilesList()Retrieves a listing of all files available at the endpoint.voidremoveEndPointListener(EndPointListener listener)Unregisters a listenerbooleansyncFile(MonitoredFile file, File watchDir)Ensures that the endpoint includes a file equivalent to the provided local file: - If the local file exists but no file with the same path exists at the endpoint, the local file will be copied to the endpoint - If the local file exists and is different from a file with the same path at the endpoint, the local file will replace the file at the endpoint.SyncResultTypesyncFileAndReturnDetailedResult(MonitoredFile monitoredFile, File watchDir)An alternate form of the syncFile method that returns a more nuanced result.
-
-
-
Method Detail
-
syncFile
boolean syncFile(MonitoredFile file, File watchDir)
Ensures that the endpoint includes a file equivalent to the provided local file: - If the local file exists but no file with the same path exists at the endpoint, the local file will be copied to the endpoint - If the local file exists and is different from a file with the same path at the endpoint, the local file will replace the file at the endpoint. - If the local file does not exist (it has been deleted), a file with the same path will be removed at the endpoint (if it exists)- Parameters:
file- local file to sync with the endpointwatchDir- the directory under watch in which this file resides- Returns:
- true if file was successfully synced, false otherwise
-
getFilesList
Iterator<String> getFilesList()
Retrieves a listing of all files available at the endpoint. This list is to be used for comparison with the local system.- Returns:
- Iterator allowing access to complete file listing
-
addEndPointListener
void addEndPointListener(EndPointListener listener)
Registers a listener- Parameters:
listener-
-
removeEndPointListener
void removeEndPointListener(EndPointListener listener)
Unregisters a listener- Parameters:
listener-
-
syncFileAndReturnDetailedResult
SyncResultType syncFileAndReturnDetailedResult(MonitoredFile monitoredFile, File watchDir)
An alternate form of the syncFile method that returns a more nuanced result.- Parameters:
monitoredFile-watchDir-- Returns:
-
deleteContent
void deleteContent(String spaceId, String contentId) throws ContentStoreException
Removes content from the endpoint.- Parameters:
spaceId-contentId-- Throws:
ContentStoreException
-
-