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)voidclose()Unsubscribe from eventdbooleancomputeNullSafeStatus()computeNullSafeStatusDestinationPathManagergetDestinationPathManager()getDestinationPathManagerEventIpcManagergetEventManager()getEventManagerEventUtilgetEventUtil()GroupManagergetGroupManager()getGroupManagerStringgetName()Return an id for this event listenerMap<String,NoticeQueue>getNoticeQueues()getNoticeQueuesNotifdConfigManagergetNotifdConfigManager()getNotifdConfigManagerNotificationCommandManagergetNotificationCommandManager()getNotificationCommandManagerNotificationManagergetNotificationManager()getNotificationManagerUserManagergetUserManager()getUserManagerprotected Map<String,Map<String,String>>getVarbindsDecodeMap(String eventUei)protected voidinit()An event listener is created and this instance is setup as the endpoint for broadcast events.voidonEvent(IEvent event)Process a sent event.Map<String,String>rebuildParameterMap(int notifId, String resolutionPrefix, boolean skipNumericPrefix)rebuildParameterMapStringscheduledOutage(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 voidsendResolvedNotificationsToUser(String queueID, String targetName, String[] commands, Map<String,String> params)sendResolvedNotificationsToUservoidsetDestinationPathManager(DestinationPathManager destinationPathManager)setDestinationPathManagervoidsetEventConfDao(EventConfDao eventConfDao)voidsetEventManager(EventIpcManager eventManager)setEventManagervoidsetEventUtil(EventUtil eventUtil)voidsetGroupManager(GroupManager groupManager)setGroupManagervoidsetNoticeQueues(Map<String,NoticeQueue> noticeQueues)setNoticeQueuesvoidsetNotifdConfigManager(NotifdConfigManager notifdConfigManager)setNotifdConfigManagervoidsetNotificationCommandManager(NotificationCommandManager notificationCommandManager)setNotificationCommandManagervoidsetNotificationManager(NotificationManager notificationManager)setNotificationManagervoidsetUserManager(UserManager userManager)setUserManager
-
-
-
Method Detail
-
init
protected void init() throws IOExceptionAn 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:
onEventin interfaceEventListener- Parameters:
event- aIEventobject.
-
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:
getNamein interfaceEventListener- Returns:
- a
Stringobject.
-
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- aStringobject.- 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
DestinationPathManagerobject.
-
setDestinationPathManager
public void setDestinationPathManager(DestinationPathManager destinationPathManager)
setDestinationPathManager
- Parameters:
destinationPathManager- aDestinationPathManagerobject.
-
getEventManager
public EventIpcManager getEventManager()
getEventManager
- Returns:
- a
EventIpcManagerobject.
-
setEventManager
public void setEventManager(EventIpcManager eventManager)
setEventManager
- Parameters:
eventManager- aEventIpcManagerobject.
-
getGroupManager
public GroupManager getGroupManager()
getGroupManager
- Returns:
- a
GroupManagerobject.
-
setGroupManager
public void setGroupManager(GroupManager groupManager)
setGroupManager
- Parameters:
groupManager- aGroupManagerobject.
-
getNotifdConfigManager
public NotifdConfigManager getNotifdConfigManager()
getNotifdConfigManager
- Returns:
- a
NotifdConfigManagerobject.
-
setNotifdConfigManager
public void setNotifdConfigManager(NotifdConfigManager notifdConfigManager)
setNotifdConfigManager
- Parameters:
notifdConfigManager- aNotifdConfigManagerobject.
-
getNotificationCommandManager
public NotificationCommandManager getNotificationCommandManager()
getNotificationCommandManager
- Returns:
- a
NotificationCommandManagerobject.
-
setNotificationCommandManager
public void setNotificationCommandManager(NotificationCommandManager notificationCommandManager)
setNotificationCommandManager
- Parameters:
notificationCommandManager- aNotificationCommandManagerobject.
-
getNotificationManager
public NotificationManager getNotificationManager()
getNotificationManager
- Returns:
- a
NotificationManagerobject.
-
setNotificationManager
public void setNotificationManager(NotificationManager notificationManager)
setNotificationManager
- Parameters:
notificationManager- aNotificationManagerobject.
-
getUserManager
public UserManager getUserManager()
getUserManager
- Returns:
- a
UserManagerobject.
-
setUserManager
public void setUserManager(UserManager userManager)
setUserManager
- Parameters:
userManager- aUserManagerobject.
-
getNoticeQueues
public Map<String,NoticeQueue> getNoticeQueues()
getNoticeQueues
- Returns:
- a
Mapobject.
-
setNoticeQueues
public void setNoticeQueues(Map<String,NoticeQueue> noticeQueues)
setNoticeQueues
- Parameters:
noticeQueues- aMapobject.
-
setEventUtil
public void setEventUtil(EventUtil eventUtil)
-
getEventUtil
public EventUtil getEventUtil()
-
setEventConfDao
public void setEventConfDao(EventConfDao eventConfDao)
-
-