public abstract class AbstractLogCommandOutput extends Object implements CommandOutput
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLogCommandOutput.DebugLogCommandOutput
Logs the output as debug level.
|
static class |
AbstractLogCommandOutput.ErrorLogCommandOutput
Logs the output as error level.
|
static class |
AbstractLogCommandOutput.InfoLogCommandOutput
Logs the output as info level.
|
static class |
AbstractLogCommandOutput.TraceLogCommandOutput
Logs the output as trace level.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
| Modifier and Type | Method and Description |
|---|---|
CommandOutput |
call()
Reads the standard output from the connected stream.
|
abstract AbstractLogCommandOutput |
clone()
Clones the standard output reader.
|
static AbstractLogCommandOutput.DebugLogCommandOutput |
createDebugLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static AbstractLogCommandOutput.ErrorLogCommandOutput |
createErrorLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static AbstractLogCommandOutput.InfoLogCommandOutput |
createInfoLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static AbstractLogCommandOutput.TraceLogCommandOutput |
createTraceLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
String |
getCommand()
Returns the command for the logging message.
|
CommandLine |
getCommandLine()
Returns the command line for the logging message.
|
InputStream |
getInput()
Returns the stream that is connected to output of the executed command.
|
org.slf4j.Logger |
getLogger()
Returns the logger that is filled with the piped to the output of the
command.
|
String |
getMessage()
Returns the message string.
|
protected abstract void |
logLine(String line)
Log the line red from the command output.
|
void |
setBufferSize(int size)
Sets the buffer size.
|
void |
setInput(InputStream stream)
Sets the stream that is connected to output of the executed command.
|
void |
setLogger(org.slf4j.Logger logger)
Sets the logger that is filled with the piped to the output of the
command.
|
void |
setMessage(String message)
Sets the message string.
|
String |
toString() |
protected AbstractLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine)
logger - the Logger.commandLine - the the CommandLine for the logging message.public static AbstractLogCommandOutput.InfoLogCommandOutput createInfoLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
public static AbstractLogCommandOutput.DebugLogCommandOutput createDebugLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
public static AbstractLogCommandOutput.TraceLogCommandOutput createTraceLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
public static AbstractLogCommandOutput.ErrorLogCommandOutput createErrorLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
public void setInput(InputStream stream)
CommandOutputsetInput in interface CommandOutputstream - the InputStream.public InputStream getInput()
InputStream.public void setBufferSize(int size)
size - the size in bytes.public void setLogger(org.slf4j.Logger logger)
logger - the Logger.public org.slf4j.Logger getLogger()
Logger.public CommandLine getCommandLine()
CommandLine.public String getCommand()
String command.public void setMessage(String message)
message - the String message.public CommandOutput call() throws Exception
CommandOutputcall in interface CommandOutputcall in interface Callable<CommandOutput>Exceptionpublic abstract AbstractLogCommandOutput clone()
CommandOutputclone in interface CommandOutputclone in class ObjectCommandOutput.protected abstract void logLine(String line)
line - the String line.Copyright © 2014. All rights reserved.