org.fusesource.process.manager.support.command
Class Command
java.lang.Object
org.fusesource.process.manager.support.command.Command
public class Command
- extends java.lang.Object
|
Constructor Summary |
Command(java.util.List<java.lang.String> command,
java.util.Set<java.lang.Integer> successfulExitCodes,
java.io.File directory,
java.util.Map<java.lang.String,java.lang.String> environment,
Duration timeLimit)
|
Command(java.lang.String... command)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Command
public Command(java.lang.String... command)
Command
public Command(java.util.List<java.lang.String> command,
java.util.Set<java.lang.Integer> successfulExitCodes,
java.io.File directory,
java.util.Map<java.lang.String,java.lang.String> environment,
Duration timeLimit)
getCommand
public java.util.List<java.lang.String> getCommand()
addArgs
public Command addArgs(java.lang.String... args)
addArgs
public Command addArgs(java.lang.Iterable<java.lang.String> args)
getEnvironment
public java.util.Map<java.lang.String,java.lang.String> getEnvironment()
addEnvironment
public Command addEnvironment(java.lang.String name,
java.lang.String value)
addEnvironment
public Command addEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
getSuccessfulExitCodes
public java.util.Set<java.lang.Integer> getSuccessfulExitCodes()
setSuccessfulExitCodes
public Command setSuccessfulExitCodes(int... successfulExitCodes)
setSuccessfulExitCodes
public Command setSuccessfulExitCodes(java.util.Set<java.lang.Integer> successfulExitCodes)
getDirectory
public java.io.File getDirectory()
setDirectory
public Command setDirectory(java.lang.String directory)
setDirectory
public Command setDirectory(java.io.File directory)
getTimeLimit
public Duration getTimeLimit()
setTimeLimit
public Command setTimeLimit(double value,
java.util.concurrent.TimeUnit timeUnit)
setTimeLimit
public Command setTimeLimit(Duration timeLimit)
execute
public int execute(java.util.concurrent.Executor executor)
throws CommandFailedException
- Throws:
CommandFailedException
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
logOutput
public void logOutput(java.lang.String out)
- Logs output of the command to some console or file
Copyright © 2013 Red Hat. All Rights Reserved.