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
ActionRemoteFileas well as to handle the connection and local cache.
-
-
Field Summary
Fields Modifier and Type Field Description protected ActionFileHandleractionHandlerprotected LocalEventBuseventBusprotected TransactionAwareFeatureTransferManagertransferManager
-
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 voidfinishOperation()protected longgetLastRemoteCleanupNumber(java.util.Map<java.lang.String,CleanupRemoteFile> cleanupFiles)protected longgetNewestDatabaseFileVersion(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 booleanotherRemoteOperationsRunning(java.lang.String... operationIdentifiers)protected voidstartOperation()
-
-
-
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)
-
-