Package org.syncany.cli
Class UpCommand
- java.lang.Object
 - 
- org.syncany.cli.Command
 - 
- org.syncany.cli.UpCommand
 
 
 
- 
- 
Constructor Summary
Constructors Constructor Description UpCommand() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExecuteInDaemonScope()Returns whether a command can be run inside the scope of the daemon.intexecute(java.lang.String[] operationArgs)This method implements the command-specific option-parsing, operation calling and output printing.CommandScopegetRequiredCommandScope()A command can either be executed within an initialized local directory or in a regular (non-Syncany) directory.voidonIndexMidEventReceived(UpIndexMidSyncExternalEvent syncEvent)voidonIndexStartEventReceived(UpIndexStartSyncExternalEvent syncEvent)voidonLsRemoteStartEventReceived(LsRemoteStartSyncExternalEvent syncEvent)voidonStatusStartEventReceived(StatusStartSyncExternalEvent syncEvent)voidonUpStartEventReceived(UpStartSyncExternalEvent syncEvent)UpOperationOptionsparseOptions(java.lang.String[] operationArgs)A command can typically be configured using command line options.voidprintResults(OperationResult operationResult)A command typically prints a result to the console. 
 - 
 
- 
- 
Constructor Detail
- 
UpCommand
public UpCommand()
 
 - 
 
- 
Method Detail
- 
getRequiredCommandScope
public CommandScope getRequiredCommandScope()
Description copied from class:CommandA command can either be executed within an initialized local directory or in a regular (non-Syncany) directory. Syncany determines this by searching for a .syncany folder.The required command scope resembles whether or not a command must be executed inside a .syncany directory or not -- or whether it does not matter.
- Specified by:
 getRequiredCommandScopein classCommand- Returns:
 - Returns the required command scope of the command
 
 
- 
canExecuteInDaemonScope
public boolean canExecuteInDaemonScope()
Description copied from class:CommandReturns whether a command can be run inside the scope of the daemon.If a folder is daemon-managed, the command line client passes the command to the daemon via REST and the daemon executes this command/operation. For some commands, this does not make sense or is dangerous. This method allows certain commands to be daemon-enabled, and other to be daemon-disabled.
- Specified by:
 canExecuteInDaemonScopein classCommand
 
- 
execute
public int execute(java.lang.String[] operationArgs) throws java.lang.Exception
Description copied from class:CommandThis method implements the command-specific option-parsing, operation calling and output printing. To do so, the method must read and evaluate the given arguments, prepare a corresponding operation, call it and display the results according to a well-defined format.Implementations should not move any business logic in the execute method (or any other parts of the command).
 
- 
parseOptions
public UpOperationOptions parseOptions(java.lang.String[] operationArgs) throws java.lang.Exception
Description copied from class:CommandA command can typically be configured using command line options. This method parses these command line options and returns anOperationOptionsobject representing the options.- Specified by:
 parseOptionsin classCommand- Throws:
 java.lang.Exception
 
- 
printResults
public void printResults(OperationResult operationResult)
Description copied from class:CommandA command typically prints a result to the console. This method takes anOperationResultobject and formats it to be human-readable.- Specified by:
 printResultsin classCommand
 
- 
onUpStartEventReceived
public void onUpStartEventReceived(UpStartSyncExternalEvent syncEvent)
 
- 
onStatusStartEventReceived
public void onStatusStartEventReceived(StatusStartSyncExternalEvent syncEvent)
 
- 
onLsRemoteStartEventReceived
public void onLsRemoteStartEventReceived(LsRemoteStartSyncExternalEvent syncEvent)
 
- 
onIndexStartEventReceived
public void onIndexStartEventReceived(UpIndexStartSyncExternalEvent syncEvent)
 
- 
onIndexMidEventReceived
public void onIndexMidEventReceived(UpIndexMidSyncExternalEvent syncEvent)
 
 - 
 
 -