Groovy Documentation

org.linkedin.glu.commands.impl
[Groovy] Interface CommandExecutionIOStorage


interface CommandExecutionIOStorage

This class encapsulates the storage of IO for commands, this way it is easy to "disable" the storage.

Authors:
yan@pongasoft.com


Method Summary
CommandExecution createStorageForCommandExecution(java.lang.Object args)

@param gluCommandFactory create storage for command execution

CommandExecution findCommandExecution(java.lang.String commandId)

@return the command of a previously run/stored command

java.lang.Object findCommandExecutionAndStreams(java.lang.String commandId, java.lang.Object args)

This method allows you to start streaming the results (stdout, stderr,...) while the command is still running.

java.lang.Object withOrWithoutCommandExecutionAndStreams(java.lang.String commandId, java.lang.Object args, groovy.lang.Closure closure)

Similar to findCommandExecutionAndStreams but calls the closure with the map or with null

 

Method Detail

createStorageForCommandExecution

CommandExecution createStorageForCommandExecution(java.lang.Object args)
Parameters:
gluCommandFactory - create storage for command execution


findCommandExecution

CommandExecution findCommandExecution(java.lang.String commandId)
Returns:
the command of a previously run/stored command


findCommandExecutionAndStreams

java.lang.Object findCommandExecutionAndStreams(java.lang.String commandId, java.lang.Object args)
This method allows you to start streaming the results (stdout, stderr,...) while the command is still running.
Parameters:
args.exitValueStream - if you want the exit value to be part of the stream (boolean, optional, false by default)
args.exitValueStreamTimeout - how long to wait to get the exit value if the command is not completed yet (optional, in the event that exitValueStream is set to true and exitValueStreamTimeout is not provided, it will not block and return no exit value stream)
args.stdinStream - if you want stdin to be part of the stream (boolean, optional, false by default)
args.stdinOffset - where to start in the stdin stream (optional, int, 0 by default)
args.stdinLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
args.stdoutStream - if you want stdout to be part of the stream (boolean, optional, false by default)
args.stdoutOffset - where to start in the stdout stream (optional, int, 0 by default)
args.stdoutLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
args.stderrStream - if you want stdout to be part of the stream (boolean, optional, false by default)
args.stderrOffset - where to start in the stdout stream (optional, int, 0 by default)
args.stderrLen - how many bytes to read maximum (optional, int, -1 by default which means read all)
Returns:
a map with commandExecution and stream (if any) (null if no such command)


withOrWithoutCommandExecutionAndStreams

java.lang.Object withOrWithoutCommandExecutionAndStreams(java.lang.String commandId, java.lang.Object args, groovy.lang.Closure closure)
Similar to findCommandExecutionAndStreams but calls the closure with the map or with null
Returns:
whatever the closure returns


 

Groovy Documentation