com.dtolabs.rundeck.core.cli.run
Class RunTool

java.lang.Object
  extended by com.dtolabs.rundeck.core.cli.BaseTool
      extended by com.dtolabs.rundeck.core.cli.run.RunTool
All Implemented Interfaces:
CLITool, CLIToolLogger, BaseLogger

public class RunTool
extends BaseTool


Nested Class Summary
static class RunTool.Actions
          Enumeration of available actions
 
Field Summary
static java.lang.String ACTION_RUN
          run action identifier
static org.apache.log4j.Logger log4j
          log4j
 
Constructor Summary
RunTool()
          Create QueueTool with default Framework instances located by the system rdeck.base property.
RunTool(CLIToolLogger logger)
          Create QueueTool specifying the logger
RunTool(Framework framework)
          Create QueueTool specifying the framework
RunTool(Framework framework, CLIToolLogger logger)
          Create QueueTool with the framework.
 
Method Summary
 void debug(java.lang.String message)
          Logs debug message via implementation specific log facility
 void error(java.lang.String output)
          Logs error message via implementation specific log facility
 RunTool.Actions getAction()
          Get action
 java.lang.String getHelpString()
          Return the help string used when -h option is specified.
protected  void go()
          Call the action
protected  boolean isUseHelpOption()
          Return true if the -h/--help option should be added to the options automatically.
 void log(java.lang.String output)
          Logs message via implementation specific log facility
static void main(java.lang.String[] args)
          Creates an instance and executes BaseTool.run(String[]).
 org.apache.commons.cli.CommandLine parseArgs(java.lang.String[] args)
          Reads the argument vector and constructs a CommandLine object containing params
 void setAction(RunTool.Actions action)
          Set action
 void verbose(java.lang.String message)
          Logs verbose message via implementation specific log facility
 void warn(java.lang.String output)
          Logs warning message via implementation specific log facility
 
Methods inherited from class com.dtolabs.rundeck.core.cli.BaseTool
addToolOptions, exit, getCommandLine, getOptions, help, initOptions, run, setShouldExit, validateOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log4j

public static final org.apache.log4j.Logger log4j
log4j


ACTION_RUN

public static final java.lang.String ACTION_RUN
run action identifier

See Also:
Constant Field Values
Constructor Detail

RunTool

public RunTool()
Create QueueTool with default Framework instances located by the system rdeck.base property.


RunTool

public RunTool(CLIToolLogger logger)
Create QueueTool specifying the logger

Parameters:
logger - the logger

RunTool

public RunTool(Framework framework)
Create QueueTool specifying the framework

Parameters:
framework - framework

RunTool

public RunTool(Framework framework,
               CLIToolLogger logger)
Create QueueTool with the framework.

Parameters:
framework - the framework
logger - the logger
Method Detail

getAction

public RunTool.Actions getAction()
Get action

Returns:
action

setAction

public void setAction(RunTool.Actions action)
Set action

Parameters:
action - the action

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Creates an instance and executes BaseTool.run(String[]).

Parameters:
args - command line arg vector
Throws:
java.lang.Exception - action error

parseArgs

public org.apache.commons.cli.CommandLine parseArgs(java.lang.String[] args)
                                             throws CLIToolOptionsException
Reads the argument vector and constructs a CommandLine object containing params

Specified by:
parseArgs in interface CLITool
Overrides:
parseArgs in class BaseTool
Parameters:
args - the cli arg vector
Returns:
a new instance of CommandLine
Throws:
CLIToolOptionsException - if arguments are incorrect

go

protected void go()
           throws RunToolException,
                  CLIToolOptionsException
Call the action

Specified by:
go in class BaseTool
Throws:
JobsToolException - if an error occurs
RunToolException
CLIToolOptionsException

isUseHelpOption

protected boolean isUseHelpOption()
Description copied from class: BaseTool
Return true if the -h/--help option should be added to the options automatically.

Specified by:
isUseHelpOption in class BaseTool
Returns:

getHelpString

public java.lang.String getHelpString()
Description copied from class: BaseTool
Return the help string used when -h option is specified.

Specified by:
getHelpString in class BaseTool
Returns:

log

public void log(java.lang.String output)
Description copied from interface: BaseLogger
Logs message via implementation specific log facility

Parameters:
output - message to log

error

public void error(java.lang.String output)
Description copied from interface: BaseLogger
Logs error message via implementation specific log facility

Parameters:
output - message to log

warn

public void warn(java.lang.String output)
Description copied from interface: BaseLogger
Logs warning message via implementation specific log facility

Parameters:
output - message to log

verbose

public void verbose(java.lang.String message)
Logs verbose message via implementation specific log facility

Parameters:
message - message to log

debug

public void debug(java.lang.String message)
Description copied from interface: BaseLogger
Logs debug message via implementation specific log facility

Parameters:
message - message to log