com.dtolabs.rundeck.core.cli.project
Class ProjectTool

java.lang.Object
  extended by com.dtolabs.rundeck.core.cli.project.ProjectTool
All Implemented Interfaces:
ActionMaker, CLITool, CLIToolLogger, BaseLogger

public class ProjectTool
extends java.lang.Object
implements ActionMaker, CLITool

Main class for creating new projects. This is called via rd-project shell command.


Field Summary
static java.lang.String ACTION_CREATE
           
static java.lang.String ACTION_REMOVE
           
protected  org.apache.commons.cli.CommandLine cli
          Reference to command line params
protected static org.apache.commons.cli.Options options
          reference to the command line Options instance.
 
Constructor Summary
ProjectTool()
           
ProjectTool(java.io.File baseDir)
           
 
Method Summary
 Action createAction(java.lang.String actionName)
           
 void debug(java.lang.String message)
          Logs debug message via implementation specific log facility
 void error(java.lang.String output)
          Interfaces for the CLIToolLogger
 void executeAction()
          Executes the setup helper actions
 void exit(int code)
          Calls the exit method
 void help()
          prints usage info
 void initArgs()
          ActionMaker interface implementations
 boolean isOverwrite()
           
 void log(java.lang.String message)
          Logs message via implementation specific log facility
static void main(java.lang.String[] args)
          Creates an instance and executes run(String[]).
 org.apache.commons.cli.CommandLine parseArgs(java.lang.String[] args)
          processes the command line input
 void run(java.lang.String[] args)
          Runs the initArgs and go methods.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_CREATE

public static final java.lang.String ACTION_CREATE
See Also:
Constant Field Values

ACTION_REMOVE

public static final java.lang.String ACTION_REMOVE
See Also:
Constant Field Values

cli

protected org.apache.commons.cli.CommandLine cli
Reference to command line params


options

protected static final org.apache.commons.cli.Options options
reference to the command line Options instance.

Constructor Detail

ProjectTool

public ProjectTool()

ProjectTool

public ProjectTool(java.io.File baseDir)
Method Detail

main

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

Parameters:
args -
Throws:
java.lang.Exception

run

public final void run(java.lang.String[] args)
Runs the initArgs and go methods.

Specified by:
run in interface CLITool
Parameters:
args - Command line arg vector

exit

public void exit(int code)
Calls the exit method

Specified by:
exit in interface CLITool
Parameters:
code - return code to exit with

help

public void help()
prints usage info

Specified by:
help in interface CLITool

executeAction

public void executeAction()
                   throws ProjectToolException
Executes the setup helper actions

Throws:
ProjectToolException - thrown if action failed

parseArgs

public org.apache.commons.cli.CommandLine parseArgs(java.lang.String[] args)
                                             throws ProjectToolException
processes the command line input

Specified by:
parseArgs in interface CLITool
Parameters:
args - command line arg vector
Returns:
a new instance of CommandLine
Throws:
ProjectToolException

initArgs

public void initArgs()
ActionMaker interface implementations

Specified by:
initArgs in interface ActionMaker

isOverwrite

public boolean isOverwrite()
Specified by:
isOverwrite in interface ActionMaker

createAction

public Action createAction(java.lang.String actionName)
Specified by:
createAction in interface ActionMaker

error

public void error(java.lang.String output)
Interfaces for the CLIToolLogger

Specified by:
error in interface BaseLogger
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

Specified by:
warn in interface BaseLogger
Parameters:
output - message to log

log

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

Specified by:
log in interface BaseLogger
Parameters:
message - message to log

verbose

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

Specified by:
verbose in interface BaseLogger
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

Specified by:
debug in interface BaseLogger
Parameters:
message - message to log