|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.NotificationFactory
Field Summary | |
protected static java.io.InputStream |
configIn
Input stream for the general Notifd configuration xml |
private static boolean |
initialized
Boolean indicating if the init() method has been called |
private static NotificationFactory |
instance
Singleton instance |
private static long |
m_lastModified
|
private static java.io.File |
m_noticeConfFile
|
protected static java.io.File |
m_notifConfFile
Configuration file handle |
protected static Notifications |
m_notifications
Object containing all Notification objects parsed from the xml file |
private static 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
|
Constructor Summary | |
private |
NotificationFactory()
|
Method Summary | |
void |
acknowledgeNotice(Event event,
java.lang.String uei,
java.lang.String[] matchList)
|
void |
addNotification(Notification notice)
Handles adding a new Notification. |
java.util.List |
getActiveNodes()
|
static NotificationFactory |
getInstance()
|
static 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()
|
private static 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()
|
static java.lang.String |
getServiceNoticeStatus(java.lang.String nodeID,
java.lang.String ipaddr,
java.lang.String service)
|
boolean |
hasUei(java.lang.String uei)
|
static void |
init()
|
static void |
insertNotice(int notifyId,
java.util.Map params)
This method inserts a row into the notifications table in the database. |
private boolean |
nodeInterfaceServiceValid(Notification notif,
Event event)
|
static 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. |
private Header |
rebuildHeader()
|
static void |
reload()
|
void |
removeNotification(java.lang.String name)
|
void |
replaceNotification(java.lang.String oldName,
Notification notice)
|
void |
saveCurrent()
|
private static void |
updateFromFile()
|
static 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 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_TEXT_PAGER_PIN
public static final java.lang.String PARAM_NUM_PAGER_PIN
private static NotificationFactory instance
protected static java.io.File m_notifConfFile
protected static Notifications m_notifications
protected static java.io.InputStream configIn
private static boolean initialized
private static Header oldHeader
private static java.io.File m_noticeConfFile
private static long m_lastModified
Constructor Detail |
private NotificationFactory()
Method Detail |
public static NotificationFactory getInstance()
public static void init() throws java.io.IOException, java.io.FileNotFoundException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.lang.ClassNotFoundException
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
java.lang.ClassNotFoundException
public static void reload() 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 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
private boolean nodeInterfaceServiceValid(Notification notif, Event event)
public static 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 static 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 void 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 static java.lang.String getServiceNoticeStatus(java.lang.String nodeID, java.lang.String ipaddr, java.lang.String service) throws java.sql.SQLException
java.sql.SQLException
public static void updateNoticeWithUserInfo(java.lang.String userId, int noticeId, java.lang.String media, java.lang.String contactInfo) throws java.sql.SQLException
java.sql.SQLException
public static void insertNotice(int notifyId, java.util.Map params) throws java.sql.SQLException
java.sql.SQLException
private static 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
private Header rebuildHeader()
private static void updateFromFile() 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
|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |