Package org.syncany.operations.up
Class UpOperation
- java.lang.Object
-
- org.syncany.operations.Operation
-
- org.syncany.operations.AbstractTransferOperation
-
- org.syncany.operations.up.UpOperation
-
public class UpOperation extends AbstractTransferOperation
The up operation implements a central part of Syncany's business logic. It analyzes the local folder, deduplicates new or changed files and uploads newly packed multichunks to the remote storage. The up operation is the complement to theDownOperation
.The general operation flow is as follows:
- Load local database (if not already loaded)
- Analyze local directory using the
StatusOperation
to determine any changed/new/deleted files - Determine if there are unknown remote databases using the
LsRemoteOperation
, and skip the rest if there are - If there are changes, use the
Deduper
andIndexer
to create a newDatabaseVersion
(including new chunks, multichunks, file contents and file versions). - Upload new multichunks (if any) using a
TransferManager
- Save new
DatabaseVersion
to a new (delta)MemoryDatabase
and upload it - Add delta database to local database and store it locally
UpOperationOptions
. If a sequence of transactions is interrupted, all queued transactions are written to disk to be resumed later. The next up operation then reads these transactions and resumes them in the same order as they were queued before the interruption.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTION_ID
-
Fields inherited from class org.syncany.operations.AbstractTransferOperation
actionHandler, eventBus, transferManager
-
-
Constructor Summary
Constructors Constructor Description UpOperation(Config config)
UpOperation(Config config, UpOperationOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UpOperationResult
execute()
Executes the operation synchronously and returns a result when the operation exits.protected void
saveDeltaDatabase(MemoryDatabase db, java.io.File localDatabaseFile)
Serializes aMemoryDatabase
to a file, using the configured transformer.-
Methods inherited from class org.syncany.operations.AbstractTransferOperation
finishOperation, getLastRemoteCleanupNumber, getNewestDatabaseFileVersion, otherRemoteOperationsRunning, startOperation
-
-
-
-
Field Detail
-
ACTION_ID
public static final java.lang.String ACTION_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpOperation
public UpOperation(Config config)
-
UpOperation
public UpOperation(Config config, UpOperationOptions options)
-
-
Method Detail
-
execute
public UpOperationResult execute() throws java.lang.Exception
Description copied from class:Operation
Executes the operation synchronously and returns a result when the operation exits. Using covariance is recommend, that is OperationFoo should override execute so as to return a OperationFooResult rather than OperationResult.
-
saveDeltaDatabase
protected void saveDeltaDatabase(MemoryDatabase db, java.io.File localDatabaseFile) throws java.io.IOException
Serializes aMemoryDatabase
to a file, using the configured transformer.- Throws:
java.io.IOException
-
-