OpenNMS API 1.2.3

org.opennms.netmgt.notifd
Class NotificationTask

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.opennms.netmgt.notifd.NotificationTask
All Implemented Interfaces:
java.lang.Runnable

public class NotificationTask
extends java.lang.Thread

This class holds all the data and logic for sending out a notification Each notification that is sent will be accompanied by a row in the notifications table. All notifications in a group will be identified with a common groupId number.

Author:
Jason Johns , OpenNMS Modification to pick an ExecuteStrategy based on the "binary" flag in notificationCommands.xml by:, David Hustace

Field Summary
private  Command[] m_commands
          The console command that will be issued to send the actual notification.
private  Notifd m_notifd
           
private  java.util.SortedMap m_notifTree
           
private  int m_notifyId
          The row id that will be used for the row inserted into the notifications table
private  java.util.Map m_params
           
private  long m_sendTime
           
private  java.util.List m_siblings
           
private  User m_user
          The User object the notification needs to go out to
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NotificationTask(Notifd notifd, long sendTime, java.util.Map someParams, java.util.List siblings)
          Constructor, initializes some information
 
Method Summary
private  java.util.List getArgumentList(Command command)
           
private  java.lang.String getArgumentValue(java.lang.String aSwitch)
           
 int getNotifyId()
          Returns the unique id used to insert the row in the database for this notification task.
 long getSendTime()
           
 void run()
           
 void setCommands(Command[] commands)
          This method will construct the command that will be issued to send the actual page.
 void setNoticeId(int anId)
          Sets the group id that will be inserted into the row in notifications table
 void setUser(User aUser)
          Sets the user that the page needs to be sent to.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_user

private User m_user
The User object the notification needs to go out to


m_notifyId

private int m_notifyId
The row id that will be used for the row inserted into the notifications table


m_commands

private Command[] m_commands
The console command that will be issued to send the actual notification.


m_params

private java.util.Map m_params

m_sendTime

private long m_sendTime

m_siblings

private java.util.List m_siblings

m_notifTree

private java.util.SortedMap m_notifTree

m_notifd

private Notifd m_notifd
Constructor Detail

NotificationTask

public NotificationTask(Notifd notifd,
                        long sendTime,
                        java.util.Map someParams,
                        java.util.List siblings)
                 throws java.sql.SQLException
Constructor, initializes some information

Parameters:
someParams - the parameters from Notify
Method Detail

toString

public java.lang.String toString()

getSendTime

public long getSendTime()

getNotifyId

public int getNotifyId()
Returns the unique id used to insert the row in the database for this notification task.

Returns:
int, the id of the row in notifications table

setUser

public void setUser(User aUser)
Sets the user that the page needs to be sent to.

Parameters:
aUser - the user info

setNoticeId

public void setNoticeId(int anId)
Sets the group id that will be inserted into the row in notifications table

Parameters:
anId - the group id to set for the row

setCommands

public void setCommands(Command[] commands)
This method will construct the command that will be issued to send the actual page.

Parameters:
commands - the commands to call at the console.

run

public void run()

getArgumentList

private java.util.List getArgumentList(Command command)

getArgumentValue

private java.lang.String getArgumentValue(java.lang.String aSwitch)

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.