|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.discovery.Discovery
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.
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 |
private static final java.lang.String LOG4J_CATEGORY
private static final java.lang.String COMMENT_STR
private static final char COMMENT_CHAR
private static final Discovery m_singleton
private IPGenerator m_generator
private SuspectEventGenerator m_eventWriter
private BroadcastEventProcessor m_eventReader
private PingManager m_manager
private int m_status
Constructor Detail |
private Discovery()
Method Detail |
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.
specifics
- the list to add tourl
- the URL filetimeout
- the timeout for all entries in this URLretries
- the retries for all entries in this URLpublic void init()
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.
start
in interface Fiber
java.lang.IllegalStateException
- Thrown if the service is already running.
java.lang.reflect.UndeclaredThrowableException
- Thrown if an error occurs that is not recoverable.public void stop()
stop
in interface Fiber
public int getStatus()
getStatus
in interface Fiber
Fiber
.public java.lang.String getName()
getName
in interface Fiber
Fiber
.public void pause()
pause
in interface PausableFiber
public void resume()
resume
in interface PausableFiber
public static Discovery getInstance()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |