public abstract class

BaseCommand

extends Object
implements AsyncCommand<T> Command<T>
java.lang.Object
   ↳ com.atlassian.bitbucket.scm.BaseCommand<T>

Class Overview

Wrapper around Atlassian's process utils.

Summary

Protected Constructors
@Deprecated BaseCommand(List<String> arguments, Map<String, String> environment, File workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)
BaseCommand(List<String> arguments, Map<String, String> environment, Path workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)
@Deprecated BaseCommand(String binary, String command, Map<String, String> environment, File workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)
This constructor is deprecated. in 6.4 for removal in 7.0. Use BaseCommand(List, Map, Path, CommandExitHandler, CommandInputHandler, CommandOutputHandler, CommandErrorHandler) instead and pass an assembled list of arguments.
Public Methods
@Nonnull AsyncCommand<T> asynchronous()
@Nullable T call()
void setExecutionTimeout(long timeoutInSecs)
void setIdleTimeout(long timeoutInSecs)
@Nonnull Future<T> start()
@Nonnull Command<T> synchronous()
@Nonnull String toString()
Protected Methods
@Deprecated void addArgument(Object... options)
This method is deprecated. in 6.4 for removal without replacement in 7.0; arguments should be assembled before creating the command, and passed to the constructor
void callExitHandler()
@Nonnull OutputHandler getErrorHandler()
@Nullable InputHandler getInputHandler()
@Nonnull OutputHandler getOutputHandler()
@Nonnull ProcessHandler getProcessHandler()
@Nullable abstract T getResult()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bitbucket.scm.AsyncCommand
From interface com.atlassian.bitbucket.scm.Command
From interface java.util.concurrent.Callable

Protected Constructors

@Deprecated protected BaseCommand (List<String> arguments, Map<String, String> environment, File workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)

This constructor is deprecated.
in 6.4 for removal in 7.0. Use BaseCommand(List, Map, Path, CommandExitHandler, CommandInputHandler, CommandOutputHandler, CommandErrorHandler) instead

Parameters
arguments the arguments, including the binary, which should be used to assemble the command line
environment (Optional) environment variables to apply to the new process
workDir (Optional) the working directory for the new process
exitHandler (Optional) a handler to apply to the process's exit code
inputHandler (Optional) a handler to provide stdin to the new process
outputHandler (Optional) a handler to read stdout from the new process
errorHandler (Optional) a handler to read stderr from the new process

protected BaseCommand (List<String> arguments, Map<String, String> environment, Path workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)

Parameters
arguments the arguments, including the binary, which should be used to assemble the command line
environment (Optional) environment variables to apply to the new process
workDir (Optional) the working directory for the new process
exitHandler (Optional) a handler to apply to the process's exit code
inputHandler (Optional) a handler to provide stdin to the new process
outputHandler (Optional) a handler to read stdout from the new process
errorHandler (Optional) a handler to read stderr from the new process

@Deprecated protected BaseCommand (String binary, String command, Map<String, String> environment, File workDir, CommandExitHandler exitHandler, CommandInputHandler inputHandler, CommandOutputHandler<T> outputHandler, CommandErrorHandler errorHandler)

This constructor is deprecated.
in 6.4 for removal in 7.0. Use BaseCommand(List, Map, Path, CommandExitHandler, CommandInputHandler, CommandOutputHandler, CommandErrorHandler) instead and pass an assembled list of arguments.

Parameters
binary the binary to run for the new process
command (Optional) a single additional argument to add to the command line
environment (Optional) environment variables to apply to the new process
workDir (Optional) the working directory for the new process
exitHandler (Optional) a handler to apply to the process's exit code
inputHandler (Optional) a handler to provide stdin to the new process
outputHandler (Optional) a handler to read stdout from the new process
errorHandler (Optional) a handler to read stderr from the new process

Public Methods

@Nonnull public AsyncCommand<T> asynchronous ()

@Nullable public T call ()

public void setExecutionTimeout (long timeoutInSecs)

public void setIdleTimeout (long timeoutInSecs)

@Nonnull public Future<T> start ()

@Nonnull public Command<T> synchronous ()

@Nonnull public String toString ()

Protected Methods

@Deprecated protected void addArgument (Object... options)

This method is deprecated.
in 6.4 for removal without replacement in 7.0; arguments should be assembled before creating the command, and passed to the constructor

Parameters
options one or more arguments to add

protected void callExitHandler ()

@Nonnull protected OutputHandler getErrorHandler ()

@Nullable protected InputHandler getInputHandler ()

@Nonnull protected OutputHandler getOutputHandler ()

@Nonnull protected ProcessHandler getProcessHandler ()

@Nullable protected abstract T getResult ()