|
OpenNMS API 1.1.4 | |||||||||
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.
Nested Class Summary | |
private static class |
OutageWriter.IfSvcSnmpEntry
A class to hold SNMP/SNMPv2 entries for a node from the ifservices table. |
Field Summary | |
private Event |
m_event
The event from which data is to be read. |
private boolean |
m_generateNodeDeletedEvent
|
private static java.lang.String |
SNMP_SVC
|
private static java.lang.String |
SNMPV2_SVC
|
Constructor Summary | |
OutageWriter(Event event)
The constructor. |
Method Summary | |
private java.sql.Timestamp |
convertEventTimeIntoTimestamp(java.lang.String eventTime)
Convert event time into timestamp |
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 long |
getServiceID(java.lang.String name)
This method is used to convert the service name into a service id. |
private void |
handleInterfaceDown(long eventID,
long nodeID,
java.lang.String ipAddr,
java.lang.String eventTime)
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,
long nodeID,
java.lang.String ipAddr,
java.lang.String eventTime)
Handles interface up events. |
private void |
handleNodeDown(long eventID,
long nodeID,
java.lang.String eventTime)
Handles node down events. |
private void |
handleNodeLostService(long eventID,
long nodeID,
java.lang.String ipAddr,
long serviceID,
java.lang.String eventTime)
Handles node lost service events. |
private void |
handleNodeRegainedService(long eventID,
long nodeID,
java.lang.String ipAddr,
long serviceID,
java.lang.String eventTime)
Hanlde node regained service events. |
private void |
handleNodeUp(long eventID,
long nodeID,
java.lang.String eventTime)
Handle node up events. |
private boolean |
openOutageExists(java.sql.Connection dbConn,
long nodeId)
This method checks the outage table and determines if an open outage entry exists for the specified node id. |
private boolean |
openOutageExists(java.sql.Connection dbConn,
long nodeId,
java.lang.String ipAddr)
This method checks the outage table and determines if an open outage entry exists for the specified node/ip pair. |
private boolean |
openOutageExists(java.sql.Connection dbConn,
long nodeId,
java.lang.String ipAddr,
long serviceId)
This method checks the outage table and determines if an open outage entry exists for the specified node/ip/service tuple. |
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
Constructor Detail |
public OutageWriter(Event event)
event
- the event for this outage writer.Method Detail |
private java.sql.Timestamp convertEventTimeIntoTimestamp(java.lang.String eventTime)
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 boolean openOutageExists(java.sql.Connection dbConn, long nodeId) throws java.sql.SQLException
java.sql.SQLException
- if database error encountered.private boolean openOutageExists(java.sql.Connection dbConn, long nodeId, java.lang.String ipAddr) throws java.sql.SQLException
java.sql.SQLException
- if database error encountered.private boolean openOutageExists(java.sql.Connection dbConn, long nodeId, java.lang.String ipAddr, long serviceId) throws java.sql.SQLException
java.sql.SQLException
- if database error encountered.private void handleNodeLostService(long eventID, long nodeID, java.lang.String ipAddr, long serviceID, java.lang.String eventTime)
private void handleInterfaceDown(long eventID, long nodeID, java.lang.String ipAddr, java.lang.String eventTime)
private void handleNodeDown(long eventID, long nodeID, java.lang.String eventTime)
private void handleNodeUp(long eventID, long nodeID, java.lang.String eventTime)
private void handleInterfaceUp(long eventID, long nodeID, java.lang.String ipAddr, java.lang.String eventTime)
private void handleNodeRegainedService(long eventID, long nodeID, java.lang.String ipAddr, long serviceID, java.lang.String eventTime)
private 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 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()
public void run()
run
in interface java.lang.Runnable
|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |