public abstract class NotificationManager extends Object
Abstract NotificationManager class.
Modifier and Type | Field and Description |
---|---|
Notifications |
m_notifications
Object containing all Notification objects parsed from the xml file
|
static String |
PARAM_DESTINATION
Constant
PARAM_DESTINATION="-d" |
static String |
PARAM_EMAIL
Constant
PARAM_EMAIL="-email" |
static String |
PARAM_HOME_PHONE
Constant
PARAM_HOME_PHONE="-hphone" |
static String |
PARAM_INTERFACE
Constant
PARAM_INTERFACE="-interface" |
static String |
PARAM_MICROBLOG_USERNAME
Constant
PARAM_MICROBLOG_USERNAME="-ublog" |
static String |
PARAM_MOBILE_PHONE
Constant
PARAM_MOBILE_PHONE="-mphone" |
static String |
PARAM_NODE
Constant
PARAM_NODE="-nodeid" |
static String |
PARAM_NUM_MSG
Constant
PARAM_NUM_MSG="-nm" |
static String |
PARAM_NUM_PAGER_PIN
Constant
PARAM_NUM_PAGER_PIN="-np" |
static String |
PARAM_PAGER_EMAIL
Constant
PARAM_PAGER_EMAIL="-pemail" |
static String |
PARAM_RESPONSE
Constant
PARAM_RESPONSE="-r" |
static String |
PARAM_SERVICE
Constant
PARAM_SERVICE="-service" |
static String |
PARAM_SUBJECT
Constant
PARAM_SUBJECT="-subject" |
static String |
PARAM_TEXT_MSG
Constant
PARAM_TEXT_MSG="-tm" |
static String |
PARAM_TEXT_PAGER_PIN
Constant
PARAM_TEXT_PAGER_PIN="-tp" |
static String |
PARAM_TUI_PIN
Constant
PARAM_TUI_PIN="-tuipin" |
static String |
PARAM_TYPE
Constant
PARAM_TYPE="-t" |
static String |
PARAM_WORK_PHONE
Constant
PARAM_WORK_PHONE="-wphone" |
static String |
PARAM_XMPP_ADDRESS
Constant
PARAM_XMPP_ADDRESS="-xmpp" |
Modifier | Constructor and Description |
---|---|
protected |
NotificationManager(NotifdConfigManager configManager,
DataSource dcf)
Constructor for NotificationManager.
|
Modifier and Type | Method and Description |
---|---|
Collection<Integer> |
acknowledgeNotice(Event event,
String uei,
String[] matchList)
acknowledgeNotice
|
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)
expandMapValues
|
void |
forEachUserNotification(int notifId,
RowProcessor rp)
forEachUserNotification
|
List<Integer> |
getActiveNodes()
getActiveNodes
|
protected NotifdConfigManager |
getConfigManager()
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)
getNotifForEvent
|
Notification |
getNotification(String name)
getNotification
|
List<String> |
getNotificationNames()
getNotificationNames
|
Map<String,Notification> |
getNotifications()
getNotifications
|
String |
getQueueForNotification(int notifId)
getQueueForNotification
|
List<String> |
getServiceNames()
getServiceNames
|
String |
getServiceNoticeStatus(String nodeID,
String ipaddr,
String service)
getServiceNoticeStatus
|
int |
getUserNotifId()
getUserNotifId
|
boolean |
hasUei(String uei)
hasUei
|
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)
nodeInterfaceServiceValid
|
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(InputStream stream)
parseXML
|
void |
parseXML(Reader reader)
Deprecated.
|
Map<String,String> |
rebuildParameterMap(int notifId,
String resolutionPrefix,
boolean skipNumericPrefix)
rebuildParameterMap
|
void |
removeNotification(String name)
removeNotification
|
void |
replaceNotification(String oldName,
Notification newNotice)
replaceNotification
|
void |
saveCurrent()
saveCurrent
|
protected abstract void |
saveXML(String xmlString)
saveXML
|
abstract void |
update()
update
|
void |
updateNoticeWithUserInfo(String userId,
int noticeId,
String media,
String contactInfo,
String autoNotify)
updateNoticeWithUserInfo
|
void |
updateStatus(String name,
String status)
Sets the status on an individual notification configuration and saves to
xml.
|
public Notifications m_notifications
public static final String PARAM_TYPE
PARAM_TYPE="-t"
public static final String PARAM_DESTINATION
PARAM_DESTINATION="-d"
public static final String PARAM_TEXT_MSG
PARAM_TEXT_MSG="-tm"
public static final String PARAM_NUM_MSG
PARAM_NUM_MSG="-nm"
public static final String PARAM_RESPONSE
PARAM_RESPONSE="-r"
public static final String PARAM_NODE
PARAM_NODE="-nodeid"
public static final String PARAM_INTERFACE
PARAM_INTERFACE="-interface"
public static final String PARAM_SERVICE
PARAM_SERVICE="-service"
public static final String PARAM_SUBJECT
PARAM_SUBJECT="-subject"
public static final String PARAM_EMAIL
PARAM_EMAIL="-email"
public static final String PARAM_PAGER_EMAIL
PARAM_PAGER_EMAIL="-pemail"
public static final String PARAM_XMPP_ADDRESS
PARAM_XMPP_ADDRESS="-xmpp"
public static final String PARAM_TEXT_PAGER_PIN
PARAM_TEXT_PAGER_PIN="-tp"
public static final String PARAM_NUM_PAGER_PIN
PARAM_NUM_PAGER_PIN="-np"
public static final String PARAM_WORK_PHONE
PARAM_WORK_PHONE="-wphone"
public static final String PARAM_HOME_PHONE
PARAM_HOME_PHONE="-hphone"
public static final String PARAM_MOBILE_PHONE
PARAM_MOBILE_PHONE="-mphone"
public static final String PARAM_TUI_PIN
PARAM_TUI_PIN="-tuipin"
public static final String PARAM_MICROBLOG_USERNAME
PARAM_MICROBLOG_USERNAME="-ublog"
protected NotificationManager(NotifdConfigManager configManager, DataSource dcf)
Constructor for NotificationManager.
configManager
- a NotifdConfigManager
object.dcf
- a DataSource
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.@Deprecated public void parseXML(Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
parseXML
reader
- a Reader
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public void parseXML(InputStream stream) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
parseXML
stream
- a InputStream
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public boolean hasUei(String uei) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
hasUei
uei
- a String
object.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public Notification[] getNotifForEvent(Event event) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
getNotifForEvent
event
- a Event
object.Notification
objects.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.protected NotifdConfigManager getConfigManager()
getConfigManager
NotifdConfigManager
object.protected boolean nodeInterfaceServiceValid(Notification notif, Event event)
nodeInterfaceServiceValid
notif
- a Notification
object.event
- a Event
object.public int getNoticeId() throws SQLException, IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
SQLException
- if any.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public int getUserNotifId() throws SQLException, IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
getUserNotifId
SQLException
- if any.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public boolean noticeOutstanding(int noticeId) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
noticeId
- a int.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public Collection<Integer> acknowledgeNotice(Event event, String uei, String[] matchList) throws SQLException, IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
acknowledgeNotice
event
- a Event
object.uei
- a String
object.matchList
- an array of String
objects.Collection
object.SQLException
- if any.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public List<Integer> getActiveNodes() throws SQLException
getActiveNodes
List
object.SQLException
- if any.public String getServiceNoticeStatus(String nodeID, String ipaddr, String service) throws SQLException
getServiceNoticeStatus
nodeID
- a String
object.ipaddr
- a String
object.service
- a String
object.String
object.SQLException
- if any.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
updateNoticeWithUserInfo
userId
- a String
object.noticeId
- a int.media
- a String
object.contactInfo
- a String
object.autoNotify
- a String
object.IOException
- if any.org.exolab.castor.xml.ValidationException
- if any.org.exolab.castor.xml.MarshalException
- if any.SQLException
- if any.public void insertNotice(int notifyId, Map<String,String> params, String queueID, Notification notification) throws SQLException
queueID
- a String
object.notification
- TODOnotifyId
- a int.params
- a Map
object.SQLException
- if any.public Map<String,Notification> getNotifications() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
getNotifications
Map
object.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public List<String> getServiceNames() throws SQLException
getServiceNames
List
object.SQLException
- if any.public Notification getNotification(String name) throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
getNotification
name
- a String
object.Notification
object.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public List<String> getNotificationNames() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
getNotificationNames
List
object.IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public void removeNotification(String name) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException, ClassNotFoundException
removeNotification
name
- a String
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.ClassNotFoundException
- if any.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
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.ClassNotFoundException
- if any.public void replaceNotification(String oldName, Notification newNotice) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException, ClassNotFoundException
replaceNotification
oldName
- a String
object.newNotice
- a Notification
object.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.ClassNotFoundException
- if any.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
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.ClassNotFoundException
- if any.public void saveCurrent() throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, IOException, ClassNotFoundException
saveCurrent
org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.IOException
- if any.ClassNotFoundException
- if any.protected abstract void saveXML(String xmlString) throws IOException
saveXML
xmlString
- a String
object.IOException
- if any.public abstract void update() throws IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
update
IOException
- if any.org.exolab.castor.xml.MarshalException
- if any.org.exolab.castor.xml.ValidationException
- if any.public Map<String,String> rebuildParameterMap(int notifId, String resolutionPrefix, boolean skipNumericPrefix) throws Exception
rebuildParameterMap
public static void addNotificationParams(Map<String,String> paramMap, Notification notification)
paramMap
- a Map
object.notification
- a Notification
object.public void forEachUserNotification(int notifId, RowProcessor rp)
forEachUserNotification
notifId
- a int.rp
- a RowProcessor
object.public String getQueueForNotification(int notifId)
getQueueForNotification
notifId
- a int.String
object.public static void expandMapValues(Map<String,String> map, Event event)
expandMapValues
public Event getEvent(int eventid)
eventid
- a int.Copyright © 2015. All Rights Reserved.