|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.capsd.BroadcastEventProcessor
Field Summary | |
private java.lang.String |
m_localServer
local openNMS server name |
private Scheduler |
m_scheduler
The Capsd rescan scheduler |
private FifoQueue |
m_suspectQ
The location where suspectInterface events are enqueued for processing. |
private boolean |
m_xmlrpc
Boolean flag to indicate if need to notify external xmlrpc server with event processing failure. |
private static java.lang.String |
SQL_ADD_INTERFACE_TO_SERVER
SQL statement used to add an interface/server mapping into the database; |
private static java.lang.String |
SQL_ADD_SERVICE_TO_MAPPING
SQL statement used to add an interface/service mapping into the database. |
private static java.lang.String |
SQL_COUNT_INTERFACES_ON_NODE
SQL statement used to count all the interface on a node |
private static java.lang.String |
SQL_DELETE_ALL_INTERFACES_ON_NODE
SQL statement used to delete all the ipinterfaces with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_ALL_SERVICES_INTERFACE_MAPPING
SQL statement used to delete all services mapping to a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_ASSETS_ON_NODE
SQL statement used to delete all assets from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_EVENTS_ON_INTERFACE
SQL statement used to delete all events associated with a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_EVENTS_ON_NODE
SQL statement used to delete all events from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_IFSERVICES_ON_INTERFACE
SQL statement used to delete all ifservices from the database with a specified interface. |
private static java.lang.String |
SQL_DELETE_IFSERVICES_ON_NODE
SQL statement used to delete all ifservices from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_INTERFACE
SQL statement used to delete an ipinterfac with a specified nodeid and ipaddress. |
private static java.lang.String |
SQL_DELETE_INTERFACE_ON_SERVER
SQL statement used to delete an interface/server mapping from the database. |
private static java.lang.String |
SQL_DELETE_NODEID
SQL statement used to delete a node from the database with a specified nodelabel. |
private static java.lang.String |
SQL_DELETE_NOTIFICATIONS_ON_INTERFACE
SQL statement used to delete all notifications associated with a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_NOTIFICATIONS_ON_NODE
SQL statement used to delete all notifications from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_OUTAGES_ON_INTERFACE
SQL statement used to delete all notifications associated with a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_OUTAGES_ON_NODE
SQL statement used to delete all outages from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_SERVICE_INTERFACE_MAPPING
SQL statement used to delete an interface/service mapping from the database. |
private static java.lang.String |
SQL_DELETE_SNMPINTERFACE_ON_INTERFACE
SQL statement used to delete the snmpinterface entry associated with a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_SNMPINTERFACE_ON_NODE
SQL statement used to delete all snmpinterface from the database with a specified nodeid. |
private static java.lang.String |
SQL_DELETE_USERSNOTIFIED_ON_INTERFACE
SQL statement used to delete all usersnotified info associated with a specified interface from the database. |
private static java.lang.String |
SQL_DELETE_USERSNOTIFIED_ON_NODE
SQL statement used to delete all usersNotified from the database with a specified nodeid. |
private static java.lang.String |
SQL_FIND_SERVICES_ON_NODE
SQL statement used to count all the interface on a node |
private static java.lang.String |
SQL_QUERY_INTERFACE_ON_SERVER
SQL statement used to query if an interface/server mapping already exists in the database. |
private static java.lang.String |
SQL_QUERY_IPADDRESS_EXIST
SQL statement used to verify if an ipinterface with the specified ip address exists in the database and retrieve the nodeid if exists. |
private static java.lang.String |
SQL_QUERY_IPINTERFACE_EXIST
SQL statement used to query the 'node' and 'ipinterface' tables to verify if a specified ipaddr and node label have already exist in the database. |
private static java.lang.String |
SQL_QUERY_NODE_EXIST
SQL statement used to query if a node with the specified nodelabel exist in the database, and the nodeid from the database if exists. |
private static java.lang.String |
SQL_QUERY_PRIMARY_INTERFACE
SQL statement used to query if an interface is the snmp primary interface of a node. |
private static java.lang.String |
SQL_QUERY_SERVICE_EXIST
SQL statement used to verify if an ifservice with the specified ip address and service name exists in the database. |
private static java.lang.String |
SQL_QUERY_SERVICE_MAPPING_EXIST
SQL statement used to query if an interface/service mapping already exists in the database. |
private static java.lang.String |
SQL_RETRIEVE_NODEID
SQL query to retrieve nodeid of a particulary interface address |
private static java.lang.String |
SQL_RETRIEVE_SERVICE_ID
SQL statement used to retrieve the serviced id from the database with a specified service name. |
Constructor Summary | |
(package private) |
BroadcastEventProcessor(FifoQueue suspectQ,
Scheduler scheduler)
Constructor |
Method Summary | |
private void |
addInterfaceHandler(Event event)
Process the event, add the specified interface into database. |
private void |
addNode(java.sql.Connection conn,
java.lang.String nodeLabel,
java.lang.String ipaddr,
long txNo,
java.lang.String callerUei)
This method add a node with the specified node label and the secified IP address to the database. |
private void |
addNodeHandler(Event event)
Process the event, add a node with the specified node label and interface to the database |
private void |
changeServiceHandler(Event event)
Process the event, add or remove a specified service from an interface. |
void |
close()
Unsubscribe from eventd |
private void |
createAndSendAddInterfaceEvent(java.lang.String nodeLabel,
java.lang.String ipaddr,
java.lang.String hostName,
long txNo,
java.lang.String callerUei)
This method is responsible for generating an addInterface event and sending it to eventd.. |
private void |
createAndSendChangeServiceEvent(java.lang.String ipaddr,
java.lang.String service,
java.lang.String action,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a changeService event and sending it to eventd.. |
private void |
createAndSendDeleteInterfaceEvent(java.lang.String nodeLabel,
java.lang.String ipaddr,
java.lang.String hostName,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a deleteInterface event and sending it to eventd.. |
private void |
createAndSendDeleteNodeEvent(java.lang.String hostName,
java.lang.String nodeLabel,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a deleteNode event and sending it to eventd.. |
private void |
createAndSendDeleteServiceEvent(DbNodeEntry nodeEntry,
java.net.InetAddress ifaddr,
java.lang.String service,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a deleteService event and sending it to eventd.. |
private void |
createAndSendForceRescanEvent(java.lang.String hostName,
long nodeId)
This method is responsible for generating a forceRescan event and sending it to eventd.. |
private void |
createAndSendInterfaceDeletedEvent(int nodeId,
java.lang.String hostName,
java.lang.String ipaddr,
long txNo,
java.lang.String callerUei)
This method is responsible for generating an interfaceDeleted event and sending it to eventd... |
private void |
createAndSendNodeAddedEvent(DbNodeEntry nodeEntry,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a nodeAdded event and sending it to eventd.. |
private void |
createAndSendNodeDeletedEvent(int nodeId,
java.lang.String hostName,
java.lang.String nodeLabel,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a nodeDeleted event and sending it to eventd.. |
private void |
createAndSendNodeGainedInterfaceEvent(DbNodeEntry nodeEntry,
java.net.InetAddress ifaddr,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a nodeGainedInterface event and sending it to eventd.. |
private void |
createAndSendNodeGainedServiceEvent(DbNodeEntry nodeEntry,
java.net.InetAddress ifaddr,
java.lang.String service,
long txNo,
java.lang.String callerUei)
This method is responsible for generating a nodeGainedService event and sending it to eventd.. |
private void |
createMessageSelectorAndSubscribe()
Create message selector to set to the subscription |
private void |
deleteInterfaceHandler(Event event)
This method handles the deletion of an interface. |
private void |
deleteNodeHandler(Event event)
This method handles the deletion of a node. |
java.lang.String |
getLocalServer()
Get the local server name |
java.lang.String |
getName()
Return an id for this event listener |
void |
onEvent(Event event)
This method is invoked by the EventIpcManager when a new event is available for processing. |
private void |
sendEvent(Event event)
|
private void |
sendServiceDeletedEvent(int node,
java.lang.String iface,
java.lang.String svcname)
|
private void |
updateServerHandler(Event event)
Process the event, add or remove a specified interface from an opennms server. |
private void |
updateServiceHandler(Event event)
Process the event, add or remove a specified interface/service pair into the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.lang.String SQL_RETRIEVE_NODEID
private static java.lang.String SQL_QUERY_IPINTERFACE_EXIST
private static java.lang.String SQL_QUERY_NODE_EXIST
private static java.lang.String SQL_QUERY_SERVICE_EXIST
private static java.lang.String SQL_QUERY_IPADDRESS_EXIST
private static java.lang.String SQL_RETRIEVE_SERVICE_ID
private static java.lang.String SQL_DELETE_ALL_INTERFACES_ON_NODE
private static java.lang.String SQL_DELETE_INTERFACE
private static java.lang.String SQL_DELETE_NODEID
private static java.lang.String SQL_DELETE_USERSNOTIFIED_ON_NODE
private static java.lang.String SQL_DELETE_NOTIFICATIONS_ON_NODE
private static java.lang.String SQL_DELETE_OUTAGES_ON_NODE
private static java.lang.String SQL_DELETE_EVENTS_ON_NODE
private static java.lang.String SQL_DELETE_IFSERVICES_ON_NODE
private static java.lang.String SQL_DELETE_SNMPINTERFACE_ON_NODE
private static java.lang.String SQL_DELETE_ASSETS_ON_NODE
private static java.lang.String SQL_DELETE_USERSNOTIFIED_ON_INTERFACE
private static java.lang.String SQL_DELETE_NOTIFICATIONS_ON_INTERFACE
private static java.lang.String SQL_DELETE_OUTAGES_ON_INTERFACE
private static java.lang.String SQL_DELETE_EVENTS_ON_INTERFACE
private static java.lang.String SQL_DELETE_SNMPINTERFACE_ON_INTERFACE
private static java.lang.String SQL_QUERY_PRIMARY_INTERFACE
private static java.lang.String SQL_DELETE_IFSERVICES_ON_INTERFACE
private static java.lang.String SQL_QUERY_INTERFACE_ON_SERVER
private static java.lang.String SQL_QUERY_SERVICE_MAPPING_EXIST
private static java.lang.String SQL_DELETE_INTERFACE_ON_SERVER
private static java.lang.String SQL_ADD_INTERFACE_TO_SERVER
private static java.lang.String SQL_ADD_SERVICE_TO_MAPPING
private static java.lang.String SQL_DELETE_ALL_SERVICES_INTERFACE_MAPPING
private static java.lang.String SQL_DELETE_SERVICE_INTERFACE_MAPPING
private static java.lang.String SQL_COUNT_INTERFACES_ON_NODE
private static java.lang.String SQL_FIND_SERVICES_ON_NODE
private FifoQueue m_suspectQ
private Scheduler m_scheduler
private boolean m_xmlrpc
private java.lang.String m_localServer
Constructor Detail |
BroadcastEventProcessor(FifoQueue suspectQ, Scheduler scheduler)
suspectQ
- The queue where new SuspectEventProcessor objects
are enqueued for running..scheduler
- Rescan scheduler.Method Detail |
private void createMessageSelectorAndSubscribe()
public java.lang.String getLocalServer()
public void close()
private void addNodeHandler(Event event)
event
- The event to process.private void addNode(java.sql.Connection conn, java.lang.String nodeLabel, java.lang.String ipaddr, long txNo, java.lang.String callerUei) throws java.sql.SQLException, java.net.UnknownHostException
conn
- The JDBC Database connection.nodeLabel
- the node label to identify the node to create.ipaddr
- the ipaddress to be added into the ipinterface table.txNo
- the transaction no.callerUei
- the uei of the caller event
java.sql.SQLException
java.net.UnknownHostException
private void createAndSendNodeAddedEvent(DbNodeEntry nodeEntry, long txNo, java.lang.String callerUei)
nodeEntry
- The node Added.txNo
- the transaction no.callerUei
- the Uei of the caller event.private void createAndSendNodeGainedInterfaceEvent(DbNodeEntry nodeEntry, java.net.InetAddress ifaddr, long txNo, java.lang.String callerUei)
nodeEntry
- The node that gained the interface.ifaddr
- the interface gained on the node.txNo
- the transaction no.callerUei
- the uei of the caller event.private void deleteNodeHandler(Event event)
1. removing the node specified in the deleteNode event from the database. 2. delete all IP addresses associated with this node from the database. 3. delete all services being polled from this node from the database 4. issue an nodeDeleted event so that this node will be removed from the Poller's pollable node map, and all the servies polling from this node shall be stopped. 5. delete all info associated with this node from the database, such as notifications, events, outages etc.
private void createAndSendNodeDeletedEvent(int nodeId, java.lang.String hostName, java.lang.String nodeLabel, long txNo, java.lang.String callerUei)
nodeId
- Nodeid of the node got deleted.hostName
- the Host server name.nodeLabel
- the node label of the deleted node.callerUei
- the uei of the caller event.private void sendServiceDeletedEvent(int node, java.lang.String iface, java.lang.String svcname)
private void sendEvent(Event event)
private void addInterfaceHandler(Event event)
event
- The event to process.private void deleteInterfaceHandler(Event event)
1. stop all services associated with the specified interface. 2. removing all services associated with the interface. 3. remove the interface from the database. 4. issue an interfaceDeleted event to stop polling all the services on this interface
private void createAndSendDeleteNodeEvent(java.lang.String hostName, java.lang.String nodeLabel, long txNo, java.lang.String callerUei)
hostName
- the Host server name.nodeLabel
- the nodelabel of the deleted node.txNo
- the external transaction No of the event.callerUei
- the uei of the caller event.private void createAndSendForceRescanEvent(java.lang.String hostName, long nodeId)
hostName
- the Host server name.nodeId
- the node ID of the node to rescan.private void createAndSendInterfaceDeletedEvent(int nodeId, java.lang.String hostName, java.lang.String ipaddr, long txNo, java.lang.String callerUei)
nodeId
- Nodeid of the node that the deleted interface resides on.hostName
- the Host server name.ipaddr
- the ipaddress of the deleted Interface.txNo
- the external transaction No. of the original event.callerUei
- the uei of the caller eventprivate void changeServiceHandler(Event event)
event
- The event to process.private void createAndSendNodeGainedServiceEvent(DbNodeEntry nodeEntry, java.net.InetAddress ifaddr, java.lang.String service, long txNo, java.lang.String callerUei)
nodeEntry
- The node that gained the service.ifaddr
- the interface gained the service.service
- the service gained.txNo
- the transaction no.callerUei
- the uei of the caller event.private void createAndSendDeleteServiceEvent(DbNodeEntry nodeEntry, java.net.InetAddress ifaddr, java.lang.String service, long txNo, java.lang.String callerUei)
nodeEntry
- The node that the service to get deleted on.ifaddr
- the interface the service to get deleted on.service
- the service to delete.txNo
- the transaction no.callerUei
- the uei of the caller event.private void updateServerHandler(Event event)
event
- The event to process.private void createAndSendAddInterfaceEvent(java.lang.String nodeLabel, java.lang.String ipaddr, java.lang.String hostName, long txNo, java.lang.String callerUei)
nodeLabel
- the node label of the node where the interface resides.ipaddr
- IP address of the interface to be added.hostName
- the Host server name.txNo
- the exteranl transaction numbercallerUei
- the uei of the caller eventprivate void createAndSendDeleteInterfaceEvent(java.lang.String nodeLabel, java.lang.String ipaddr, java.lang.String hostName, long txNo, java.lang.String callerUei)
nodeLabel
- the node label of the node where the interface resides.ipaddr
- IP address of the interface to be deleted.hostName
- the Host server name.txNo
- the external transaction No.callerUei
- the uei of the caller eventprivate void updateServiceHandler(Event event)
event
- The event to process.private void createAndSendChangeServiceEvent(java.lang.String ipaddr, java.lang.String service, java.lang.String action, long txNo, java.lang.String callerUei)
ipaddr
- IP address of the interface where the service resides.service
- the service to be changed(add or remove).action
- what operation to perform for the service/interface pair.txNo
- the external transaction No.callerUei
- the uei of the caller event.public void onEvent(Event event)
onEvent
in interface EventListener
event
- The event.public java.lang.String getName()
getName
in interface EventListener
|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |