|
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.outage.OutageWriter
When a 'nodeLostService' is received, it is made sure that there is no 'open' outage record in the 'outages' table for this nodeid/ipaddr/serviceid - i.e that there is not already a record for this n/i/s where the 'lostService' time is known and the 'regainedService' time is NULL - if there is, the current 'lostService' event is ignored else a new outage is created. The 'interfaceDown' is similar to the 'nodeLostService' except that it acts relevant to a nodeid/ipaddr combination and a 'nodeDown' acts on a nodeid. When a 'nodeRegainedService' is received and there is an 'open' outage for the nodeid/ipaddr/serviceid, the outage is cleared. If not, the event is placed in the event cache in case a race condition has occurred that puts the "up" event in before the "down" event. (currently inactive). The 'interfaceUp' is similar to the 'nodeRegainedService' except that it acts relevant to a nodeid/ipaddr combination and a 'nodeUp' acts on a nodeid. When a 'deleteService' is received, the appropriate entry is marked for deletion is the 'ifservices' table - if this entry is the only entry for a node/ip combination, the corresponding entry in the 'ipinterface' table is marked for deletion and this is then cascaded to the node table All deletions are followed by an appropriate event(serviceDeleted or interfaceDeleted or..) being generated and sent to eventd. When an 'interfaceReparented' event is received, 'outages' table entries associated with the old nodeid/interface pairing are changed so that those outage entries will be associated with the new nodeid/interface pairing. The nodeLostService, interfaceDown, nodeDown, nodeUp, interfaceUp, nodeRegainedService, deleteService events update the svcLostEventID and the svcRegainedEventID fields as approppriate. The interfaceReparented event has no impact on these eventid reference fields.
Field Summary | |
private Event |
m_event
The event from which data is to be read. |
private boolean |
m_generateNodeDeletedEvent
|
private BasicNetwork |
m_network
|
private OutageManager |
m_outageMgr
|
private static java.lang.String |
SNMP_SVC
|
private static java.lang.String |
SNMPV2_SVC
|
Constructor Summary | |
OutageWriter(OutageManager mgr,
Event event)
The constructor. |
Method Summary | |
private Event |
createEvent(java.lang.String uei,
java.util.Date eventDate,
long nodeID,
java.lang.String ipAddr,
java.lang.String serviceName)
This method creates an event for the passed parameters. |
private java.sql.Connection |
getConnection()
|
private BasicInterface |
getInterface(long nodeID,
java.lang.String ipAddr)
|
private BasicNetwork |
getNetwork()
|
private BasicNode |
getNode(long nodeID)
|
private BasicService |
getService(BasicInterface iface,
long serviceID)
|
private BasicService |
getService(long nodeID,
java.lang.String ipAddr,
long serviceID)
|
private long |
getServiceID(java.lang.String name)
This method is used to convert the service name into a service id. |
private void |
handleInterfaceDown(long eventID,
java.lang.String eventTime,
BasicInterface iface)
Handles interface down events. |
private void |
handleInterfaceReparented(java.lang.String ipAddr,
Parms eventParms)
Record the 'interfaceReparented' event in the outages table. |
private void |
handleInterfaceUp(long eventID,
java.lang.String eventTime,
BasicInterface iface)
Handles interface up events. |
private void |
handleNodeDown(long eventID,
java.lang.String eventTime,
BasicNode node)
Handles node down events. |
private void |
handleNodeLostService(long eventID,
java.lang.String eventTime,
BasicService svc)
Handles node lost service events. |
private void |
handleNodeRegainedService(long eventID,
java.lang.String eventTime,
BasicService svc)
Hanlde node regained service events. |
private void |
handleNodeUp(long eventID,
java.lang.String eventTime,
BasicNode node)
Handle node up events. |
private void |
processEvent()
Process an event. |
void |
run()
Process the event depending on the UEI. |
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 SNMP_SVC
private static final java.lang.String SNMPV2_SVC
private Event m_event
private boolean m_generateNodeDeletedEvent
private OutageManager m_outageMgr
private BasicNetwork m_network
Constructor Detail |
public OutageWriter(OutageManager mgr, Event event)
mgr
- event
- the event for this outage writer.Method Detail |
private long getServiceID(java.lang.String name) throws java.sql.SQLException
This method is used to convert the service name into a service id. It first looks up the information from a service map in OutagesManager and if no match is found, by performing a lookup in the database. If the conversion is successful then the corresponding integer identifier will be returned to the caller.
name
- The name of the service
java.sql.SQLException
- if there is an error accessing the stored data, the SQL text
is malformed, or the result cannot be obtained.DB_GET_SVC_ID
private void handleNodeLostService(long eventID, java.lang.String eventTime, BasicService svc)
private void handleInterfaceDown(long eventID, java.lang.String eventTime, BasicInterface iface)
private void handleNodeDown(long eventID, java.lang.String eventTime, BasicNode node)
private void handleNodeUp(long eventID, java.lang.String eventTime, BasicNode node)
private void handleInterfaceUp(long eventID, java.lang.String eventTime, BasicInterface iface)
private void handleNodeRegainedService(long eventID, java.lang.String eventTime, BasicService svc)
svc
- TODOprivate void handleInterfaceReparented(java.lang.String ipAddr, Parms eventParms)
Record the 'interfaceReparented' event in the outages table. Change'outages' table entries associated with the old nodeid/interface pairing so that those outage entries will be associated with the new nodeid/interface pairing.
Note: This event has no impact on the event id reference fields
private java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
private BasicNetwork getNetwork()
private Event createEvent(java.lang.String uei, java.util.Date eventDate, long nodeID, java.lang.String ipAddr, java.lang.String serviceName)
uei
- Event to generate and sendeventDate
- Time to be set for the eventnodeID
- Node identifier associated with this eventipAddr
- Interface address associated with this eventserviceName
- Service name associated with this eventprivate void processEvent()
private BasicNode getNode(long nodeID)
private BasicInterface getInterface(long nodeID, java.lang.String ipAddr)
private BasicService getService(long nodeID, java.lang.String ipAddr, long serviceID)
private BasicService getService(BasicInterface iface, long serviceID)
public void run()
run
in interface java.lang.Runnable
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |