OpenNMS API 1.2.9

## org.opennms.report.datablock
Class Interface

    java.lang.Object
      org.opennms.report.datablock.StandardNamedObject
          org.opennms.report.datablock.Interface

public class Interface
extends StandardNamedObject

This class holds the interface information and list of services that belong to the interface.

Author:
  Jacinta Remedios , oculan.com

Nested Class Summary
`private static class` `Interface.ServiceComparator`

Field Summary
`private java.util.ArrayList` `m_services` List of services.

Fields inherited from class org.opennms.report.datablock.StandardNamedObject
``

Constructor Summary
`Interface()` Default Constructor.
`Interface(java.util.ArrayList services)` Constructor that sets the services.
`Interface(java.lang.String name)` Constructor that sets the name.
`Interface(java.lang.String name, java.util.ArrayList services)` Constructor that sets the name of interface and sets the services.
`Interface(java.lang.String name, java.lang.String service)` Constructor that sets the name and adds service.
`Interface(java.lang.String name, java.lang.String service, long losttime)` Constructor that sets the name to interface and adds service and outage with lost time.
`Interface(java.lang.String name, java.lang.String service, long losttime, long regainedtime)` Constructor that sets the name to interface and adds service and outage with lost time and regained time.

Method Summary
`void` `addService(Service service)` Adds a new service object to this interface
`void` `addService(java.lang.String service)` Adds a new service to this interface
`void` `addService(java.lang.String service, long losttime)` Adds a new service to this interface.
`void` `addService(java.lang.String service, long losttime, long regainedtime)` Adds a service to this interface with outage having lost time and regained time.
`boolean` `equals(java.lang.Object obj)`
`long` `getDownTime(long currentTime, long rollingWindow)` Returns the down time for this interface.
`Service` `getService(java.lang.String svcname)` Return the Service object given the service name
`int` `getServiceAffectCount()` Returns the number of services affected.
`int` `getServiceCount()` Returns the number of services that this node/interface has.
`java.util.List` `getServices()` Return the services

Methods inherited from class org.opennms.report.datablock.StandardNamedObject
`getName, setName`

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

Field Detail

### m_services

    private java.util.ArrayList m_services

  List of services.

Constructor Detail

### Interface

    public Interface()

  Default Constructor.

### Interface

    public Interface(java.lang.String name,
                     java.util.ArrayList services)

  Constructor that sets the name of interface and sets the services.

Parameters:
  `name` - Name of the interface.
  `services` - Services to be set for this interface.

### Interface

    public Interface(java.lang.String name,
                     java.lang.String service)

  Constructor that sets the name and adds service. If there is already an interface with name, this method adds a service to this found service. Otherwise adds a new interface with service.

Parameters:
  `name` - Name of the interface.
  `service` - Name of the service to be added

### Interface

    public Interface(java.lang.String name,
                     java.lang.String service,
                     long losttime)

  Constructor that sets the name to interface and adds service and outage with lost time. If there is already an interface with name, adds a service depending upon whether it exists or not. Otherwise adds a new interface with service.

Parameters:
  `name` - Name of the interface.
  `service` - Name of the service to be added
  `losttime` - Lost time

### Interface

    public Interface(java.lang.String name,
                     java.lang.String service,
                     long losttime,
                     long regainedtime)

  Constructor that sets the name to interface and adds service and outage with lost time and regained time. If there is already an interface with name, adds a service depending upon whether it exists or not. Otherwise adds a new interface with service.

Parameters:
  `name` - Name of the interface.
  `service` - Name of the service to be added
  `losttime` - Lost time
  `regainedtime` - Regained Time

### Interface

    public Interface(java.lang.String name)

  Constructor that sets the name.

Parameters:
  `name` - Name of the interface.

### Interface

    public Interface(java.util.ArrayList services)

  Constructor that sets the services.

Parameters:
  `services` - Services for this interface to be set.

Method Detail

### getServices

    public java.util.List getServices()

  Return the services

  Returns:
    Services to be set.

### getService

    public Service getService(java.lang.String svcname)

  Return the Service object given the service name

  Parameters:
    `svcname` - The service name to lookup.
  Returns:
    Service with matching service name.

### addService

    public void addService(Service service)

  Adds a new service object to this interface

  Parameters:
    `service` - The service to be add.

### addService

    public void addService(java.lang.String service)

  Adds a new service to this interface

  Parameters:
    `service` - The name of the service to add.

### addService

    public void addService(java.lang.String service,
                           long losttime)

  Adds a new service to this interface.

  Parameters:
    `service` - Service name to be added
    `losttime` - Outage with lost time to be added to service

### addService

    public void addService(java.lang.String service,
                           long losttime,
                           long regainedtime)

  Adds a service to this interface with outage having lost time and regained time.

  Parameters:
    `service` - Service name
    `losttime` - Lost time
    `regainedtime` - Regained Time

### getDownTime

    public long getDownTime(long currentTime,
                            long rollingWindow)

  Returns the down time for this interface.

  Parameters:
    `currentTime` - End of rolling window
    `rollingWindow` - Rolling Window
  Returns:
    the down time for this interface.

### getServiceCount

    public int getServiceCount()

  Returns the number of services that this node/interface has.

### getServiceAffectCount

    public int getServiceAffectCount()

  Returns the number of services affected.

### equals

    public boolean equals(java.lang.Object obj)

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.