it.jnrpe.commands
Class CommandDefinition

java.lang.Object
  extended by it.jnrpe.commands.CommandDefinition

public final class CommandDefinition
extends Object

Container class for command definition configuration.

Author:
Massimiliano Ziccardi

Constructor Summary
CommandDefinition(String commandName, String cmdPluginName)
          Builds and initializes the command definition.
 
Method Summary
 CommandDefinition addArgument(CommandOption arg)
          Adds an option to the command definition.
 String getArgs()
          The raw command line of this command.
 String[] getCommandLine()
          Merges the command line definition read from the server config file with.
 String getName()
          Returns the command name.
 Collection<CommandOption> getOptions()
           
 String getPluginName()
          Returns the name of the plugin associated with this command.
 void setArgs(String args)
          Sets the raw arguments of this command.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandDefinition

public CommandDefinition(String commandName,
                         String cmdPluginName)
Builds and initializes the command definition.

Parameters:
commandName - The command name
cmdPluginName - The plugin associated with this command
Method Detail

setArgs

public void setArgs(String args)
Sets the raw arguments of this command.

Parameters:
args - The command line

getName

public String getName()
Returns the command name.

Returns:
The command name

getPluginName

public String getPluginName()
Returns the name of the plugin associated with this command.

Returns:
The name of the plugin associated with this command

getArgs

public String getArgs()
The raw command line of this command.

Returns:
The raw command line

getCommandLine

public String[] getCommandLine()
Merges the command line definition read from the server config file with. the values received from check_nrpe and produces a clean command line.

Returns:
a parsable command line

addArgument

public CommandDefinition addArgument(CommandOption arg)
Adds an option to the command definition.

Parameters:
arg - The option to be added
Returns:
This object.

getOptions

public Collection<CommandOption> getOptions()
Returns:
all the command options.


Copyright © 2014. All Rights Reserved.