org.opennms.netmgt.notifd
Class BroadcastEventProcessor

java.lang.Object
  extended by org.opennms.netmgt.notifd.BroadcastEventProcessor
All Implemented Interfaces:
EventListener

public final class BroadcastEventProcessor
extends Object
implements EventListener

Author:
Brian Weaver , OpenNMS

Constructor Summary
BroadcastEventProcessor()
           
 
Method Summary
 void close()
          Unsubscribe from eventd
 boolean computeNullSafeStatus()
           
 String expandNotifParms(String input, Map<String,String> paramMap)
          A parameter expansion algorithm, designed to replace strings delimited by percent signs '%' with a value supplied by a Map object.
 DestinationPathManager getDestinationPathManager()
           
 EventIpcManager getEventManager()
           
 GroupManager getGroupManager()
           
 String getName()
          Return an id for this event listener
 Map<String,NoticeQueue> getNoticeQueues()
           
 NotifdConfigManager getNotifdConfigManager()
           
 NotificationCommandManager getNotificationCommandManager()
           
 NotificationManager getNotificationManager()
           
 PollOutagesConfigManager getPollOutagesConfigManager()
           
 UserManager getUserManager()
           
protected  void init()
          An event listener is created and this instance is setup as the endpoint for broadcast events.
protected  void initExpandRe()
          Initializes the expansion regular expression.
 void onEvent(Event event)
          This method is invoked by the EventIpcManager when a new event is available for processing.
 Map<String,String> rebuildParameterMap(int notifId, String resolutionPrefix, boolean skipNumericPrefix)
           
 String scheduledOutage(long nodeId, String theInterface)
          Checks the package information for the pollable service and determines if any of the calendar outages associated with the package apply to the current time and the service's interface.
protected  void sendResolvedNotificationsToUser(String queueID, String targetName, String[] commands, Map<String,String> params)
           
 void setDestinationPathManager(DestinationPathManager destinationPathManager)
           
 void setEventManager(EventIpcManager eventManager)
           
 void setGroupManager(GroupManager groupManager)
           
 void setNoticeQueues(Map<String,NoticeQueue> noticeQueues)
           
 void setNotifdConfigManager(NotifdConfigManager notifdConfigManager)
           
 void setNotificationCommandManager(NotificationCommandManager notificationCommandManager)
           
 void setNotificationManager(NotificationManager notificationManager)
           
 void setPollOutagesConfigManager(PollOutagesConfigManager pollOutagesConfigManager)
           
 void setUserManager(UserManager userManager)
           
 
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

init

protected void init()
An event listener is created and this instance is setup as the endpoint for broadcast events. When a new event arrives it is processed and the appropriate action is taken.


initExpandRe

protected void initExpandRe()
Initializes the expansion regular expression. The exception is going to be thrown away if the RE can't be compiled, thus the complilation should be tested prior to runtime.


close

public void close()
Unsubscribe from eventd


onEvent

public void onEvent(Event event)
This method is invoked by the EventIpcManager when a new event is available for processing.

Specified by:
onEvent in interface EventListener
Parameters:
event - The event .

computeNullSafeStatus

public boolean computeNullSafeStatus()
Returns:
false if status is not defined in configuration as "on".

sendResolvedNotificationsToUser

protected void sendResolvedNotificationsToUser(String queueID,
                                               String targetName,
                                               String[] commands,
                                               Map<String,String> params)
                                        throws Exception
Throws:
Exception

expandNotifParms

public String expandNotifParms(String input,
                               Map<String,String> paramMap)
A parameter expansion algorithm, designed to replace strings delimited by percent signs '%' with a value supplied by a Map object.

Parameters:
input - the input string
paramMap - a map that will supply the substitution values

getName

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

Specified by:
getName in interface EventListener

rebuildParameterMap

public Map<String,String> rebuildParameterMap(int notifId,
                                              String resolutionPrefix,
                                              boolean skipNumericPrefix)
                                       throws Exception
Parameters:
i -
Returns:
Throws:
Exception

scheduledOutage

public String scheduledOutage(long nodeId,
                              String theInterface)
Checks the package information for the pollable service and determines if any of the calendar outages associated with the package apply to the current time and the service's interface. If an outage applies it's name is returned...otherwise null is returned.

Returns:
null if no outage found (indicating a notification may be sent) or the outage name, if an applicable outage is found (indicating notification should not be sent).
Throws:
IOException
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException

getDestinationPathManager

public DestinationPathManager getDestinationPathManager()

setDestinationPathManager

public void setDestinationPathManager(DestinationPathManager destinationPathManager)

getEventManager

public EventIpcManager getEventManager()

setEventManager

public void setEventManager(EventIpcManager eventManager)

getGroupManager

public GroupManager getGroupManager()

setGroupManager

public void setGroupManager(GroupManager groupManager)

getNotifdConfigManager

public NotifdConfigManager getNotifdConfigManager()

setNotifdConfigManager

public void setNotifdConfigManager(NotifdConfigManager notifdConfigManager)

getNotificationCommandManager

public NotificationCommandManager getNotificationCommandManager()

setNotificationCommandManager

public void setNotificationCommandManager(NotificationCommandManager notificationCommandManager)

getNotificationManager

public NotificationManager getNotificationManager()

setNotificationManager

public void setNotificationManager(NotificationManager notificationManager)

getPollOutagesConfigManager

public PollOutagesConfigManager getPollOutagesConfigManager()

setPollOutagesConfigManager

public void setPollOutagesConfigManager(PollOutagesConfigManager pollOutagesConfigManager)

getUserManager

public UserManager getUserManager()

setUserManager

public void setUserManager(UserManager userManager)

getNoticeQueues

public Map<String,NoticeQueue> getNoticeQueues()

setNoticeQueues

public void setNoticeQueues(Map<String,NoticeQueue> noticeQueues)


Copyright © 2009. All Rights Reserved.