Package org.opennms.netmgt.notifd
Class BroadcastEventProcessor
- java.lang.Object
-
- org.opennms.netmgt.notifd.BroadcastEventProcessor
-
- All Implemented Interfaces:
EventListener
public final class BroadcastEventProcessor extends Object implements EventListener
BroadcastEventProcessor class.
- Author:
- Brian Weaver , OpenNMS , Jeff Gehlbach
-
-
Constructor Summary
Constructors Constructor Description BroadcastEventProcessor()
Constructor for BroadcastEventProcessor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,String>
buildParameterMap(Notification notification, Event event, int noticeId)
void
close()
Unsubscribe from eventdboolean
computeNullSafeStatus()
computeNullSafeStatusDestinationPathManager
getDestinationPathManager()
getDestinationPathManagerEventIpcManager
getEventManager()
getEventManagerEventUtil
getEventUtil()
GroupManager
getGroupManager()
getGroupManagerString
getName()
Return an id for this event listenerMap<String,NoticeQueue>
getNoticeQueues()
getNoticeQueuesNotifdConfigManager
getNotifdConfigManager()
getNotifdConfigManagerNotificationCommandManager
getNotificationCommandManager()
getNotificationCommandManagerNotificationManager
getNotificationManager()
getNotificationManagerUserManager
getUserManager()
getUserManagerprotected Map<String,Map<String,String>>
getVarbindsDecodeMap(String eventUei)
protected void
init()
An event listener is created and this instance is setup as the endpoint for broadcast events.void
onEvent(IEvent event)
Process a sent event.Map<String,String>
rebuildParameterMap(int notifId, String resolutionPrefix, boolean skipNumericPrefix)
rebuildParameterMapString
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)
sendResolvedNotificationsToUservoid
setDestinationPathManager(DestinationPathManager destinationPathManager)
setDestinationPathManagervoid
setEventConfDao(EventConfDao eventConfDao)
void
setEventManager(EventIpcManager eventManager)
setEventManagervoid
setEventUtil(EventUtil eventUtil)
void
setGroupManager(GroupManager groupManager)
setGroupManagervoid
setNoticeQueues(Map<String,NoticeQueue> noticeQueues)
setNoticeQueuesvoid
setNotifdConfigManager(NotifdConfigManager notifdConfigManager)
setNotifdConfigManagervoid
setNotificationCommandManager(NotificationCommandManager notificationCommandManager)
setNotificationCommandManagervoid
setNotificationManager(NotificationManager notificationManager)
setNotificationManagervoid
setUserManager(UserManager userManager)
setUserManager
-
-
-
Method Detail
-
init
protected void init() throws IOException
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.- Throws:
IOException
-
close
public void close()
Unsubscribe from eventd
-
onEvent
public void onEvent(IEvent event)
Process a sent event. This method is invoked by the EventIpcManager when a new event is available for processing.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
event
- aIEvent
object.
-
computeNullSafeStatus
public boolean computeNullSafeStatus()
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
sendResolvedNotificationsToUser
-
buildParameterMap
protected Map<String,String> buildParameterMap(Notification notification, Event event, int noticeId)
-
getVarbindsDecodeMap
protected Map<String,Map<String,String>> getVarbindsDecodeMap(String eventUei)
-
getName
public String getName()
Return an id for this event listener- Specified by:
getName
in interfaceEventListener
- Returns:
- a
String
object.
-
rebuildParameterMap
public Map<String,String> rebuildParameterMap(int notifId, String resolutionPrefix, boolean skipNumericPrefix) throws Exception
rebuildParameterMap
-
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.- Parameters:
nodeId
- a long.theInterface
- aString
object.- 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
- if any.
-
getDestinationPathManager
public DestinationPathManager getDestinationPathManager()
getDestinationPathManager
- Returns:
- a
DestinationPathManager
object.
-
setDestinationPathManager
public void setDestinationPathManager(DestinationPathManager destinationPathManager)
setDestinationPathManager
- Parameters:
destinationPathManager
- aDestinationPathManager
object.
-
getEventManager
public EventIpcManager getEventManager()
getEventManager
- Returns:
- a
EventIpcManager
object.
-
setEventManager
public void setEventManager(EventIpcManager eventManager)
setEventManager
- Parameters:
eventManager
- aEventIpcManager
object.
-
getGroupManager
public GroupManager getGroupManager()
getGroupManager
- Returns:
- a
GroupManager
object.
-
setGroupManager
public void setGroupManager(GroupManager groupManager)
setGroupManager
- Parameters:
groupManager
- aGroupManager
object.
-
getNotifdConfigManager
public NotifdConfigManager getNotifdConfigManager()
getNotifdConfigManager
- Returns:
- a
NotifdConfigManager
object.
-
setNotifdConfigManager
public void setNotifdConfigManager(NotifdConfigManager notifdConfigManager)
setNotifdConfigManager
- Parameters:
notifdConfigManager
- aNotifdConfigManager
object.
-
getNotificationCommandManager
public NotificationCommandManager getNotificationCommandManager()
getNotificationCommandManager
- Returns:
- a
NotificationCommandManager
object.
-
setNotificationCommandManager
public void setNotificationCommandManager(NotificationCommandManager notificationCommandManager)
setNotificationCommandManager
- Parameters:
notificationCommandManager
- aNotificationCommandManager
object.
-
getNotificationManager
public NotificationManager getNotificationManager()
getNotificationManager
- Returns:
- a
NotificationManager
object.
-
setNotificationManager
public void setNotificationManager(NotificationManager notificationManager)
setNotificationManager
- Parameters:
notificationManager
- aNotificationManager
object.
-
getUserManager
public UserManager getUserManager()
getUserManager
- Returns:
- a
UserManager
object.
-
setUserManager
public void setUserManager(UserManager userManager)
setUserManager
- Parameters:
userManager
- aUserManager
object.
-
getNoticeQueues
public Map<String,NoticeQueue> getNoticeQueues()
getNoticeQueues
- Returns:
- a
Map
object.
-
setNoticeQueues
public void setNoticeQueues(Map<String,NoticeQueue> noticeQueues)
setNoticeQueues
- Parameters:
noticeQueues
- aMap
object.
-
setEventUtil
public void setEventUtil(EventUtil eventUtil)
-
getEventUtil
public EventUtil getEventUtil()
-
setEventConfDao
public void setEventConfDao(EventConfDao eventConfDao)
-
-