Class NotificationManager

  • Direct Known Subclasses:
    MockNotificationManager, NotificationFactory

    public abstract class NotificationManager
    extends Object

    Abstract NotificationManager class.

    Version:
    $Id: $
    Author:
    David Hustace This base class was refactored from NotificationFactory to support non-global references during JUnit testing and later to support distributed processes.
    • Method Detail

      • expandNotifParms

        public static String expandNotifParms​(String input,
                                              Map<String,​String> paramMap)
        A parameter expansion algorithm, designed to replace strings delimited by percent signs '%' with a value supplied by a Map object.

        NOTE: This function only replaces one particular parameter, the %noticeid% parameter.

        Parameters:
        input - the input string
        paramMap - a map that will supply the substitution values
        Returns:
        a String object.
      • parseXML

        @Deprecated
        public void parseXML​(Reader reader)
        Deprecated.

        parseXML

        Parameters:
        reader - a Reader object.
      • nodeInterfaceServiceValid

        protected boolean nodeInterfaceServiceValid​(Notification notif,
                                                    Event event)

        nodeInterfaceServiceValid

        Parameters:
        notif - a Notification object.
        event - a Event object.
        Returns:
        a boolean.
      • getNoticeId

        public int getNoticeId()
                        throws SQLException,
                               IOException
        This method wraps the call to the database to get a sequence notice ID from the database.
        Returns:
        int, the sequence id from the database, 0 by default if there is database trouble
        Throws:
        SQLException - if any.
        IOException - if any.
      • noticeOutstanding

        public boolean noticeOutstanding​(int noticeId)
                                  throws IOException
        This method returns a boolean indicating if the page has been responded to by any member of the group the page was sent to.
        Parameters:
        noticeId - a int.
        Returns:
        a boolean.
        Throws:
        IOException - if any.
      • insertNotice

        public void insertNotice​(int notifyId,
                                 Map<String,​String> params,
                                 String queueID,
                                 Notification notification)
                          throws SQLException
        This method inserts a row into the notifications table in the database. This row indicates that the page has been sent out.
        Parameters:
        queueID - a String object.
        notification - TODO
        notifyId - a int.
        params - a Map object.
        Throws:
        SQLException - if any.
      • rebuildParameterMap

        public Map<String,​String> rebuildParameterMap​(int notifId,
                                                            String resolutionPrefix,
                                                            boolean skipNumericPrefix)
                                                     throws Exception

        rebuildParameterMap

        Parameters:
        notifId - a int.
        resolutionPrefix - a String object.
        skipNumericPrefix - a boolean.
        Returns:
        a Map object.
        Throws:
        Exception - if any.
      • addNotificationParams

        public static void addNotificationParams​(Map<String,​String> paramMap,
                                                 Notification notification)
        Adds additional parameters defined by the user in the notification configuration XML.
        Parameters:
        paramMap - a Map object.
        notification - a Notification object.
      • forEachUserNotification

        public void forEachUserNotification​(int notifId,
                                            RowProcessor rp)

        forEachUserNotification

        Parameters:
        notifId - a int.
        rp - a RowProcessor object.
      • getQueueForNotification

        public String getQueueForNotification​(int notifId)

        getQueueForNotification

        Parameters:
        notifId - a int.
        Returns:
        a String object.
      • getEvent

        public Event getEvent​(int eventid)
        In the absence of DAOs and ORMs this creates an Event object from the persisted record.
        Parameters:
        eventid - a int.
        Returns:
        a populated Event object
      • incrementTasksQueued

        public void incrementTasksQueued()
      • incrementAttempted

        public void incrementAttempted​(boolean isBinary)
      • incrementSucceeded

        public void incrementSucceeded​(boolean isBinary)
      • incrementFailed

        public void incrementFailed​(boolean isBinary)
      • incrementInterrupted

        public void incrementInterrupted​(boolean isBinary)
      • incrementUnknownInterrupted

        public void incrementUnknownInterrupted()
      • getNotificationTasksQueued

        public long getNotificationTasksQueued()
      • getBinaryNoticesAttempted

        public long getBinaryNoticesAttempted()
      • getJavaNoticesAttempted

        public long getJavaNoticesAttempted()
      • getBinaryNoticesSucceeded

        public long getBinaryNoticesSucceeded()
      • getJavaNoticesSucceeded

        public long getJavaNoticesSucceeded()
      • getBinaryNoticesFailed

        public long getBinaryNoticesFailed()
      • getJavaNoticesFailed

        public long getJavaNoticesFailed()
      • getBinaryNoticesInterrupted

        public long getBinaryNoticesInterrupted()
      • getJavaNoticesInterrupted

        public long getJavaNoticesInterrupted()
      • getUnknownNoticesInterrupted

        public long getUnknownNoticesInterrupted()