it.jnrpe.commands
Class CommandInvoker

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

public class CommandInvoker
extends Object

This class is used to invoke a command.

Author:
Massimiliano Ziccardi

Constructor Summary
CommandInvoker(PluginRepository pluginRepository, CommandRepository commandRepository)
           
 
Method Summary
 ReturnValue invoke(CommandDefinition cd, String[] args)
          This method executes external commands (plugins) The methods also expands the $ARG?
 ReturnValue invoke(String sCommandName, String[] args)
          This method executes built in commands or builds a CommandDefinition to execute external commands (plugins).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandInvoker

public CommandInvoker(PluginRepository pluginRepository,
                      CommandRepository commandRepository)
Method Detail

invoke

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

Parameters:
sCommandName - The name of the command, as configured in the server configuration XML
args - 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[] args)
This method executes external commands (plugins) The methods also expands the $ARG?$ macros

Parameters:
cd - The command definition
args - 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 © 2011. All Rights Reserved.