Package org.opennms.netmgt.notifd
Class BroadcastEventProcessor
- java.lang.Object
-
- org.opennms.netmgt.notifd.BroadcastEventProcessor
-
- All Implemented Interfaces:
EventListener
public final class BroadcastEventProcessor extends java.lang.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 java.util.Map<java.lang.String,java.lang.String>
buildParameterMap(Notification notification, Event event, int noticeId)
void
close()
Unsubscribe from eventdboolean
computeNullSafeStatus()
computeNullSafeStatusDestinationPathManager
getDestinationPathManager()
getDestinationPathManagerEventIpcManager
getEventManager()
getEventManagerEventUtil
getEventUtil()
GroupManager
getGroupManager()
getGroupManagerjava.lang.String
getName()
Return an id for this event listenerjava.util.Map<java.lang.String,NoticeQueue>
getNoticeQueues()
getNoticeQueuesNotifdConfigManager
getNotifdConfigManager()
getNotifdConfigManagerNotificationCommandManager
getNotificationCommandManager()
getNotificationCommandManagerNotificationManager
getNotificationManager()
getNotificationManagerUserManager
getUserManager()
getUserManagerprotected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
getVarbindsDecodeMap(java.lang.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.java.util.Map<java.lang.String,java.lang.String>
rebuildParameterMap(int notifId, java.lang.String resolutionPrefix, boolean skipNumericPrefix)
rebuildParameterMapjava.lang.String
scheduledOutage(long nodeId, java.lang.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(java.lang.String queueID, java.lang.String targetName, java.lang.String[] commands, java.util.Map<java.lang.String,java.lang.String> params)
sendResolvedNotificationsToUservoid
setDestinationPathManager(DestinationPathManager destinationPathManager)
setDestinationPathManagervoid
setEventConfDao(EventConfDao eventConfDao)
void
setEventManager(EventIpcManager eventManager)
setEventManagervoid
setEventUtil(EventUtil eventUtil)
void
setGroupManager(GroupManager groupManager)
setGroupManagervoid
setNoticeQueues(java.util.Map<java.lang.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 java.io.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:
java.io.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(java.lang.String queueID, java.lang.String targetName, java.lang.String[] commands, java.util.Map<java.lang.String,java.lang.String> params) throws java.lang.Exception
sendResolvedNotificationsToUser
- Parameters:
queueID
- aString
object.targetName
- aString
object.commands
- an array ofString
objects.params
- aMap
object.- Throws:
java.lang.Exception
- if any.
-
buildParameterMap
protected java.util.Map<java.lang.String,java.lang.String> buildParameterMap(Notification notification, Event event, int noticeId)
-
getVarbindsDecodeMap
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getVarbindsDecodeMap(java.lang.String eventUei)
-
getName
public java.lang.String getName()
Return an id for this event listener- Specified by:
getName
in interfaceEventListener
- Returns:
- a
String
object.
-
rebuildParameterMap
public java.util.Map<java.lang.String,java.lang.String> rebuildParameterMap(int notifId, java.lang.String resolutionPrefix, boolean skipNumericPrefix) throws java.lang.Exception
rebuildParameterMap
- Parameters:
notifId
- a int.resolutionPrefix
- aString
object.skipNumericPrefix
- a boolean.- Returns:
- a
Map
object. - Throws:
java.lang.Exception
- if any.
-
scheduledOutage
public java.lang.String scheduledOutage(long nodeId, java.lang.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:
java.io.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 java.util.Map<java.lang.String,NoticeQueue> getNoticeQueues()
getNoticeQueues
- Returns:
- a
Map
object.
-
setNoticeQueues
public void setNoticeQueues(java.util.Map<java.lang.String,NoticeQueue> noticeQueues)
setNoticeQueues
- Parameters:
noticeQueues
- aMap
object.
-
setEventUtil
public void setEventUtil(EventUtil eventUtil)
-
getEventUtil
public EventUtil getEventUtil()
-
setEventConfDao
public void setEventConfDao(EventConfDao eventConfDao)
-
-