it.jnrpe
Class JNRPE

java.lang.Object
  extended by it.jnrpe.JNRPE

public final class JNRPE
extends Object

This class is the real JNRPE worker. It must be used to start listening for NRPE requests

Author:
Massimiliano Ziccardi

Constructor Summary
JNRPE(PluginRepository pluginRepository, CommandRepository commandRepository)
          Initializes the JNRPE worker.
 
Method Summary
 void addAcceptedHost(String sAddress)
          Adds an address to the list of accepted hosts.
 void addEventListener(IJNRPEEventListener listener)
          Adds a new event listener.
 IJNRPEListener listen(String sAddress, int iPort)
          Instructs the server to listen to the given IP/port.
 IJNRPEListener listen(String sAddress, int iPort, boolean bSSL)
          Starts a new thread that listen for requests.
 void shutdown()
          Shuts down all the listener handled by this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNRPE

public JNRPE(PluginRepository pluginRepository,
             CommandRepository commandRepository)
Initializes the JNRPE worker.

Parameters:
pluginRepository - The repository containing all the installed plugins
commandRepository - The repository containing all the configured commands.
Method Detail

listen

public IJNRPEListener listen(String sAddress,
                             int iPort)
Instructs the server to listen to the given IP/port.

Parameters:
sAddress - The address to bind to
iPort - The port to bind to
Returns:
the listener

addEventListener

public void addEventListener(IJNRPEEventListener listener)
Adds a new event listener.

Parameters:
listener - The event listener to be added

listen

public IJNRPEListener listen(String sAddress,
                             int iPort,
                             boolean bSSL)
Starts a new thread that listen for requests. The method is not blocking

Parameters:
sAddress - The address to bind to
iPort - The listening port
bSSL - true if an SSL socket must be created.
Returns:
Returns the newly created thread.

addAcceptedHost

public void addAcceptedHost(String sAddress)
Adds an address to the list of accepted hosts.

Parameters:
sAddress - The address to accept

shutdown

public void shutdown()
Shuts down all the listener handled by this instance.



Copyright © 2012. All Rights Reserved.