it.jnrpe.plugins
Class PluginProxy

java.lang.Object
  extended by it.jnrpe.plugins.PluginBase
      extended by it.jnrpe.plugins.PluginProxy
All Implemented Interfaces:
IPluginInterface, IPluginInterfaceEx

public final class PluginProxy
extends PluginBase

This class was intended to abstract the kind of plugin to execute. Hides command line parsing from command invoker.

Author:
Massimiliano Ziccardi

Constructor Summary
PluginProxy(IPluginInterface plugin, PluginDefinition pluginDef)
          Instantiate a new plugin proxy.
 
Method Summary
 ReturnValue execute(ICommandLine cl)
          Not used.
 ReturnValue execute(String[] argsAry)
          Executes the proxied plugin passing the received arguments as parameters.
 Collection<PluginOption> getOptions()
          Returns a collection of all the options accepted by this plugin.
 void printHelp()
          Prints the help related to the plugin to standard output.
 void printHelp(PrintWriter out)
          Prints the help related to the plugin to a specified output.
 
Methods inherited from class it.jnrpe.plugins.PluginBase
addListener, addListeners, configureThresholdEvaluatorBuilder, gatherMetrics, sendEvent, sendEvent, sendEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginProxy

public PluginProxy(IPluginInterface plugin,
                   PluginDefinition pluginDef)
Instantiate a new plugin proxy.

Parameters:
plugin - The plugin to be proxied
pluginDef - The plugin definition of the plugin to be proxied
Method Detail

getOptions

public Collection<PluginOption> getOptions()
Returns a collection of all the options accepted by this plugin.

Returns:
a collection of plugin options.

execute

public ReturnValue execute(String[] argsAry)
                    throws BadThresholdException
Executes the proxied plugin passing the received arguments as parameters.

Parameters:
argsAry - The parameters to be passed to the plugin
Returns:
The return value of the plugin.
Throws:
BadThresholdException - -

printHelp

public void printHelp(PrintWriter out)
Prints the help related to the plugin to a specified output.

Parameters:
out - the writer where the help should be written

printHelp

public void printHelp()
Prints the help related to the plugin to standard output.


execute

public ReturnValue execute(ICommandLine cl)
Not used.

Specified by:
execute in interface IPluginInterface
Overrides:
execute in class PluginBase
Parameters:
cl - Not used
Returns:
null.


Copyright © 2014. All Rights Reserved.