OpenNMS API 1.2.3

org.opennms.netmgt.discovery
Class Discovery

java.lang.Object
  extended byorg.opennms.netmgt.discovery.Discovery
All Implemented Interfaces:
Fiber, PausableFiber

public final class Discovery
extends java.lang.Object
implements PausableFiber

This class is the main interface to the OpenNMS discovery service. The class implements the singleton design pattern, in that there is only one instance in any given virtual machine. The service delays the reading of configuration information until the service is started.

Author:
Brian Weaver , OpenNMS.org

Field Summary
private static char COMMENT_CHAR
          This character at the start of a line indicates a comment line in a URL file
private static java.lang.String COMMENT_STR
          The string indicating the start of the comments in a line containing the IP address in a file URL
private static java.lang.String LOG4J_CATEGORY
          The log4j category used to log messages.
private  BroadcastEventProcessor m_eventReader
          The class instance used to recieve new events from for the system.
private  SuspectEventGenerator m_eventWriter
          The fiber that generates and sends suspect events
private  IPGenerator m_generator
          The IP Generator queue
private  PingManager m_manager
          The ICMP Poller Manager class.
private static Discovery m_singleton
          The singular instance of the discovery service.
private  int m_status
          The current status of this fiber
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
private Discovery()
          Constructs a new discovery instance.
 
Method Summary
private  boolean addToSpecificsFromURL(java.util.List specifics, java.lang.String url, long timeout, int retries)
           The file URL is read and a 'specific IP' is added for each entry in this file.
static Discovery getInstance()
          Returns the singulare instance of the discovery process
 java.lang.String getName()
          Returns the name of this fiber.
 int getStatus()
          Returns the current status of the discovery process.
 void init()
           
 void pause()
          Pauses the discovery process if its currently running
 void resume()
          Resumes the discovery process if its currently paused
 void start()
           This method is used to start the discovery process.
 void stop()
          Stops the current discovery process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
The log4j category used to log messages.

See Also:
Constant Field Values

COMMENT_STR

private static final java.lang.String COMMENT_STR
The string indicating the start of the comments in a line containing the IP address in a file URL

See Also:
Constant Field Values

COMMENT_CHAR

private static final char COMMENT_CHAR
This character at the start of a line indicates a comment line in a URL file

See Also:
Constant Field Values

m_singleton

private static final Discovery m_singleton
The singular instance of the discovery service.


m_generator

private IPGenerator m_generator
The IP Generator queue


m_eventWriter

private SuspectEventGenerator m_eventWriter
The fiber that generates and sends suspect events


m_eventReader

private BroadcastEventProcessor m_eventReader
The class instance used to recieve new events from for the system.


m_manager

private PingManager m_manager
The ICMP Poller Manager class. This manager iterates over the address range, using the IPGenerator, checking for available systems.


m_status

private int m_status
The current status of this fiber

Constructor Detail

Discovery

private Discovery()
Constructs a new discovery instance.

Method Detail

addToSpecificsFromURL

private boolean addToSpecificsFromURL(java.util.List specifics,
                                      java.lang.String url,
                                      long timeout,
                                      int retries)
 The file URL is read and a 'specific IP' is added for each entry
  in this file. Each line in the URL file can be one of -
  <IP><space>#<comments>
  or
  <IP>
  or
  #<comments>
 
  Lines starting with a '#' are ignored and so are characters after
  a '<space>#' in a line.
 

Parameters:
specifics - the list to add to
url - the URL file
timeout - the timeout for all entries in this URL
retries - the retries for all entries in this URL

init

public void init()

start

public void start()

This method is used to start the discovery process. When called the discovery configuration file is parsed and the internal state for discovery is setup. If the discovery process has already started then an exception is generated.

The discovery process may be restarted if, and only if, is has first been stopped.

Specified by:
start in interface Fiber
Throws:
java.lang.IllegalStateException - Thrown if the service is already running.
java.lang.reflect.UndeclaredThrowableException - Thrown if an error occurs that is not recoverable.

stop

public void stop()
Stops the current discovery process. After a successful call this method the discovery process may be restared.

Specified by:
stop in interface Fiber

getStatus

public int getStatus()
Returns the current status of the discovery process.

Specified by:
getStatus in interface Fiber
Returns:
The current status of the Fiber.

getName

public java.lang.String getName()
Returns the name of this fiber.

Specified by:
getName in interface Fiber
Returns:
The name of the Fiber.

pause

public void pause()
Pauses the discovery process if its currently running

Specified by:
pause in interface PausableFiber

resume

public void resume()
Resumes the discovery process if its currently paused

Specified by:
resume in interface PausableFiber

getInstance

public static Discovery getInstance()
Returns the singulare instance of the discovery process


OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.