OpenNMS API 1.2.3

org.opennms.netmgt.capsd
Class DbNodeEntry

java.lang.Object
  extended byorg.opennms.netmgt.capsd.DbNodeEntry

final class DbNodeEntry
extends java.lang.Object

This class is used to model a row of the node table from the OpenNMS database. The node table is indexed by the elements dpNode and nodeID. When a new element is created using the create call a node id will be automatically defined. If the name of the distribute poller is not passed to the create method, the it also is assigned a default value.

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 conneciton 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

Field Summary
private static int CHANGED_CREATE_TIME
           
private static int CHANGED_DOMAIN_NAME
           
private static int CHANGED_DPNAME
           
private static int CHANGED_LABEL
           
private static int CHANGED_LABEL_SOURCE
           
private static int CHANGED_NETBIOS_NAME
           
private static int CHANGED_OS
           
private static int CHANGED_PARENT_ID
           
private static int CHANGED_POLLTIME
           
private static int CHANGED_SYSCONTACT
           
private static int CHANGED_SYSDESCR
           
private static int CHANGED_SYSLOC
           
private static int CHANGED_SYSNAME
           
private static int CHANGED_SYSOID
           
private static int CHANGED_TYPE
           
private static java.lang.String DEFAULT_DP_NAME
          The default distributed poller name to use if one is not supplied
(package private) static char LABEL_SOURCE_ADDRESS
          Label source set by IP Address
(package private) static char LABEL_SOURCE_HOSTNAME
          Label source set by hostname
(package private) static char LABEL_SOURCE_NETBIOS
          Label source set by netbios
(package private) static char LABEL_SOURCE_SYSNAME
          Label source set by SNMP sysname
(package private) static char LABEL_SOURCE_UNKNOWN
          Label source unset/unknown
(package private) static char LABEL_SOURCE_USER
          Label source set by user
private  int m_changed
          The bit map used to determine which elements have changed since the record was created.
private  java.sql.Timestamp m_createTime
          The date the record was created, if any
private  java.lang.String m_dpName
          The name of the distributed poller
private  boolean m_fromDb
          True if this recored was loaded from the database.
private  java.lang.String m_label
          The node's label
private  char m_labelSource
          Source of the label
private  java.sql.Timestamp m_lastPoll
          The last time the node was scanned.
private  java.lang.String m_nbDomainName
          The netbios domain name
private  java.lang.String m_nbName
          The netbios name
private  int m_nodeId
          The node identifier
private  java.lang.String m_os
          The operating system
private  int m_parentId
          The parent identifier, if any
private  java.lang.String m_syscontact
          SNMP system contact
private  java.lang.String m_sysdescr
          SNMP system description
private  java.lang.String m_syslocation
          SNMP system location
private  java.lang.String m_sysname
          SNMP system name
private  java.lang.String m_sysoid
          SNMP system object identifier
private  char m_type
          The type of node, active or deleted.
(package private) static char NODE_TYPE_ACTIVE
          The character returned if the node is active
(package private) static char NODE_TYPE_DELETED
          The character returned if the node is deleted
(package private) static char NODE_TYPE_UNKNOWN
          The character returned if the node type is unset/unknown.
private static java.lang.String SQL_LOAD_IF_LIST
          The SQL statement used to read the list of IP Addresses associated with this node.
private static java.lang.String SQL_LOAD_MANAGED_IF_LIST
          The SQL statement used to read the list of managed IP Addresses associated with this node.
private static java.lang.String SQL_LOAD_REC
          The SQL statement used to read a node from the database.
private static java.lang.String SQL_LOAD_SNMP_LIST
          The SQL statement used to read the list of SNMP interface entries for this particular node.
private static java.lang.String SQL_NEXT_NID
          The SQL text used to extract the next sequence id for the node table.
 
Constructor Summary
private DbNodeEntry()
          Default constructor.
private DbNodeEntry(int nid)
          Constructs a new entry with the specific node identifier.
private DbNodeEntry(int nid, java.lang.String dpName)
          Constructs a new entry with the specific node identifier.
private DbNodeEntry(java.lang.String poller)
          Constructs a new node entry with no data, except that the distributed poller name is set to the passed string.
 
Method Summary
(package private) static DbNodeEntry clone(DbNodeEntry entry)
          Clones an existing entry.
(package private) static DbNodeEntry create()
          Creates a new entry.
(package private) static DbNodeEntry create(java.lang.String poller)
          Creates a new entry.
 void createAssetNodeEntry(java.sql.Connection conn, int nodeid)
          Creates a null entry for a nodeid into the assets table
(package private) static DbNodeEntry get(java.sql.Connection db, int nid)
          Retreives a current record from the database based upon the key fields of nodeID and dpName.
(package private) static DbNodeEntry get(java.sql.Connection db, int nid, java.lang.String dpName)
          Retreives a current record from the database based upon the key fields of nodeID and dpName.
(package private) static DbNodeEntry get(int nid)
          Retreives a current record from the database based upon the key fields of nodeID and dpName.
(package private) static DbNodeEntry get(int nid, java.lang.String dpName)
          Retreives a current record from the database based upon the key fields of nodeID and dpName.
(package private)  java.sql.Timestamp getCreationTime()
          Gets the creation time of the record.
(package private)  java.lang.String getDistributedPollerName()
          Returns the name of the distributed poller for the entry.
(package private)  java.lang.String getDomainName()
          Returns the current domain name.
(package private)  java.lang.String getFormattedCreationTime()
          Gets the creation time of the record.
(package private)  DbIpInterfaceEntry[] getInterfaces()
           
(package private)  DbIpInterfaceEntry[] getInterfaces(java.sql.Connection db)
           
(package private)  java.lang.String getLabel()
          Returns the entry's label.
(package private)  char getLabelSource()
          Returns the current label source.
(package private)  java.sql.Timestamp getLastPoll()
          Gets the last poll time of the record
(package private)  java.lang.String getLastPollString()
          Gets the last poll time of the record
(package private)  DbIpInterfaceEntry[] getManagedInterfaces()
           
(package private)  DbIpInterfaceEntry[] getManagedInterfaces(java.sql.Connection db)
           
(package private)  java.lang.String getNetBIOSName()
          Returns the current NetBIOS name.
(package private)  int getNodeId()
          Returns the node entry's unique identifier.
(package private)  char getNodeType()
          Returns the current node type
(package private)  java.lang.String getOS()
          Returns the current operating system string
(package private)  int getParentId()
          Returns the id of the parent.
(package private) static DbIpInterfaceEntry getPrimarySnmpInterface(DbIpInterfaceEntry[] ipInterfaces)
           
(package private)  DbSnmpInterfaceEntry[] getSnmpInterfaces()
           
(package private)  DbSnmpInterfaceEntry[] getSnmpInterfaces(java.sql.Connection db)
           
(package private)  java.lang.String getSystemContact()
          Returns the current system contact.
(package private)  java.lang.String getSystemDescription()
          Returns the current system description
(package private)  java.lang.String getSystemLocation()
          Returns the current system location
(package private)  java.lang.String getSystemName()
          Gets the current system name
(package private)  java.lang.String getSystemOID()
          Returns the current SNMP system object id, if any.
(package private)  boolean hasDomainNameChanged()
           
(package private)  boolean hasLabelChanged()
           
(package private)  boolean hasLabelSourceChanged()
           
(package private)  boolean hasNetBIOSNameChanged()
           
(package private)  boolean hasNodeTypeChanged()
           
(package private)  boolean hasOSChanged()
           
(package private)  boolean hasParentId()
          Returns true if the entry has a parent identity.
(package private)  boolean hasParentIdChanged()
           
(package private)  boolean hasSystemContactChanged()
           
(package private)  boolean hasSystemDescriptionChanged()
           
(package private)  boolean hasSystemLocationChanged()
           
(package private)  boolean hasSystemNameChanged()
           
(package private)  boolean hasSystemOIDChanged()
           
private  void insert(java.sql.Connection c)
          Inserts the new node into the node table of the OpenNMS databasee.
private  boolean load(java.sql.Connection c)
          Load the current node from the database.
(package private)  void setCreationTime(java.util.Date time)
          Sets the current creation time.
(package private)  void setCreationTime(java.lang.String time)
          Sets the current creation time.
(package private)  void setCreationTime(java.sql.Timestamp time)
          Sets the current creation time.
(package private)  void setDomainName(java.lang.String domain)
          Sets the current domain name.
(package private)  void setLabel(java.lang.String label)
          Sets the current label for the entry.
(package private)  void setLabelSource(char src)
          Sets the source of the node's label.
(package private)  void setLastPoll(java.util.Date time)
          Sets the last poll time.
(package private)  void setLastPoll(java.lang.String time)
          Sets the last poll time.
(package private)  void setLastPoll(java.sql.Timestamp time)
          Sets the last poll time.
(package private)  void setNetBIOSName(java.lang.String name)
          Sets the current NetBIOS name.
(package private)  void setNodeType(char type)
          Sets the node type
(package private)  void setOS(java.lang.String os)
          Sets the current operating system string.
(package private)  void setParentId(int id)
          Sets the id of the parent.
(package private)  void setSystemContact(java.lang.String contact)
          Sets the current system contact.
(package private)  void setSystemDescription(java.lang.String descr)
          Sets the current system description
(package private)  void setSystemLocation(java.lang.String loc)
          Sets the current system location.
(package private)  void setSystemName(java.lang.String name)
          Sets the current system name.
(package private)  void setSystemOID(java.lang.String oid)
          Sets the current SNMP system object id.
(package private)  void store()
          Updates the node information in the configured database.
(package private)  void store(java.sql.Connection db)
          Updates the node information in the configured database.
 java.lang.String toString()
          Creates a string that displays the internal contents of the record.
private  void update(java.sql.Connection c)
          Updates an existing record in the OpenNMS node table.
(package private)  boolean updateDomainName(java.lang.String domain)
           
(package private)  boolean updateLabel(java.lang.String newlabel)
           
(package private)  boolean updateLabelSource(char newlabelSource)
           
(package private)  boolean updateNetBIOSName(java.lang.String newnbName)
           
(package private)  boolean updateNodeType(char newtype)
           
(package private)  boolean updateOS(java.lang.String newos)
           
(package private)  boolean updateParentId(int newparentId)
           
(package private)  boolean updateSystemContact(java.lang.String newsyscontact)
           
(package private)  boolean updateSystemDescription(java.lang.String newsysdescr)
           
(package private)  boolean updateSystemLocation(java.lang.String newsyslocation)
           
(package private)  boolean updateSystemName(java.lang.String newsysname)
           
(package private)  boolean updateSystemOID(java.lang.String newsysoid)
          Update the value of sysoid associated with this node entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_TYPE_ACTIVE

static final char NODE_TYPE_ACTIVE
The character returned if the node is active

See Also:
Constant Field Values

NODE_TYPE_DELETED

static final char NODE_TYPE_DELETED
The character returned if the node is deleted

See Also:
Constant Field Values

NODE_TYPE_UNKNOWN

static final char NODE_TYPE_UNKNOWN
The character returned if the node type is unset/unknown.

See Also:
Constant Field Values

LABEL_SOURCE_USER

static final char LABEL_SOURCE_USER
Label source set by user

See Also:
Constant Field Values

LABEL_SOURCE_NETBIOS

static final char LABEL_SOURCE_NETBIOS
Label source set by netbios

See Also:
Constant Field Values

LABEL_SOURCE_HOSTNAME

static final char LABEL_SOURCE_HOSTNAME
Label source set by hostname

See Also:
Constant Field Values

LABEL_SOURCE_SYSNAME

static final char LABEL_SOURCE_SYSNAME
Label source set by SNMP sysname

See Also:
Constant Field Values

LABEL_SOURCE_ADDRESS

static final char LABEL_SOURCE_ADDRESS
Label source set by IP Address

See Also:
Constant Field Values

LABEL_SOURCE_UNKNOWN

static final char LABEL_SOURCE_UNKNOWN
Label source unset/unknown

See Also:
Constant Field Values

DEFAULT_DP_NAME

private static final java.lang.String DEFAULT_DP_NAME
The default distributed poller name to use if one is not supplied

See Also:
Constant Field Values

SQL_NEXT_NID

private static final java.lang.String SQL_NEXT_NID
The SQL text used to extract the next sequence id for the node table.

See Also:
Constant Field Values

SQL_LOAD_REC

private static final java.lang.String SQL_LOAD_REC
The SQL statement used to read a node from the database. This record is keyed by the node identifier and distributed poller name.

See Also:
Constant Field Values

SQL_LOAD_IF_LIST

private static final java.lang.String SQL_LOAD_IF_LIST
The SQL statement used to read the list of IP Addresses associated with this node.

See Also:
Constant Field Values

SQL_LOAD_MANAGED_IF_LIST

private static final java.lang.String SQL_LOAD_MANAGED_IF_LIST
The SQL statement used to read the list of managed IP Addresses associated with this node.

See Also:
Constant Field Values

SQL_LOAD_SNMP_LIST

private static final java.lang.String SQL_LOAD_SNMP_LIST
The SQL statement used to read the list of SNMP interface entries for this particular node.

See Also:
Constant Field Values

m_fromDb

private boolean m_fromDb
True if this recored was loaded from the database. False if it's new.


m_nodeId

private int m_nodeId
The node identifier


m_dpName

private java.lang.String m_dpName
The name of the distributed poller


m_createTime

private java.sql.Timestamp m_createTime
The date the record was created, if any


m_parentId

private int m_parentId
The parent identifier, if any


m_type

private char m_type
The type of node, active or deleted.


m_sysoid

private java.lang.String m_sysoid
SNMP system object identifier


m_sysname

private java.lang.String m_sysname
SNMP system name


m_sysdescr

private java.lang.String m_sysdescr
SNMP system description


m_syslocation

private java.lang.String m_syslocation
SNMP system location


m_syscontact

private java.lang.String m_syscontact
SNMP system contact


m_label

private java.lang.String m_label
The node's label


m_labelSource

private char m_labelSource
Source of the label


m_nbName

private java.lang.String m_nbName
The netbios name


m_nbDomainName

private java.lang.String m_nbDomainName
The netbios domain name


m_os

private java.lang.String m_os
The operating system


m_lastPoll

private java.sql.Timestamp m_lastPoll
The last time the node was scanned.


m_changed

private int m_changed
The bit map used to determine which elements have changed since the record was created.


CHANGED_CREATE_TIME

private static final int CHANGED_CREATE_TIME
See Also:
Constant Field Values

CHANGED_PARENT_ID

private static final int CHANGED_PARENT_ID
See Also:
Constant Field Values

CHANGED_TYPE

private static final int CHANGED_TYPE
See Also:
Constant Field Values

CHANGED_SYSOID

private static final int CHANGED_SYSOID
See Also:
Constant Field Values

CHANGED_SYSNAME

private static final int CHANGED_SYSNAME
See Also:
Constant Field Values

CHANGED_SYSLOC

private static final int CHANGED_SYSLOC
See Also:
Constant Field Values

CHANGED_SYSCONTACT

private static final int CHANGED_SYSCONTACT
See Also:
Constant Field Values

CHANGED_LABEL

private static final int CHANGED_LABEL
See Also:
Constant Field Values

CHANGED_LABEL_SOURCE

private static final int CHANGED_LABEL_SOURCE
See Also:
Constant Field Values

CHANGED_NETBIOS_NAME

private static final int CHANGED_NETBIOS_NAME
See Also:
Constant Field Values

CHANGED_DOMAIN_NAME

private static final int CHANGED_DOMAIN_NAME
See Also:
Constant Field Values

CHANGED_OS

private static final int CHANGED_OS
See Also:
Constant Field Values

CHANGED_DPNAME

private static final int CHANGED_DPNAME
See Also:
Constant Field Values

CHANGED_SYSDESCR

private static final int CHANGED_SYSDESCR
See Also:
Constant Field Values

CHANGED_POLLTIME

private static final int CHANGED_POLLTIME
See Also:
Constant Field Values
Constructor Detail

DbNodeEntry

private DbNodeEntry()
Default constructor. Constructs an empty node entry with no data. The default distributed poller name is used internally.


DbNodeEntry

private DbNodeEntry(java.lang.String poller)
Constructs a new node entry with no data, except that the distributed poller name is set to the passed string.

Parameters:
poller - The poller name.

DbNodeEntry

private DbNodeEntry(int nid)
Constructs a new entry with the specific node identifier. Once set the node identifier is non-mutable. If this constructor is used the record must already exists in the database.

Parameters:
nid - The node identifier.

DbNodeEntry

private DbNodeEntry(int nid,
                    java.lang.String dpName)
Constructs a new entry with the specific node identifier. Once set the node identifier is non-mutable. If this constructor is used the record must already exists in the database.

Parameters:
nid - The node identifier.
dpName - The name of the distributed poller.
Method Detail

insert

private void insert(java.sql.Connection c)
             throws java.sql.SQLException
Inserts the new node into the node table of the OpenNMS databasee.

Parameters:
c - The connection to the database.
Throws:
java.sql.SQLException - Thrown if an error occurs with the connection

update

private void update(java.sql.Connection c)
             throws java.sql.SQLException
Updates an existing record in the OpenNMS node table.

Parameters:
c - The connection used for the update.
Throws:
java.sql.SQLException - Thrown if an error occurs with the connection

load

private boolean load(java.sql.Connection c)
              throws java.sql.SQLException
Load the current node from the database. If the node was modified, the modifications are lost. The nodeid and dpName must be set prior to this call.

Parameters:
c - The connection used to load the data.
Throws:
java.sql.SQLException - Thrown if an error occurs with the connection

getNodeId

int getNodeId()
Returns the node entry's unique identifier. This is a non-mutable element. If the record does not yet exist in the database then a -1 is returned.


getDistributedPollerName

java.lang.String getDistributedPollerName()
Returns the name of the distributed poller for the entry. This is a non-mutable element of the record.


getCreationTime

java.sql.Timestamp getCreationTime()
Gets the creation time of the record.


getFormattedCreationTime

java.lang.String getFormattedCreationTime()
Gets the creation time of the record.


setCreationTime

void setCreationTime(java.lang.String time)
               throws java.text.ParseException
Sets the current creation time.

Parameters:
time - The creation time.
Throws:
java.text.ParseException

setCreationTime

void setCreationTime(java.util.Date time)
Sets the current creation time.

Parameters:
time - The creation time.

setCreationTime

void setCreationTime(java.sql.Timestamp time)
Sets the current creation time.

Parameters:
time - The creation time.

hasParentId

boolean hasParentId()
Returns true if the entry has a parent identity.


getParentId

int getParentId()
Returns the id of the parent.


setParentId

void setParentId(int id)
Sets the id of the parent.

Parameters:
id - The new parent id.

hasParentIdChanged

boolean hasParentIdChanged()

updateParentId

boolean updateParentId(int newparentId)

getNodeType

char getNodeType()
Returns the current node type


setNodeType

void setNodeType(char type)
Sets the node type

Parameters:
type - The new node type.

hasNodeTypeChanged

boolean hasNodeTypeChanged()

updateNodeType

boolean updateNodeType(char newtype)

getSystemOID

java.lang.String getSystemOID()
Returns the current SNMP system object id, if any.


setSystemOID

void setSystemOID(java.lang.String oid)
Sets the current SNMP system object id.


hasSystemOIDChanged

boolean hasSystemOIDChanged()

updateSystemOID

boolean updateSystemOID(java.lang.String newsysoid)
Update the value of sysoid associated with this node entry.


getSystemName

java.lang.String getSystemName()
Gets the current system name


setSystemName

void setSystemName(java.lang.String name)
Sets the current system name.

Parameters:
name - The new system name

hasSystemNameChanged

boolean hasSystemNameChanged()

updateSystemName

boolean updateSystemName(java.lang.String newsysname)

getSystemDescription

java.lang.String getSystemDescription()
Returns the current system description


setSystemDescription

void setSystemDescription(java.lang.String descr)
Sets the current system description

Parameters:
descr - The new system description.

hasSystemDescriptionChanged

boolean hasSystemDescriptionChanged()

updateSystemDescription

boolean updateSystemDescription(java.lang.String newsysdescr)

getSystemLocation

java.lang.String getSystemLocation()
Returns the current system location


setSystemLocation

void setSystemLocation(java.lang.String loc)
Sets the current system location.

Parameters:
loc - The new location

hasSystemLocationChanged

boolean hasSystemLocationChanged()

updateSystemLocation

boolean updateSystemLocation(java.lang.String newsyslocation)

getSystemContact

java.lang.String getSystemContact()
Returns the current system contact.


setSystemContact

void setSystemContact(java.lang.String contact)
Sets the current system contact.

Parameters:
contact - The new system contact

hasSystemContactChanged

boolean hasSystemContactChanged()

updateSystemContact

boolean updateSystemContact(java.lang.String newsyscontact)

getLabel

java.lang.String getLabel()
Returns the entry's label.


setLabel

void setLabel(java.lang.String label)
Sets the current label for the entry.

Parameters:
label - The new label.

hasLabelChanged

boolean hasLabelChanged()

updateLabel

boolean updateLabel(java.lang.String newlabel)

getLabelSource

char getLabelSource()
Returns the current label source.


setLabelSource

void setLabelSource(char src)
Sets the source of the node's label.

Parameters:
src - The new label source.

hasLabelSourceChanged

boolean hasLabelSourceChanged()

updateLabelSource

boolean updateLabelSource(char newlabelSource)

getNetBIOSName

java.lang.String getNetBIOSName()
Returns the current NetBIOS name.


setNetBIOSName

void setNetBIOSName(java.lang.String name)
Sets the current NetBIOS name.

Parameters:
name - The new NetBIOS name.

hasNetBIOSNameChanged

boolean hasNetBIOSNameChanged()

updateNetBIOSName

boolean updateNetBIOSName(java.lang.String newnbName)

getDomainName

java.lang.String getDomainName()
Returns the current domain name.


setDomainName

void setDomainName(java.lang.String domain)
Sets the current domain name.

Parameters:
domain - The new domain name.

hasDomainNameChanged

boolean hasDomainNameChanged()

updateDomainName

boolean updateDomainName(java.lang.String domain)

getOS

java.lang.String getOS()
Returns the current operating system string


setOS

void setOS(java.lang.String os)
Sets the current operating system string.

Parameters:
os - The OS string

hasOSChanged

boolean hasOSChanged()

updateOS

boolean updateOS(java.lang.String newos)

getLastPollString

java.lang.String getLastPollString()
Gets the last poll time of the record


getLastPoll

java.sql.Timestamp getLastPoll()
Gets the last poll time of the record


setLastPoll

void setLastPoll(java.lang.String time)
           throws java.text.ParseException
Sets the last poll time.

Parameters:
time - The last poll time.
Throws:
java.text.ParseException

setLastPoll

void setLastPoll(java.util.Date time)
Sets the last poll time.

Parameters:
time - The last poll time.

setLastPoll

void setLastPoll(java.sql.Timestamp time)
Sets the last poll time.

Parameters:
time - The last poll time.

store

void store()
     throws java.sql.SQLException
Updates the node information in the configured database. If the node does not exist the a new row in the table is created. If the element already exists then it's current row is updated as needed based upon the current changes to the node.

Throws:
java.sql.SQLException

store

void store(java.sql.Connection db)
     throws java.sql.SQLException
Updates the node information in the configured database. If the node does not exist the a new row in the table is created. If the element already exists then it's current row is updated as needed based upon the current changes to the node.

Parameters:
db - The database connection used to write the record.
Throws:
java.sql.SQLException

getInterfaces

DbIpInterfaceEntry[] getInterfaces()
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getInterfaces

DbIpInterfaceEntry[] getInterfaces(java.sql.Connection db)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getManagedInterfaces

DbIpInterfaceEntry[] getManagedInterfaces()
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getManagedInterfaces

DbIpInterfaceEntry[] getManagedInterfaces(java.sql.Connection db)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getPrimarySnmpInterface

static DbIpInterfaceEntry getPrimarySnmpInterface(DbIpInterfaceEntry[] ipInterfaces)

getSnmpInterfaces

DbSnmpInterfaceEntry[] getSnmpInterfaces()
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getSnmpInterfaces

DbSnmpInterfaceEntry[] getSnmpInterfaces(java.sql.Connection db)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

create

static DbNodeEntry create()
Creates a new entry. The entry is created in memory, but is not written to the database until the first call to store.

Returns:
A new node record.

create

static DbNodeEntry create(java.lang.String poller)
Creates a new entry. The entry is created in memory, but is not written to the database until the first call to store.

Parameters:
poller - The name of the distributed poller to use.
Returns:
A new node record.

clone

static DbNodeEntry clone(DbNodeEntry entry)
Clones an existing entry.

Parameters:
entry - The entry to be cloned
Returns:
a new DbNodeEntry identical to the original

get

static DbNodeEntry get(int nid)
                throws java.sql.SQLException
Retreives a current record from the database based upon the key fields of nodeID and dpName. If the record cannot be found then a null reference is returnd.

Parameters:
nid - The node id key
Returns:
The loaded entry or null if one could not be found.
Throws:
java.sql.SQLException

get

static DbNodeEntry get(int nid,
                       java.lang.String dpName)
                throws java.sql.SQLException
Retreives a current record from the database based upon the key fields of nodeID and dpName. If the record cannot be found then a null reference is returnd.

Parameters:
nid - The node id key
Returns:
The loaded entry or null if one could not be found.
Throws:
java.sql.SQLException

get

static DbNodeEntry get(java.sql.Connection db,
                       int nid)
                throws java.sql.SQLException
Retreives a current record from the database based upon the key fields of nodeID and dpName. If the record cannot be found then a null reference is returnd.

Parameters:
db - The databse connection used to load the entry.
nid - The node id key
Returns:
The loaded entry or null if one could not be found.
Throws:
java.sql.SQLException

get

static DbNodeEntry get(java.sql.Connection db,
                       int nid,
                       java.lang.String dpName)
                throws java.sql.SQLException
Retreives a current record from the database based upon the key fields of nodeID and dpName. If the record cannot be found then a null reference is returnd.

Parameters:
db - The databse connection used to load the entry.
nid - The node id key
dpName - The distribute poller name key
Returns:
The loaded entry or null if one could not be found.
Throws:
java.sql.SQLException

toString

public java.lang.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.


createAssetNodeEntry

public void createAssetNodeEntry(java.sql.Connection conn,
                                 int nodeid)
                          throws java.sql.SQLException
Creates a null entry for a nodeid into the assets table

Throws:
java.sql.SQLException

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.