Class OutageFactory


  • public class OutageFactory
    extends java.lang.Object
    Deprecated.
    Use an injected OutageDao implementation instead
    Encapsulates all querying functionality for outages.
    Author:
    Lawrence Karnowski , Jason Johns
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static Outage getOutage​(int outageId)
      Deprecated.
      getOutage
      static int getOutageCount()
      Deprecated.
      Return the count of current outages.
      static int getOutageCount​(OutageType outageType, Filter[] filters)
      Deprecated.
      Count the number of outages for a given outage type.
      static Outage[] getOutages()
      Deprecated.
      Return all unresolved outages sorted by the default sort style, outage identifier.
      static Outage[] getOutages​(SortStyle sortStyle)
      Deprecated.
      Return all unresolved outages sorted by the given sort style.
      static Outage[] getOutages​(SortStyle sortStyle, OutageType outType)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by the given sort style.
      static Outage[] getOutages​(SortStyle sortStyle, OutageType outType, Filter[] filters)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by the given sort style.
      static Outage[] getOutages​(SortStyle sortStyle, OutageType outType, Filter[] filters, int limit, int offset)
      Deprecated.
      Return all notices (optionally only unacknowledged notices) sorted by the given sort style.
      static Outage[] getOutagesForInterface​(int nodeId, java.lang.String ipAddress, boolean includeResolved, javax.servlet.ServletContext servletContext)
      Deprecated.
      Replaced by {@link " #getOutagesForInterface(int,String,SortStyle,OutageType) getOutagesForInterface(int,String,SortStyle,OutageType)"}
      static Outage[] getOutagesForInterface​(int nodeId, java.lang.String ipAddress, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unresolved notices for the given interface.
      static Outage[] getOutagesForInterface​(int nodeId, java.lang.String ipAddress, SortStyle sortStyle, OutageType outType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by given sort style for the given interface.
      static Outage[] getOutagesForInterface​(java.lang.String ipAddress)
      Deprecated.
      Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to.
      static Outage[] getOutagesForInterface​(java.lang.String ipAddress, boolean includeResolved)
      Deprecated.
      Replaced by {@link " #getOutagesForInterface(String,SortStyle,OutageType) getOutagesForInterface(String,SortStyle,OutageType)"}
      static Outage[] getOutagesForInterface​(java.lang.String ipAddress, SortStyle sortStyle, OutageType outType)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by given sort style for the given IP address.
      static Outage[] getOutagesForNode​(int nodeId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all current outages sorted by time for the given node.
      static Outage[] getOutagesForNode​(int nodeId, SortStyle sortStyle, OutageType outType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by given sort style for the given node.
      static Outage[] getOutagesForService​(int serviceId, boolean includeResolved, javax.servlet.ServletContext servletContext)
      Deprecated.
      Replaced by {@link " #getOutagesForService(int,SortStyle,OutageType) getOutagesForInterface(int,SortStyle,OutageType)"}
      static Outage[] getOutagesForService​(int nodeId, java.lang.String ipAddress, int serviceId, boolean includeResolved, javax.servlet.ServletContext servletContext)
      Deprecated.
      Replaced by {@link " #getOutagesForService(int,String,int,SortStyle,OutageType) getOutagesForInterface(int,String,int,SortStyle,OutageType)"}
      static Outage[] getOutagesForService​(int nodeId, java.lang.String ipAddress, int serviceId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unresolved outages sorted by time for the given service.
      static Outage[] getOutagesForService​(int nodeId, java.lang.String ipAddress, int serviceId, SortStyle sortStyle, OutageType outType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by given sort style for the given service.
      static Outage[] getOutagesForService​(int serviceId, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all unresolved outages sorted by time for the given service type, regardless of what node or interface they belong to.
      static Outage[] getOutagesForService​(int serviceId, SortStyle sortStyle, OutageType outType, javax.servlet.ServletContext servletContext)
      Deprecated.
      Return all outages (optionally only unresolved outages) sorted by given sort style for the given service identifier.
      protected static Outage[] rs2Outages​(java.sql.ResultSet rs)
      Deprecated.
      Convenience method for translating a java.sql.ResultSet containing outage information into an array of Outage objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getOutageCount

        public static int getOutageCount()
                                  throws java.sql.SQLException
        Deprecated.
        Return the count of current outages.

        Note: This method has been optimized for the simplest query.

        Returns:
        a int.
        Throws:
        java.sql.SQLException - if any.
      • getOutageCount

        public static int getOutageCount​(OutageType outageType,
                                         Filter[] filters)
                                  throws java.sql.SQLException
        Deprecated.
        Count the number of outages for a given outage type.
        Parameters:
        outageType - a OutageType object.
        filters - an array of org$opennms$web$filter$Filter objects.
        Returns:
        a int.
        Throws:
        java.sql.SQLException - if any.
      • getOutage

        public static Outage getOutage​(int outageId)
                                throws java.sql.SQLException
        Deprecated.

        getOutage

        Parameters:
        outageId - a int.
        Returns:
        a Outage object.
        Throws:
        java.sql.SQLException - if any.
      • getOutages

        public static Outage[] getOutages()
                                   throws java.sql.SQLException
        Deprecated.
        Return all unresolved outages sorted by the default sort style, outage identifier.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutages

        public static Outage[] getOutages​(SortStyle sortStyle)
                                   throws java.sql.SQLException
        Deprecated.
        Return all unresolved outages sorted by the given sort style.
        Parameters:
        sortStyle - a SortStyle object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutages

        public static Outage[] getOutages​(SortStyle sortStyle,
                                          OutageType outType)
                                   throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by the given sort style.
        Parameters:
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutages

        public static Outage[] getOutages​(SortStyle sortStyle,
                                          OutageType outType,
                                          Filter[] filters)
                                   throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by the given sort style.
        Parameters:
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        filters - an array of org$opennms$web$filter$Filter objects.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutages

        public static Outage[] getOutages​(SortStyle sortStyle,
                                          OutageType outType,
                                          Filter[] filters,
                                          int limit,
                                          int offset)
                                   throws java.sql.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.
        outType - a OutageType object.
        filters - an array of org$opennms$web$filter$Filter objects.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForNode

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

        public static Outage[] getOutagesForNode​(int nodeId,
                                                 SortStyle sortStyle,
                                                 OutageType outType,
                                                 javax.servlet.ServletContext servletContext)
                                          throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by given sort style for the given node.
        Parameters:
        nodeId - a int.
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForInterface

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

        public static Outage[] getOutagesForInterface​(int nodeId,
                                                      java.lang.String ipAddress,
                                                      SortStyle sortStyle,
                                                      OutageType outType,
                                                      javax.servlet.ServletContext servletContext)
                                               throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by given sort style for the given interface.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForInterface

        public static Outage[] getOutagesForInterface​(int nodeId,
                                                      java.lang.String ipAddress,
                                                      boolean includeResolved,
                                                      javax.servlet.ServletContext servletContext)
                                               throws java.sql.SQLException
        Deprecated.
        Replaced by {@link " #getOutagesForInterface(int,String,SortStyle,OutageType) getOutagesForInterface(int,String,SortStyle,OutageType)"}
        Return all outages (optionally only unresolved notices) sorted by id for the given interface.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        includeResolved - a boolean.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForInterface

        public static Outage[] getOutagesForInterface​(java.lang.String ipAddress)
                                               throws java.sql.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 Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForInterface

        public static Outage[] getOutagesForInterface​(java.lang.String ipAddress,
                                                      SortStyle sortStyle,
                                                      OutageType outType)
                                               throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by given sort style for the given IP address.
        Parameters:
        ipAddress - a String object.
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForInterface

        public static Outage[] getOutagesForInterface​(java.lang.String ipAddress,
                                                      boolean includeResolved)
                                               throws java.sql.SQLException
        Deprecated.
        Replaced by {@link " #getOutagesForInterface(String,SortStyle,OutageType) getOutagesForInterface(String,SortStyle,OutageType)"}
        Return all outages (optionally only unresolved outages) sorted by id that have the given IP address, regardless of what node they belong to.
        Parameters:
        ipAddress - a String object.
        includeResolved - a boolean.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForService

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

        public static Outage[] getOutagesForService​(int nodeId,
                                                    java.lang.String ipAddress,
                                                    int serviceId,
                                                    SortStyle sortStyle,
                                                    OutageType outType,
                                                    javax.servlet.ServletContext servletContext)
                                             throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by given sort style for the given service.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        serviceId - a int.
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForService

        public static Outage[] getOutagesForService​(int nodeId,
                                                    java.lang.String ipAddress,
                                                    int serviceId,
                                                    boolean includeResolved,
                                                    javax.servlet.ServletContext servletContext)
                                             throws java.sql.SQLException
        Deprecated.
        Replaced by {@link " #getOutagesForService(int,String,int,SortStyle,OutageType) getOutagesForInterface(int,String,int,SortStyle,OutageType)"}
        Return all outages (optionally only unresolved outages) sorted by time for the given service.
        Parameters:
        nodeId - a int.
        ipAddress - a String object.
        serviceId - a int.
        includeResolved - a boolean.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForService

        public static Outage[] getOutagesForService​(int serviceId,
                                                    javax.servlet.ServletContext servletContext)
                                             throws java.sql.SQLException
        Deprecated.
        Return all unresolved outages 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 Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForService

        public static Outage[] getOutagesForService​(int serviceId,
                                                    SortStyle sortStyle,
                                                    OutageType outType,
                                                    javax.servlet.ServletContext servletContext)
                                             throws java.sql.SQLException
        Deprecated.
        Return all outages (optionally only unresolved outages) sorted by given sort style for the given service identifier.
        Parameters:
        serviceId - a int.
        sortStyle - a SortStyle object.
        outType - a OutageType object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • getOutagesForService

        public static Outage[] getOutagesForService​(int serviceId,
                                                    boolean includeResolved,
                                                    javax.servlet.ServletContext servletContext)
                                             throws java.sql.SQLException
        Deprecated.
        Replaced by {@link " #getOutagesForService(int,SortStyle,OutageType) getOutagesForInterface(int,SortStyle,OutageType)"}
        Return all outages (optionally only unresolved outages) sorted by id for the given service type, regardless of what node or interface they belong to.
        Parameters:
        serviceId - a int.
        includeResolved - a boolean.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.
      • rs2Outages

        protected static Outage[] rs2Outages​(java.sql.ResultSet rs)
                                      throws java.sql.SQLException
        Deprecated.
        Convenience method for translating a java.sql.ResultSet containing outage information into an array of Outage objects.
        Parameters:
        rs - a ResultSet object.
        Returns:
        an array of Outage objects.
        Throws:
        java.sql.SQLException - if any.