Package org.syncany.operations
Class ActionFileHandler
- java.lang.Object
-
- org.syncany.operations.ActionFileHandler
-
public class ActionFileHandler extends java.lang.Object
The action handler manages theActionRemoteFile
s written during anOperation
.In particular, it uploads an initial action file when the operation is started, deletes it when it is finished/terminated, and renews the operation's action file in a given interval.
The renewal is necessary to show other clients that the operation is still running. To ensure action file renewal, the
start()
method starts a timer that uploads a newActionRemoteFile
everyACTION_RENEWAL_INTERVAL
milliseconds. Thefinish()
method stops this timer.- See Also:
CleanupOperation
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACTION_RENEWAL_INTERVAL
Defines the time that the action files updated while an operation is running.
-
Constructor Summary
Constructors Constructor Description ActionFileHandler(TransferManager transferManager, java.lang.String operationName, java.lang.String machineName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish()
void
start()
-
-
-
Field Detail
-
ACTION_RENEWAL_INTERVAL
public static final int ACTION_RENEWAL_INTERVAL
Defines the time that the action files updated while an operation is running. This time period must be (significantly) smaller than the ignore time defined inAbstractTransferOperation.ACTION_FILE_DELETE_TIME
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ActionFileHandler
public ActionFileHandler(TransferManager transferManager, java.lang.String operationName, java.lang.String machineName)
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
finish
public void finish() throws StorageException
- Throws:
StorageException
-
-