OpenNMS API 1.2.9

## org.opennms.web.outage
Class OutageModel

    java.lang.Object
      org.opennms.web.outage.OutageModel

public class OutageModel
extends java.lang.Object

As the nonvisual logic for the Services Down (Outage) servlet and JSPs, this class queries the database for current outages and provides utility methods for manipulating that list of outages.

Author:
  Lawrence Karnowski , OpenNMS

Constructor Summary
`OutageModel()` Create a new `OutageModel`.

Method Summary
`int` `getCurrentOutageCount()`
`Outage[]` `getCurrentOutages()` Query the database to retrieve the current outages.
`Outage[]` `getCurrentOutagesForNode(int nodeId)`
`OutageSummary[]` `getCurrentOutageSummaries()` Return a list of IP addresses, the number of services down on each IP address, and the longest time a service has been down for each IP address.
`OutageSummary[]` `getCurrentSDSOutageSummaries()` Return a list of IP addresses, the number of services down on each IP address, and the longest time a service has been down for each IP address.
`Outage[]` `getNonCurrentOutagesForNode(int nodeId)`
`Outage[]` `getOutagesForInterface(int nodeId, java.lang.String ipInterface)`
`Outage[]` `getOutagesForInterface(int nodeId, java.lang.String ipAddr, java.util.Date time)` Get all current outages and any resolved outages since the given time for the given interface.
`Outage[]` `getOutagesForNode(int nodeId)` Get all outages for a given node.
`Outage[]` `getOutagesForNode(int nodeId, java.util.Date time)` Get all current outages and any resolved outages since the given time for the given node.
`Outage[]` `getOutagesForService(int nodeId, java.lang.String ipInterface, int serviceId)`
`Outage[]` `getOutagesForService(int nodeId, java.lang.String ipAddr, int serviceId, java.util.Date time)` Get all current outages and any resolved outages since the given time for the given service.
`protected static Outage[]` `rs2Outages(java.sql.ResultSet rs)`
`protected static Outage[]` `rs2Outages(java.sql.ResultSet rs, boolean includesRegainedTime)`
`protected static Outage[]` `rs2Outages(java.sql.ResultSet rs, boolean includesRegainedTime, boolean includesNotifications)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OutageModel

    public OutageModel()

  Create a new `OutageModel`.

Method Detail

### getCurrentOutages

    public Outage[] getCurrentOutages()
                               throws java.sql.SQLException

  Query the database to retrieve the current outages.

  Returns:
    An array of `Outage`objects, or if there are none, an empty array.
  Throws:
    `java.sql.SQLException` - If there is a problem getting a database connection or making a query.

### getCurrentOutageCount

    public int getCurrentOutageCount()
                              throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getCurrentOutagesForNode

    public Outage[] getCurrentOutagesForNode(int nodeId)
                                      throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getNonCurrentOutagesForNode

    public Outage[] getNonCurrentOutagesForNode(int nodeId)
                                         throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getOutagesForNode

    public Outage[] getOutagesForNode(int nodeId)
                               throws java.sql.SQLException

  Get all outages for a given node.

  Throws:
    `java.sql.SQLException`

### getOutagesForNode

    public Outage[] getOutagesForNode(int nodeId,
                                      java.util.Date time)
                               throws java.sql.SQLException

  Get all current outages and any resolved outages since the given time for the given node.

  Parameters:
    `nodeId` - this is the node to query
    `time` - no resolved outages older than this time will be returned
  Returns:
    All current outages and resolved outages no older than `time`.
  Throws:
    `java.sql.SQLException`

### getOutagesForInterface

    public Outage[] getOutagesForInterface(int nodeId,
                                           java.lang.String ipInterface)
                                    throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getOutagesForInterface

    public Outage[] getOutagesForInterface(int nodeId,
                                           java.lang.String ipAddr,
                                           java.util.Date time)
                                    throws java.sql.SQLException

  Get all current outages and any resolved outages since the given time for the given interface.

  Parameters:
    `nodeId` - this is the node to query
    `ipAddr` - this is the interface to query
    `time` - no resolved outages older than this time will be returned
  Returns:
    All current outages and resolved outages no older than `time`.
  Throws:
    `java.sql.SQLException`

### getOutagesForService

    public Outage[] getOutagesForService(int nodeId,
                                         java.lang.String ipInterface,
                                         int serviceId)
                                  throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### getOutagesForService

    public Outage[] getOutagesForService(int nodeId,
                                         java.lang.String ipAddr,
                                         int serviceId,
                                         java.util.Date time)
                                  throws java.sql.SQLException

  Get all current outages and any resolved outages since the given time for the given service.

  Parameters:
    `nodeId` - this is the node to query
    `ipAddr` - this is the interface to query
    `serviceId` - this is the service to query
    `time` - no resolved outages older than this time will be returned
  Returns:
    All current outages and resolved outages no older than `time`.
  Throws:
    `java.sql.SQLException`

### getCurrentOutageSummaries

    public OutageSummary[] getCurrentOutageSummaries()
                                              throws java.sql.SQLException

  Return a list of IP addresses, the number of services down on each IP address, and the longest time a service has been down for each IP address. The list will be sorted in ascending order from the service down longest to the service down shortest.

  Throws:
    `java.sql.SQLException`

### getCurrentSDSOutageSummaries

    public OutageSummary[] getCurrentSDSOutageSummaries()
                                                 throws java.sql.SQLException

  Return a list of IP addresses, the number of services down on each IP address, and the longest time a service has been down for each IP address. The list will be sorted in ascending order from the service down longest to the service down shortest. This is a clone of getCurrentOutageSummaries for Harrah's (special consideration).

  Throws:
    `java.sql.SQLException`

### rs2Outages

    protected static Outage[] rs2Outages(java.sql.ResultSet rs)
                                  throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### rs2Outages

    protected static Outage[] rs2Outages(java.sql.ResultSet rs,
                                         boolean includesRegainedTime)
                                  throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

### rs2Outages

    protected static Outage[] rs2Outages(java.sql.ResultSet rs,
                                         boolean includesRegainedTime,
                                         boolean includesNotifications)
                                  throws java.sql.SQLException

  Throws:
    `java.sql.SQLException`

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.