Package org.syncany.operations
Class AbstractTransferOperation
- java.lang.Object
-
- org.syncany.operations.Operation
-
- org.syncany.operations.AbstractTransferOperation
-
- Direct Known Subclasses:
CleanupOperation
,DownOperation
,RestoreOperation
,UpOperation
public abstract class AbstractTransferOperation extends Operation
Represents and is inherited by a transfer operation. Transfer operations are operations that modify the repository and/or are relevant for the consistency of the local directory or the remote repository.This abstract class offers convenience methods to handle
ActionRemoteFile
as well as to handle the connection and local cache.
-
-
Field Summary
Fields Modifier and Type Field Description protected ActionFileHandler
actionHandler
protected LocalEventBus
eventBus
protected TransactionAwareFeatureTransferManager
transferManager
-
Constructor Summary
Constructors Constructor Description AbstractTransferOperation(Config config, java.lang.String operationName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finishOperation()
protected long
getLastRemoteCleanupNumber(java.util.Map<java.lang.String,CleanupRemoteFile> cleanupFiles)
protected long
getNewestDatabaseFileVersion(java.lang.String client, java.util.List<DatabaseRemoteFile> knownDatabases)
This method is used to determine how a database file should be named when it is about to be uploaded.protected boolean
otherRemoteOperationsRunning(java.lang.String... operationIdentifiers)
protected void
startOperation()
-
-
-
Field Detail
-
transferManager
protected TransactionAwareFeatureTransferManager transferManager
-
actionHandler
protected ActionFileHandler actionHandler
-
eventBus
protected LocalEventBus eventBus
-
-
Constructor Detail
-
AbstractTransferOperation
public AbstractTransferOperation(Config config, java.lang.String operationName)
-
-
Method Detail
-
startOperation
protected void startOperation() throws java.lang.Exception
- Throws:
java.lang.Exception
-
finishOperation
protected void finishOperation() throws StorageException
- Throws:
StorageException
-
otherRemoteOperationsRunning
protected boolean otherRemoteOperationsRunning(java.lang.String... operationIdentifiers) throws StorageException
- Throws:
StorageException
-
getNewestDatabaseFileVersion
protected long getNewestDatabaseFileVersion(java.lang.String client, java.util.List<DatabaseRemoteFile> knownDatabases)
This method is used to determine how a database file should be named when it is about to be uploaded. It returns the number of the newest database file (which is the highest number).- Parameters:
client
- name of the client for which we want to upload a database version.knownDatabases
- all DatabaseRemoteFiles present in the repository- Returns:
- the largest database fileversion number.
-
getLastRemoteCleanupNumber
protected long getLastRemoteCleanupNumber(java.util.Map<java.lang.String,CleanupRemoteFile> cleanupFiles)
-
-