org.opennms.netmgt.capsd
Class BroadcastEventProcessor

java.lang.Object
  extended by org.opennms.netmgt.capsd.BroadcastEventProcessor
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public class BroadcastEventProcessor
extends Object
implements org.springframework.beans.factory.InitializingBean

Author:
Matt Brozowski , OpenNMS

Constructor Summary
BroadcastEventProcessor()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getName()
          Return an id for this event listener
 void handleAddInterface(Event event)
          Process the event, add the specified interface into database.
 void handleAddNode(Event event)
          Process an addNode event.
 void handleChangeService(Event event)
          Process the event, add or remove a specified service from an interface.
 void handleDeleteInterface(Event event)
          Handle a deleteInterface Event.
 void handleDeleteNode(Event event)
          Handle a deleteNode Event.
 void handleDeleteService(Event event)
          Handle a deleteService Event.
 void handleDupNodeDeleted(Event event)
          This helper method removes a deleted node from Capsd's re-scan schedule.
 void handleForceRescan(Event event)
          Helper method that takes IP address from the force rescan event, retrieves the nodeid (JDBC) and adds it to the rescan schedule for immediate processing when the next thread is available.
 void handleNewSuspect(Event event)
          Helper method to add a node from the new suspect event Event to the suspect scan schedule.
 void handleNodeAdded(Event event)
          Adds the node from the event to the rescan schedule.
 void handleNodeDeleted(Event event)
          Handles the process of removing a deleted node from the rescan schedule.
 void handleUpdateServer(Event event)
          Handles the process of adding/updating a node.
 void handleUpdateService(Event event)
          Process the event, add or remove a specified interface/service pair into the database.
static boolean isPropagationEnabled()
          Determines if deletePropagation is enabled in the Outage Manager.
static boolean isXmlRpcEnabled()
          Convenience method checking Capsd's config for status of XmlRpc API
 void setLocalServer(String localServer)
           
 void setScheduler(org.opennms.netmgt.capsd.Scheduler scheduler)
           
 void setSuspectEventProcessorFactory(SuspectEventProcessorFactory suspectEventProcessorFactory)
           
 void setSuspectQueue(FifoQueue<Runnable> suspectQ)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadcastEventProcessor

public BroadcastEventProcessor()
Method Detail

isPropagationEnabled

public static boolean isPropagationEnabled()
Determines if deletePropagation is enabled in the Outage Manager.

Returns:
true if deletePropagation is enable, false otherwise

isXmlRpcEnabled

public static boolean isXmlRpcEnabled()
Convenience method checking Capsd's config for status of XmlRpc API

Returns:
Returns the xmlrpc.

getName

public String getName()
Return an id for this event listener


handleAddInterface

public void handleAddInterface(Event event)
                        throws InsufficientInformationException,
                               FailedOperationException
Process the event, add the specified interface into database. If the associated node does not exist in the database yet, add a node into the database.

Parameters:
event - The event to process.
Throws:
InsufficientInformationException - if the event is missing essential information
FailedOperationException - if the operation fails (because of database error for example)

handleAddNode

public void handleAddNode(Event event)
                   throws InsufficientInformationException,
                          FailedOperationException
Process an addNode event.

Parameters:
event - The event to process.
Throws:
InsufficientInformationException - if the event is missing information
FailedOperationException - if an error occurs during processing

handleChangeService

public void handleChangeService(Event event)
                         throws InsufficientInformationException,
                                FailedOperationException
Process the event, add or remove a specified service from an interface. An 'action' parameter wraped in the event will tell which action to take to the service.

Parameters:
event - The event to process.
Throws:
FailedOperationException
InsufficientInformationException

handleDeleteInterface

public void handleDeleteInterface(Event event)
                           throws InsufficientInformationException,
                                  FailedOperationException
Handle a deleteInterface Event. Here we process the event by marking all the appropriate data rows as deleted.

Parameters:
event - The event indicating what interface to delete
Throws:
InsufficientInformationException - if the required information is not part of the event
FailedOperationException

handleDeleteNode

public void handleDeleteNode(Event event)
                      throws InsufficientInformationException,
                             FailedOperationException
Handle a deleteNode Event. Here we process the event by marking all the appropriate data rows as deleted.

Parameters:
event - The event indicating what node to delete
Throws:
InsufficientInformationException - if the required information is not part of the event
FailedOperationException

handleDeleteService

public void handleDeleteService(Event event)
                         throws InsufficientInformationException,
                                FailedOperationException
Handle a deleteService Event. Here we process the event by marking all the appropriate data rows as deleted.

Parameters:
event - The event indicating what service to delete
Throws:
InsufficientInformationException - if the required information is not part of the event
FailedOperationException

handleDupNodeDeleted

public void handleDupNodeDeleted(Event event)
                          throws InsufficientInformationException
This helper method removes a deleted node from Capsd's re-scan schedule. Doesn't remove it from the new suspect scan schedule.

Parameters:
event -
Throws:
InsufficientInformationException

handleForceRescan

public void handleForceRescan(Event event)
                       throws InsufficientInformationException
Helper method that takes IP address from the force rescan event, retrieves the nodeid (JDBC) and adds it to the rescan schedule for immediate processing when the next thread is available.

Parameters:
event -
Throws:
InsufficientInformationException

handleNewSuspect

public void handleNewSuspect(Event event)
                      throws InsufficientInformationException
Helper method to add a node from the new suspect event Event to the suspect scan schedule.

Parameters:
event -
Throws:
InsufficientInformationException

handleNodeAdded

public void handleNodeAdded(Event event)
                     throws InsufficientInformationException
Adds the node from the event to the rescan schedule.

Parameters:
event -
Throws:
InsufficientInformationException

handleNodeDeleted

public void handleNodeDeleted(Event event)
                       throws InsufficientInformationException
Handles the process of removing a deleted node from the rescan schedule.

Parameters:
event -
Throws:
InsufficientInformationException

handleUpdateServer

public void handleUpdateServer(Event event)
                        throws InsufficientInformationException,
                               FailedOperationException
Handles the process of adding/updating a node. TODO: Change the name of this to something that makes more sense. This impacts the UEI of the named event for consistency and clearity, however, being called "Server" is unclear to itself. Change the event from "Server" to "Node" and all related methods.

Parameters:
event -
Throws:
InsufficientInformationException
FailedOperationException

handleUpdateService

public void handleUpdateService(Event event)
                         throws InsufficientInformationException,
                                FailedOperationException
Process the event, add or remove a specified interface/service pair into the database. this event will cause an changeService event with the specified action. An 'action' parameter wraped in the event will tell which action to take to the service on the specified interface. The ipaddress of the interface, the service name must be included in the event.

Parameters:
event - The event to process.
Throws:
InsufficientInformationException - if there is missing information in the event
FailedOperationException - if the operation fails for some reason

setSuspectEventProcessorFactory

public void setSuspectEventProcessorFactory(SuspectEventProcessorFactory suspectEventProcessorFactory)

setScheduler

public void setScheduler(org.opennms.netmgt.capsd.Scheduler scheduler)

setSuspectQueue

public void setSuspectQueue(FifoQueue<Runnable> suspectQ)

setLocalServer

public void setLocalServer(String localServer)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2009. All Rights Reserved.