Class NoticeFactory

    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void acknowledge​(int[] noticeIds, String user)
      Deprecated.
      Acknowledge a list of notices with the given username and the current time.
      static void acknowledge​(int[] noticeIds, String user, Date time)
      Deprecated.
      Acknowledge a list of notices with the given username and the given time.
      static void acknowledge​(Notification[] notices, String user)
      Deprecated.
      Acknowledge a list of notices with the given username
      static void acknowledge​(Notification[] notices, String user, Date time)
      Deprecated.
      Acknowledge a list of notices with the given username and the given time.
      static boolean canDisplayEvent​(int eventId)
      Deprecated.
      This method determines the log status of an event associated with a notification
      static Notification getNotice​(int noticeId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return a specific notice.
      static int getNoticeCount​(AcknowledgeType ackType, Filter[] filters)
      Deprecated.
      Count the number of notices for a given acknowledgement type.
      static Notification[] getNotices​(javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by id.
      static Notification[] getNotices​(AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged or acknowledged notices sorted by id.
      static Notification[] getNotices​(SortStyle sortStyle, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Replaced by {@link " #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )"}
      static Notification[] getNotices​(SortStyle sortStyle, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by the given sort style.
      static Notification[] getNotices​(SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by the given sort style.
      static Notification[] getNotices​(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by the given sort style.
      static Notification[] getNotices​(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by the given sort style.
      static Notification[] getNoticesForInterface​(int nodeId, String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by id for the given interface.
      static Notification[] getNoticesForInterface​(int nodeId, String ipAddress, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices for the given interface.
      static Notification[] getNoticesForInterface​(String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by id that have the given IP address, regardless of what node they belong to.
      static Notification[] getNoticesForInterface​(String ipAddress, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to.
      static Notification[] getNoticesForNode​(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Replaced by {@link " #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )"}
      static Notification[] getNoticesForNode​(int nodeId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by time for the given node.
      static Notification[] getNoticesForNode​(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by given sort style for the given node.
      static Notification[] getNoticesForService​(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by id for the given service type, regardless of what node or interface they belong to.
      static Notification[] getNoticesForService​(int nodeId, String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by time for the given service.
      static Notification[] getNoticesForService​(int nodeId, String ipAddress, int serviceId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by time for the given service.
      static Notification[] getNoticesForService​(int serviceId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unacknowledged notices sorted by time for the given service type, regardless of what node or interface they belong to.
      protected static Notification[] rs2Notices​(ResultSet rs, javax.servlet.ServletContext servletContext)
      Deprecated.
      Convenience method for translating a java.sql.ResultSet containing notice information into an array of Notification objects.
    • Method Detail

      • getNoticeCount

        public static int getNoticeCount​(AcknowledgeType ackType,
                                         Filter[] filters)
                                  throws SQLException
        Deprecated.
        Count the number of notices for a given acknowledgement type.
        Parameters:
        ackType - a AcknowledgeType object.
        filters - an array of org$opennms$web$filter$Filter objects.
        Returns:
        a int.
        Throws:
        SQLException - if any.
      • getNotice

        public static Notification getNotice​(int noticeId,
                                             javax.servlet.ServletContext servletContext)
                                      throws SQLException
        Deprecated.
        Return a specific notice.
        Parameters:
        noticeId - a int.
        Returns:
        a Notification object.
        Throws:
        SQLException - if any.
      • canDisplayEvent

        public static boolean canDisplayEvent​(int eventId)
        Deprecated.
        This method determines the log status of an event associated with a notification
        Parameters:
        eventId - the unique id of the event from the notice
        Returns:
        true if the event is display, false if log only
      • getNotices

        public static Notification[] getNotices​(javax.servlet.ServletContext servletContext)
                                         throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by id.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNotices

        public static Notification[] getNotices​(SortStyle sortStyle,
                                                javax.servlet.ServletContext servletContext)
                                         throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by the given sort style.
        Parameters:
        sortStyle - a SortStyle object.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNotices

        public static Notification[] getNotices​(SortStyle sortStyle,
                                                boolean includeAcknowledged,
                                                javax.servlet.ServletContext servletContext)
                                         throws SQLException
        Deprecated.
        Replaced by {@link " #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )"}
        Return all notices (optionally only unacknowledged notices) sorted by the given sort style.
        Parameters:
        sortStyle - a SortStyle object.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNotices

        public static Notification[] getNotices​(SortStyle sortStyle,
                                                AcknowledgeType ackType,
                                                Filter[] filters,
                                                int limit,
                                                int offset,
                                                javax.servlet.ServletContext servletContext)
                                         throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by the given sort style.

        Note: This limit/offset code is Postgres specific! Per Shane , this is okay for now until we can come up with an Oracle alternative too.

        Parameters:
        limit - if -1 or zero, no limit or offset is used
        offset - if -1, no limit or offset if used
        sortStyle - a SortStyle object.
        ackType - a AcknowledgeType object.
        filters - an array of org$opennms$web$filter$Filter objects.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForNode

        public static Notification[] getNoticesForNode​(int nodeId,
                                                       javax.servlet.ServletContext servletContext)
                                                throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by time for the given node.
        Parameters:
        nodeId - a int.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForNode

        public static Notification[] getNoticesForNode​(int nodeId,
                                                       boolean includeAcknowledged,
                                                       javax.servlet.ServletContext servletContext)
                                                throws SQLException
        Deprecated.
        Replaced by {@link " #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )"}
        Return all notices (optionally only unacknowledged notices) sorted by id for the given node.
        Parameters:
        nodeId - a int.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForNode

        public static Notification[] getNoticesForNode​(int nodeId,
                                                       SortStyle sortStyle,
                                                       AcknowledgeType ackType,
                                                       javax.servlet.ServletContext servletContext)
                                                throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by given sort style for the given node.
        Parameters:
        nodeId - a int.
        sortStyle - a SortStyle object.
        ackType - a AcknowledgeType object.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForInterface

        public static Notification[] getNoticesForInterface​(int nodeId,
                                                            String ipAddress,
                                                            javax.servlet.ServletContext servletContext)
                                                     throws SQLException
        Deprecated.
        Return all unacknowledged notices for the given interface.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForInterface

        public static Notification[] getNoticesForInterface​(int nodeId,
                                                            String ipAddress,
                                                            boolean includeAcknowledged,
                                                            javax.servlet.ServletContext servletContext)
                                                     throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by id for the given interface.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForInterface

        public static Notification[] getNoticesForInterface​(String ipAddress,
                                                            javax.servlet.ServletContext servletContext)
                                                     throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to.
        Parameters:
        ipAddress - a String object.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForInterface

        public static Notification[] getNoticesForInterface​(String ipAddress,
                                                            boolean includeAcknowledged,
                                                            javax.servlet.ServletContext servletContext)
                                                     throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by id that have the given IP address, regardless of what node they belong to.
        Parameters:
        ipAddress - a String object.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForService

        public static Notification[] getNoticesForService​(int nodeId,
                                                          String ipAddress,
                                                          int serviceId,
                                                          javax.servlet.ServletContext servletContext)
                                                   throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by time for the given service.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        serviceId - a int.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForService

        public static Notification[] getNoticesForService​(int nodeId,
                                                          String ipAddress,
                                                          int serviceId,
                                                          boolean includeAcknowledged,
                                                          javax.servlet.ServletContext servletContext)
                                                   throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by time for the given service.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        serviceId - a int.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForService

        public static Notification[] getNoticesForService​(int serviceId,
                                                          javax.servlet.ServletContext servletContext)
                                                   throws SQLException
        Deprecated.
        Return all unacknowledged notices sorted by time for the given service type, regardless of what node or interface they belong to.
        Parameters:
        serviceId - a int.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • getNoticesForService

        public static Notification[] getNoticesForService​(int serviceId,
                                                          boolean includeAcknowledged,
                                                          javax.servlet.ServletContext servletContext)
                                                   throws SQLException
        Deprecated.
        Return all notices (optionally only unacknowledged notices) sorted by id for the given service type, regardless of what node or interface they belong to.
        Parameters:
        serviceId - a int.
        includeAcknowledged - a boolean.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.
      • acknowledge

        public static void acknowledge​(Notification[] notices,
                                       String user,
                                       Date time)
                                throws SQLException
        Deprecated.
        Acknowledge a list of notices with the given username and the given time.
        Parameters:
        notices - an array of Notification objects.
        user - a String object.
        time - a java$util$Date object.
        Throws:
        SQLException - if any.
      • acknowledge

        public static void acknowledge​(int[] noticeIds,
                                       String user)
                                throws SQLException
        Deprecated.
        Acknowledge a list of notices with the given username and the current time.
        Parameters:
        noticeIds - an array of int.
        user - a String object.
        Throws:
        SQLException - if any.
      • acknowledge

        public static void acknowledge​(int[] noticeIds,
                                       String user,
                                       Date time)
                                throws SQLException
        Deprecated.
        Acknowledge a list of notices with the given username and the given time.
        Parameters:
        noticeIds - an array of int.
        user - a String object.
        time - a java$util$Date object.
        Throws:
        SQLException - if any.
      • rs2Notices

        protected static Notification[] rs2Notices​(ResultSet rs,
                                                   javax.servlet.ServletContext servletContext)
                                            throws SQLException
        Deprecated.
        Convenience method for translating a java.sql.ResultSet containing notice information into an array of Notification objects.
        Parameters:
        rs - a ResultSet object.
        Returns:
        an array of Notification objects.
        Throws:
        SQLException - if any.