|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.NotificationManager
Field Summary | |
(package private) NotifdConfigManager |
m_configManager
|
private DbConnectionFactory |
m_dbConnectionFactory
|
Notifications |
m_notifications
Object containing all Notification objects parsed from the xml file |
private Header |
oldHeader
|
static java.lang.String |
PARAM_DESTINATION
|
static java.lang.String |
PARAM_EMAIL
|
static java.lang.String |
PARAM_INTERFACE
|
static java.lang.String |
PARAM_NODE
|
static java.lang.String |
PARAM_NUM_MSG
|
static java.lang.String |
PARAM_NUM_PAGER_PIN
|
static java.lang.String |
PARAM_PAGER_EMAIL
|
static java.lang.String |
PARAM_RESPONSE
|
static java.lang.String |
PARAM_SERVICE
|
static java.lang.String |
PARAM_SUBJECT
|
static java.lang.String |
PARAM_TEXT_MSG
|
static java.lang.String |
PARAM_TEXT_PAGER_PIN
|
static java.lang.String |
PARAM_TYPE
|
static java.lang.String |
PARAM_XMPP_ADDRESS
|
Constructor Summary | |
protected |
NotificationManager(NotifdConfigManager configManager,
DbConnectionFactory dcf)
|
Method Summary | |
java.util.Collection |
acknowledgeNotice(Event event,
java.lang.String uei,
java.lang.String[] matchList)
|
void |
addNotification(Notification notice)
Handles adding a new Notification. |
void |
forEachUserNotification(int notifId,
RowProcessor rp)
|
java.util.List |
getActiveNodes()
|
protected NotifdConfigManager |
getConfigManager()
|
private java.sql.Connection |
getConnection()
|
protected java.lang.String |
getInterfaceFilter(java.lang.String rule)
|
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(java.lang.String name)
|
java.util.List |
getNotificationNames()
|
java.util.Map |
getNotifications()
|
java.lang.String |
getQueueForNotification(int notifId)
|
private int |
getServiceId(java.lang.String service)
This method queries the database in search of a service id for a given serivice name |
java.util.List |
getServiceNames()
|
java.lang.String |
getServiceNoticeStatus(java.lang.String nodeID,
java.lang.String ipaddr,
java.lang.String service)
|
boolean |
hasUei(java.lang.String uei)
|
void |
insertNotice(int notifyId,
java.util.Map params,
java.lang.String queueID)
This method inserts a row into the notifications table in the database. |
private 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(java.io.Reader reader)
|
private Header |
rebuildHeader()
|
java.util.Map |
rebuildParamterMap(int notifId,
java.lang.String resolutionPrefix)
|
void |
removeNotification(java.lang.String name)
|
void |
replaceNotification(java.lang.String oldName,
Notification notice)
|
void |
saveCurrent()
|
protected abstract void |
saveXML(java.lang.String xmlString)
|
protected abstract void |
update()
|
void |
updateNoticeWithUserInfo(java.lang.String userId,
int noticeId,
java.lang.String media,
java.lang.String contactInfo)
|
void |
updateStatus(java.lang.String name,
java.lang.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
private Header oldHeader
public static final java.lang.String PARAM_TYPE
public static final java.lang.String PARAM_DESTINATION
public static final java.lang.String PARAM_TEXT_MSG
public static final java.lang.String PARAM_NUM_MSG
public static final java.lang.String PARAM_RESPONSE
public static final java.lang.String PARAM_NODE
public static final java.lang.String PARAM_INTERFACE
public static final java.lang.String PARAM_SERVICE
public static final java.lang.String PARAM_SUBJECT
public static final java.lang.String PARAM_EMAIL
public static final java.lang.String PARAM_PAGER_EMAIL
public static final java.lang.String PARAM_XMPP_ADDRESS
public static final java.lang.String PARAM_TEXT_PAGER_PIN
public static final java.lang.String PARAM_NUM_PAGER_PIN
NotifdConfigManager m_configManager
private DbConnectionFactory m_dbConnectionFactory
Constructor Detail |
protected NotificationManager(NotifdConfigManager configManager, DbConnectionFactory dcf)
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
Method Detail |
public void parseXML(java.io.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(java.lang.String uei) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public Notification[] getNotifForEvent(Event event) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
protected NotifdConfigManager getConfigManager()
private boolean nodeInterfaceServiceValid(Notification notif, Event event)
protected java.lang.String getInterfaceFilter(java.lang.String rule)
rule
-
private java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
public int getNoticeId() throws java.sql.SQLException, java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.sql.SQLException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean noticeOutstanding(int noticeId) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.Collection acknowledgeNotice(Event event, java.lang.String uei, java.lang.String[] matchList) throws java.sql.SQLException, java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.sql.SQLException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.List getActiveNodes() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getServiceNoticeStatus(java.lang.String nodeID, java.lang.String ipaddr, java.lang.String service) throws java.sql.SQLException
java.sql.SQLException
public void updateNoticeWithUserInfo(java.lang.String userId, int noticeId, java.lang.String media, java.lang.String contactInfo) throws java.sql.SQLException
java.sql.SQLException
public void insertNotice(int notifyId, java.util.Map params, java.lang.String queueID) throws java.sql.SQLException
queueID
-
java.sql.SQLException
private int getServiceId(java.lang.String service) throws java.sql.SQLException
service
- the name of the service
java.sql.SQLException
public java.util.Map getNotifications() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.List getServiceNames() throws java.sql.SQLException
java.sql.SQLException
public Notification getNotification(java.lang.String name) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.List getNotificationNames() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void removeNotification(java.lang.String name) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.io.IOException, java.lang.ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.ClassNotFoundException
public void addNotification(Notification notice) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.io.IOException, java.lang.ClassNotFoundException
notice
- The Notification to add.
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.ClassNotFoundException
public void replaceNotification(java.lang.String oldName, Notification notice) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.io.IOException, java.lang.ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.ClassNotFoundException
public void updateStatus(java.lang.String name, java.lang.String status) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.io.IOException, java.lang.ClassNotFoundException
name
- The name of the notification.status
- The status (either "on" or "off").
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.ClassNotFoundException
public void saveCurrent() throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.io.IOException, java.lang.ClassNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.io.IOException
java.lang.ClassNotFoundException
protected abstract void saveXML(java.lang.String xmlString) throws java.io.IOException
xmlString
-
java.io.IOException
private Header rebuildHeader()
protected abstract void update() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.Map rebuildParamterMap(int notifId, java.lang.String resolutionPrefix) throws java.lang.Exception
notifId
-
java.lang.Exception
public void forEachUserNotification(int notifId, RowProcessor rp)
notifId
-
public java.lang.String getQueueForNotification(int notifId)
notifId
-
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |