org.opennms.bb.dp.poller.scheduler.utils
Class PollerInterface

java.lang.Object
  |
  +--org.opennms.bb.dp.poller.scheduler.utils.PollerInterface

public class PollerInterface
extends Object

This class represents a BlueBird interface and operations that can be made on them.

Version:
$Revision: 1.7 $
Author:
Jason Johns, OpenNMS

Inner Class Summary
private  class PollerInterface.Service
           
 
Field Summary
private static int DAY_MULTIPLIER
           
private static char DAYS
           
private static int HOUR_MULTIPLIER
           
private static char HOURS
           
private  String m_address
          The ip address of the interface
private  DBConnection m_connection
           
private  String m_managedStatus
          Indicates if the interface is managed or not
private  PollerPackage m_package
          The list of packages that this interface is a member of
private  int m_packageIndex
          This is the index into the list that the scheduler has.
private  HashMap m_services
          The list of services that this interface supports
static String MANAGED
           
private static int MINUTE_MULTIPLIER
           
private static char MINUTES
           
static String NOT_MANAGED
           
private static int SECOND_MULTIPLIER
           
private static char SECONDS
           
 
Constructor Summary
PollerInterface(String anAddress, PollerPackage aPackage, int aPackageIndex)
          Constructor, sets the ip address
 
Method Summary
 String getAddress()
          This method returns the ip address
private  int getDownIntervalSeconds(String aServiceName, Calendar lastUp)
           
 String getManaged()
          This method returns the managed status of the interface
private  String getManagedStatus(DBConnection aConnection, String anAddress)
           
 Integer getNewInterval(String aServiceName, int aStatus)
           
 PollerNode getNode()
          This method returns the PollerNode associated with this interface
 PollerPackage getPackage()
           
 int getPackageIndex()
           
 int getServiceLastKnownStatus(String aServiceName)
           
private  HashMap getServices(DBConnection aConnection, String anAddress)
           
private  int getUpIntervalSeconds(String aServiceName)
           
 boolean supportsService(String aService)
           
 String toString()
          This method returns a string representation of the PollerInterface
 void updateStatus(String aServiceName, int aStatus)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

m_address

private String m_address
The ip address of the interface

m_services

private HashMap m_services
The list of services that this interface supports

m_managedStatus

private String m_managedStatus
Indicates if the interface is managed or not

m_package

private PollerPackage m_package
The list of packages that this interface is a member of

m_packageIndex

private int m_packageIndex
This is the index into the list that the scheduler has. This interface will be put into a list associated with a given package, this is the index to find that package.

m_connection

private DBConnection m_connection

MANAGED

public static final String MANAGED

NOT_MANAGED

public static final String NOT_MANAGED

SECONDS

private static final char SECONDS

MINUTES

private static final char MINUTES

HOURS

private static final char HOURS

DAYS

private static final char DAYS

SECOND_MULTIPLIER

private static final int SECOND_MULTIPLIER

MINUTE_MULTIPLIER

private static final int MINUTE_MULTIPLIER

HOUR_MULTIPLIER

private static final int HOUR_MULTIPLIER

DAY_MULTIPLIER

private static final int DAY_MULTIPLIER
Constructor Detail

PollerInterface

public PollerInterface(String anAddress,
                       PollerPackage aPackage,
                       int aPackageIndex)
                throws SQLException,
                       DBOpenFailureException
Constructor, sets the ip address
Parameters:
Integer - anAddress, the ip address of the interface
Method Detail

updateStatus

public void updateStatus(String aServiceName,
                         int aStatus)

getUpIntervalSeconds

private int getUpIntervalSeconds(String aServiceName)

getDownIntervalSeconds

private int getDownIntervalSeconds(String aServiceName,
                                   Calendar lastUp)

getNewInterval

public Integer getNewInterval(String aServiceName,
                              int aStatus)

getServiceLastKnownStatus

public int getServiceLastKnownStatus(String aServiceName)

getPackage

public PollerPackage getPackage()

getPackageIndex

public int getPackageIndex()

getServices

private HashMap getServices(DBConnection aConnection,
                            String anAddress)
                     throws SQLException

getManagedStatus

private String getManagedStatus(DBConnection aConnection,
                                String anAddress)
                         throws SQLException

getManaged

public String getManaged()
This method returns the managed status of the interface
Returns:
String, the managed status

getAddress

public String getAddress()
This method returns the ip address
Returns:
Integer, the ip address

getNode

public PollerNode getNode()
This method returns the PollerNode associated with this interface
Returns:
PollerNode, the interfaces parent node

supportsService

public boolean supportsService(String aService)

toString

public String toString()
This method returns a string representation of the PollerInterface
Overrides:
toString in class Object
Returns:
String, the string representation of the PollerInterface