it.jnrpe.commands
Class CommandInvoker

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

public final class CommandInvoker
extends Object

This class is used to invoke a command.

Author:
Massimiliano Ziccardi

Constructor Summary
CommandInvoker(IPluginRepository pluginRepo, CommandRepository commandRepo, boolean acceptParams, Collection<IJNRPEEventListener> listeners)
          Builds and initializes the CommandInvoker object.
 
Method Summary
 ReturnValue invoke(CommandDefinition cd, String[] argsAry)
          This method executes external commands (plugins) The methods also expands the $ARG?$ macros.
 ReturnValue invoke(String commandName, String[] argsAry)
          This method executes built in commands or builds a CommandDefinition to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandInvoker

public CommandInvoker(IPluginRepository pluginRepo,
                      CommandRepository commandRepo,
                      boolean acceptParams,
                      Collection<IJNRPEEventListener> listeners)
Builds and initializes the CommandInvoker object.

Parameters:
pluginRepo - The plugin repository containing all the plugins that must be used by this invoker.
commandRepo - The command repository containing all the commands that must be used by this invoker.
listeners - All the listeners
Method Detail

invoke

public ReturnValue invoke(String commandName,
                          String[] argsAry)
This method executes built in commands or builds a CommandDefinition to. execute external commands (plugins). The methods also expands the $ARG?$ macros.

Parameters:
commandName - The name of the command, as configured in the server configuration XML
argsAry - The arguments to pass to the command as configured in the server configuration XML (with the $ARG?$ macros)
Returns:
The result of the command

invoke

public ReturnValue invoke(CommandDefinition cd,
                          String[] argsAry)
This method executes external commands (plugins) The methods also expands the $ARG?$ macros.

Parameters:
cd - The command definition
argsAry - The arguments to pass to the command as configured in the server configuration XML (with the $ARG?$ macros)
Returns:
The result of the command


Copyright © 2014. All Rights Reserved.