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(IPluginRepository pluginRepo, CommandRepository commandRepo)
          Initializes the JNRPE worker.
 
Method Summary
 void addAcceptedHost(String address)
          Adds an address to the list of accepted hosts.
 void addEventListener(IJNRPEEventListener listener)
          Adds a new event listener.
 void listen(String address, int port)
          Instructs the server to listen to the given IP/port.
 void listen(String address, int port, boolean useSSL)
          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(IPluginRepository pluginRepo,
             CommandRepository commandRepo)
Initializes the JNRPE worker.

Parameters:
pluginRepo - The repository containing all the installed plugins
commandRepo - The repository containing all the configured commands.
Method Detail

listen

public void listen(String address,
                   int port)
            throws UnknownHostException
Instructs the server to listen to the given IP/port.

Parameters:
address - The address to bind to
port - The port to bind to
Throws:
UnknownHostException - -

addEventListener

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

Parameters:
listener - The event listener to be added

listen

public void listen(String address,
                   int port,
                   boolean useSSL)
            throws UnknownHostException
Starts a new thread that listen for requests. The method is not blocking

Parameters:
address - The address to bind to
port - The listening port
useSSL - true if an SSL socket must be created.
Throws:
UnknownHostException - -

addAcceptedHost

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

Parameters:
address - The address to accept

shutdown

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



Copyright © 2014. All Rights Reserved.