org.opennms.netmgt.capsd
Class DbSnmpInterfaceEntry

java.lang.Object
  extended by org.opennms.netmgt.capsd.DbSnmpInterfaceEntry

public final class DbSnmpInterfaceEntry
extends Object

Once loaded or create, the class tracks any changes and will write those changes to the database whenever the store method is invoked. If a database connection is not passed to the store method, then a temporary one is allocated to write the results.

NOTE: if the connection is passed in and is not in auto commit mode, then the caller must call commit to inform the database that the transaction is complete.

Author:
Weave , OpenNMS

Method Summary
static DbSnmpInterfaceEntry get(Connection db, long nodeId, int ifIndex)
          Retrieves a current record from the database based upon the key fields of nodeID and ifIndex.
static DbSnmpInterfaceEntry get(long nodeId, int ifIndex)
          Retrieves a current record from the database based upon the key fields of nodeID and ifindex.
 String getAlias()
           
static void main(String[] args)
          For debugging only
 String toString()
          Creates a string that displays the internal contents of the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAlias

public String getAlias()

get

public static DbSnmpInterfaceEntry get(long nodeId,
                                       int ifIndex)
                                throws SQLException
Retrieves a current record from the database based upon the key fields of nodeID and ifindex. If the record cannot be found then a null reference is returned.

Parameters:
nodeId - The node id key
ifIndex - the interface index.
Returns:
The loaded entry or null if one could not be found.
Throws:
SQLException

get

public static DbSnmpInterfaceEntry get(Connection db,
                                       long nodeId,
                                       int ifIndex)
                                throws SQLException
Retrieves a current record from the database based upon the key fields of nodeID and ifIndex. If the record cannot be found then a null reference is returned.

Parameters:
db - The database connection used to load the entry.
nodeId - The node id key
ifIndex - The interface index.
Returns:
The loaded entry or null if one could not be found.
Throws:
SQLException

toString

public String toString()
Creates a string that displays the internal contents of the record. This is mainly just used for debug output since the format is ad-hoc.

Overrides:
toString in class Object
Returns:
a String object.

main

public static void main(String[] args)
For debugging only

Parameters:
args - an array of String objects.


Copyright © 2011. All Rights Reserved.