devices
Class PollResult

java.lang.Object
  extended bydevices.PollResult

public class PollResult
extends java.lang.Object

The actual information retrieved from a managed Attribute. The class conatins all the information about a specific Attribute at a single point in time.

It does not contain the actual IP Address of the Device. Retrieve this from the Device for which the Attribute was polled.

Version:
0.1
Author:
gswalters

Constructor Summary
PollResult(long deviceID, int ifIndex, int oid, java.lang.String ifDescr, long value)
          Create a PollResult w/o the timeStamp.
PollResult(long deviceID, int ifIndex, int oid, java.sql.Timestamp timeStamp, java.lang.String ifDescr, long value)
          Create a full PollResults object.
PollResult(java.sql.ResultSet sqlResults)
          Create a PollResult from a database query result.
 
Method Summary
 boolean dbAddPoll(java.sql.Connection dbConn)
          Save a poll of an Attribute to the databse.
 long getDeviceID()
          Getters & Setters
 java.lang.String getIfDescr()
           
 int getIfIndex()
           
 int getOid()
           
 java.sql.Timestamp getTimeStamp()
           
 long getValue()
           
 void setValue(long value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PollResult

public PollResult(long deviceID,
                  int ifIndex,
                  int oid,
                  java.lang.String ifDescr,
                  long value)
Create a PollResult w/o the timeStamp. Use this constructor to create a PollResult whith all available data except the timeStamp, which is set to now.

Parameters:
deviceID - database record ID of the Device
ifIndex - index of the Interface on the Device
oid - which Attribute of the Interface was polled
ifDescr - the description of the interface
value - long result of the poll

PollResult

public PollResult(long deviceID,
                  int ifIndex,
                  int oid,
                  java.sql.Timestamp timeStamp,
                  java.lang.String ifDescr,
                  long value)
Create a full PollResults object. Use this constructor when all the PollResult data is available.

Parameters:
deviceID - database record ID of the Device
ifIndex - index of the Interface on the Device
timeStamp - date the poll occured
oid - which Attribute of the Interface was polled
ifDescr - the description of the interface
value - long result of the poll

PollResult

public PollResult(java.sql.ResultSet sqlResults)
           throws java.sql.SQLException
Create a PollResult from a database query result.

Parameters:
sqlResults - ResultSet holding the row from which to create the PollResult
Throws:
java.sql.SQLException - to indicate any data translation problems
Method Detail

dbAddPoll

public boolean dbAddPoll(java.sql.Connection dbConn)
Save a poll of an Attribute to the databse.

Parameters:
dbConn - Connection to the database

toString

public java.lang.String toString()

getDeviceID

public long getDeviceID()
Getters & Setters


getIfIndex

public int getIfIndex()

getOid

public int getOid()

getTimeStamp

public java.sql.Timestamp getTimeStamp()

getIfDescr

public java.lang.String getIfDescr()

getValue

public long getValue()

setValue

public void setValue(long value)