Class Command
- java.lang.Object
-
- org.opennms.features.jmxconfiggenerator.commands.Command
-
- Direct Known Subclasses:
GraphCreateCommand,JmxCommand,Starter
public abstract class Command extends Object
Overall Command class to group the available commands and provide common methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConsoleLogAdapterLOG
-
Constructor Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidexecute()Each subclass should implement an execute methode to implement its behaviour.protected abstract StringgetDescription()Returns the description (used for the usage) of the command.protected org.kohsuke.args4j.CmdLineParsergetParser()protected booleanisHelp()voidprintUsage()Prints the usage of the command.voidrun(org.kohsuke.args4j.CmdLineParser parser)This method is invoked by the Main method to start the execution of the Command.protected abstract voidvalidate(org.kohsuke.args4j.CmdLineParser parser)
-
-
-
Field Detail
-
LOG
protected final ConsoleLogAdapter LOG
-
-
Method Detail
-
isHelp
protected boolean isHelp()
-
run
public void run(org.kohsuke.args4j.CmdLineParser parser) throws CmdRunException, org.kohsuke.args4j.CmdLineExceptionThis method is invoked by the Main method to start the execution of the Command.- Parameters:
parser-- Throws:
IOExceptionorg.kohsuke.args4j.CmdLineExceptionCmdRunException
-
execute
protected abstract void execute() throws CmdRunException, org.kohsuke.args4j.CmdLineExceptionEach subclass should implement an execute methode to implement its behaviour.- Throws:
IOExceptionorg.kohsuke.args4j.CmdLineExceptionCmdRunException
-
validate
protected abstract void validate(org.kohsuke.args4j.CmdLineParser parser) throws org.kohsuke.args4j.CmdLineException- Throws:
org.kohsuke.args4j.CmdLineException
-
printUsage
public void printUsage()
Prints the usage of the command.
-
getParser
protected org.kohsuke.args4j.CmdLineParser getParser()
-
getDescription
protected abstract String getDescription()
Returns the description (used for the usage) of the command.- Returns:
- the command's description (used for the usage).
-
-