|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.NotificationManager
public abstract class NotificationManager
| Field Summary | |
|---|---|
Notifications |
m_notifications
Object containing all Notification objects parsed from the xml file |
static String |
PARAM_DESTINATION
|
static String |
PARAM_EMAIL
|
static String |
PARAM_INTERFACE
|
static String |
PARAM_NODE
|
static String |
PARAM_NUM_MSG
|
static String |
PARAM_NUM_PAGER_PIN
|
static String |
PARAM_PAGER_EMAIL
|
static String |
PARAM_RESPONSE
|
static String |
PARAM_SERVICE
|
static String |
PARAM_SUBJECT
|
static String |
PARAM_TEXT_MSG
|
static String |
PARAM_TEXT_PAGER_PIN
|
static String |
PARAM_TYPE
|
static String |
PARAM_XMPP_ADDRESS
|
| Constructor Summary | |
|---|---|
protected |
NotificationManager(NotifdConfigManager configManager,
DataSource dcf)
|
| Method Summary | |
|---|---|
Collection<Integer> |
acknowledgeNotice(Event event,
String uei,
String[] matchList)
|
void |
addNotification(Notification notice)
Handles adding a new Notification. |
static void |
addNotificationParams(Map<String,String> paramMap,
Notification notification)
Adds additional parameters defined by the user in the notificaiton configuration XML. |
static void |
expandMapValues(Map<String,String> map,
Event event)
|
void |
forEachUserNotification(int notifId,
RowProcessor rp)
|
List<Integer> |
getActiveNodes()
|
protected NotifdConfigManager |
getConfigManager()
|
Event |
getEvent(int eventid)
In the absence of DAOs and ORMs this creates an Event object from the persisted record. |
int |
getNoticeId()
This method wraps the call to the database to get a sequence notice ID from the database. |
Notification[] |
getNotifForEvent(Event event)
|
Notification |
getNotification(String name)
|
List<String> |
getNotificationNames()
|
Map<String,Notification> |
getNotifications()
|
String |
getQueueForNotification(int notifId)
|
List<String> |
getServiceNames()
|
String |
getServiceNoticeStatus(String nodeID,
String ipaddr,
String service)
|
int |
getUserNotifId()
|
boolean |
hasUei(String uei)
|
void |
insertNotice(int notifyId,
Map<String,String> params,
String queueID,
Notification notification)
This method inserts a row into the notifications table in the database. |
protected boolean |
nodeInterfaceServiceValid(Notification notif,
Event event)
|
boolean |
noticeOutstanding(int noticeId)
This method returns a boolean indicating if the page has been responded to by any member of the group the page was sent to. |
void |
parseXML(Reader reader)
|
Map<String,String> |
rebuildParameterMap(int notifId,
String resolutionPrefix,
boolean skipNumericPrefix)
|
void |
removeNotification(String name)
|
void |
replaceNotification(String oldName,
Notification newNotice)
|
void |
saveCurrent()
|
protected abstract void |
saveXML(String xmlString)
|
protected abstract void |
update()
|
void |
updateNoticeWithUserInfo(String userId,
int noticeId,
String media,
String contactInfo,
String autoNotify)
|
void |
updateStatus(String name,
String status)
Sets the status on an individual notification configuration and saves to xml. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Notifications m_notifications
public static final String PARAM_TYPE
public static final String PARAM_DESTINATION
public static final String PARAM_TEXT_MSG
public static final String PARAM_NUM_MSG
public static final String PARAM_RESPONSE
public static final String PARAM_NODE
public static final String PARAM_INTERFACE
public static final String PARAM_SERVICE
public static final String PARAM_SUBJECT
public static final String PARAM_EMAIL
public static final String PARAM_PAGER_EMAIL
public static final String PARAM_XMPP_ADDRESS
public static final String PARAM_TEXT_PAGER_PIN
public static final String PARAM_NUM_PAGER_PIN
| Constructor Detail |
|---|
protected NotificationManager(NotifdConfigManager configManager,
DataSource dcf)
configIn -
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException| Method Detail |
|---|
public void parseXML(Reader reader)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean hasUei(String uei)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public Notification[] getNotifForEvent(Event event)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationExceptionprotected NotifdConfigManager getConfigManager()
protected boolean nodeInterfaceServiceValid(Notification notif,
Event event)
public int getNoticeId()
throws SQLException,
IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
SQLException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public int getUserNotifId()
throws SQLException,
IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
SQLException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean noticeOutstanding(int noticeId)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public Collection<Integer> acknowledgeNotice(Event event,
String uei,
String[] matchList)
throws SQLException,
IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
SQLException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public List<Integer> getActiveNodes()
throws SQLException
SQLException
public String getServiceNoticeStatus(String nodeID,
String ipaddr,
String service)
throws SQLException
SQLException
public void updateNoticeWithUserInfo(String userId,
int noticeId,
String media,
String contactInfo,
String autoNotify)
throws SQLException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
IOException
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
SQLException
public void insertNotice(int notifyId,
Map<String,String> params,
String queueID,
Notification notification)
throws SQLException
queueID - notification - TODO
SQLException
public Map<String,Notification> getNotifications()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public List<String> getServiceNames()
throws SQLException
SQLException
public Notification getNotification(String name)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public List<String> getNotificationNames()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void removeNotification(String name)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException,
ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
ClassNotFoundException
public void addNotification(Notification notice)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException,
ClassNotFoundException
notice - The Notification to add.
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
ClassNotFoundException
public void replaceNotification(String oldName,
Notification newNotice)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException,
ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
ClassNotFoundException
public void updateStatus(String name,
String status)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException,
ClassNotFoundException
name - The name of the notification.status - The status (either "on" or "off").
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
ClassNotFoundException
public void saveCurrent()
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException,
ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
ClassNotFoundException
protected abstract void saveXML(String xmlString)
throws IOException
xmlString -
IOException
protected abstract void update()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public Map<String,String> rebuildParameterMap(int notifId,
String resolutionPrefix,
boolean skipNumericPrefix)
throws Exception
notifId -
Exception
public static void addNotificationParams(Map<String,String> paramMap,
Notification notification)
paramMap - notification -
public void forEachUserNotification(int notifId,
RowProcessor rp)
notifId - public String getQueueForNotification(int notifId)
notifId -
public static void expandMapValues(Map<String,String> map,
Event event)
public Event getEvent(int eventid)
eventid -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||