public final class DbNodeEntry extends 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.
Modifier and Type | Method and Description |
---|---|
static DbNodeEntry |
clone(DbNodeEntry entry)
Deprecated.
Clones an existing entry.
|
static DbNodeEntry |
create()
Deprecated.
Creates a new entry.
|
static DbNodeEntry |
create(String poller)
Deprecated.
Creates a new entry.
|
void |
createAssetNodeEntry(Connection conn,
int nodeid)
Deprecated.
Creates a null entry for a nodeid into the assets table
|
static DbNodeEntry |
get(Connection db,
int nid)
Deprecated.
Retrieves a current record from the database based upon the key fields of
nodeID and dpName.
|
static DbNodeEntry |
get(Connection db,
int nid,
String dpName)
Deprecated.
Retrieves a current record from the database based upon the key fields of
nodeID and dpName.
|
static DbNodeEntry |
get(int nid)
Deprecated.
Retreives a current record from the database based upon the key fields of
nodeID and dpName.
|
static DbNodeEntry |
get(int nid,
String dpName)
Deprecated.
Retreives a current record from the database based upon the key fields of
nodeID and dpName.
|
Timestamp |
getCreationTime()
Deprecated.
Gets the creation time of the record.
|
String |
getDistributedPollerName()
Deprecated.
Returns the name of the distributed poller for the entry.
|
String |
getDomainName()
Deprecated.
Returns the current domain name.
|
String |
getForeignId()
Deprecated.
Returns the current foreignSource.
|
String |
getForeignSource()
Deprecated.
Returns the current foreignSource.
|
String |
getFormattedCreationTime()
Deprecated.
Gets the creation time of the record.
|
DbIpInterfaceEntry[] |
getInterfaces()
Deprecated.
|
DbIpInterfaceEntry[] |
getInterfaces(Connection db)
Deprecated.
|
String |
getLabel()
Deprecated.
Returns the entry's label.
|
OnmsNode.NodeLabelSource |
getLabelSource()
Deprecated.
Returns the current label source.
|
Timestamp |
getLastPoll()
Deprecated.
Gets the last poll time of the record
|
String |
getLastPollString()
Deprecated.
Gets the last poll time of the record
|
DbIpInterfaceEntry[] |
getManagedInterfaces()
Deprecated.
|
DbIpInterfaceEntry[] |
getManagedInterfaces(Connection db)
Deprecated.
|
String |
getNetBIOSName()
Deprecated.
Returns the current NetBIOS name.
|
int |
getNodeId()
Deprecated.
Returns the node entry's unique identifier.
|
OnmsNode.NodeType |
getNodeType()
Deprecated.
Returns the current node type
|
String |
getOS()
Deprecated.
Returns the current operating system string
|
int |
getParentId()
Deprecated.
Returns the id of the parent.
|
static DbIpInterfaceEntry |
getPrimarySnmpInterface(DbIpInterfaceEntry[] ipInterfaces)
Deprecated.
|
DbSnmpInterfaceEntry[] |
getSnmpInterfaces()
Deprecated.
|
DbSnmpInterfaceEntry[] |
getSnmpInterfaces(Connection db)
Deprecated.
|
String |
getSystemContact()
Deprecated.
Returns the current system contact.
|
String |
getSystemDescription()
Deprecated.
Returns the current system description
|
String |
getSystemLocation()
Deprecated.
Returns the current system location
|
String |
getSystemName()
Deprecated.
Gets the current system name
|
String |
getSystemOID()
Deprecated.
Returns the current SNMP system object id, if any.
|
boolean |
hasDomainNameChanged()
Deprecated.
|
boolean |
hasForeignId()
Deprecated.
|
boolean |
hasForeignSource()
Deprecated.
|
boolean |
hasLabelChanged()
Deprecated.
|
boolean |
hasLabelSourceChanged()
Deprecated.
|
boolean |
hasNetBIOSNameChanged()
Deprecated.
|
boolean |
hasNodeTypeChanged()
Deprecated.
|
boolean |
hasOSChanged()
Deprecated.
|
boolean |
hasParentId()
Deprecated.
Returns true if the entry has a parent identity.
|
boolean |
hasParentIdChanged()
Deprecated.
|
boolean |
hasSystemContactChanged()
Deprecated.
|
boolean |
hasSystemDescriptionChanged()
Deprecated.
|
boolean |
hasSystemLocationChanged()
Deprecated.
|
boolean |
hasSystemNameChanged()
Deprecated.
|
boolean |
hasSystemOIDChanged()
Deprecated.
|
void |
setCreationTime(Date time)
Deprecated.
Sets the current creation time.
|
void |
setCreationTime(String time)
Deprecated.
Sets the current creation time.
|
void |
setCreationTime(Timestamp time)
Deprecated.
Sets the current creation time.
|
void |
setDomainName(String domain)
Deprecated.
Sets the current domain name.
|
void |
setForeignId(String foreignId)
Deprecated.
Sets the current NetBIOS name.
|
void |
setForeignSource(String foreignSource)
Deprecated.
Sets the current NetBIOS name.
|
void |
setLabel(String label)
Deprecated.
Sets the current label for the entry.
|
void |
setLabelSource(OnmsNode.NodeLabelSource src)
Deprecated.
Sets the source of the node's label.
|
void |
setLastPoll(Date time)
Deprecated.
Sets the last poll time.
|
void |
setLastPoll(String time)
Deprecated.
Sets the last poll time.
|
void |
setLastPoll(Timestamp time)
Deprecated.
Sets the last poll time.
|
void |
setNetBIOSName(String name)
Deprecated.
Sets the current NetBIOS name.
|
void |
setNodeType(OnmsNode.NodeType type)
Deprecated.
Sets the node type
|
void |
setOS(String os)
Deprecated.
Sets the current operating system string.
|
void |
setParentId(int id)
Deprecated.
Sets the id of the parent.
|
void |
setSystemContact(String contact)
Deprecated.
Sets the current system contact.
|
void |
setSystemDescription(String descr)
Deprecated.
Sets the current system description
|
void |
setSystemLocation(String loc)
Deprecated.
Sets the current system location.
|
void |
setSystemName(String name)
Deprecated.
Sets the current system name.
|
void |
setSystemOID(String oid)
Deprecated.
Sets the current SNMP system object id.
|
void |
store()
Deprecated.
Updates the node information in the configured database.
|
void |
store(Connection db)
Deprecated.
Updates the node information in the configured database.
|
String |
toString()
Deprecated.
Creates a string that displays the internal contents of the record.
|
boolean |
updateDomainName(String domain)
Deprecated.
|
boolean |
updateForeignId(String newForeignId)
Deprecated.
|
boolean |
updateForeignSource(String newForeignSource)
Deprecated.
|
boolean |
updateLabel(String newlabel)
Deprecated.
|
boolean |
updateLabelSource(OnmsNode.NodeLabelSource newlabelSource)
Deprecated.
|
boolean |
updateNetBIOSName(String newnbName)
Deprecated.
|
boolean |
updateNodeType(OnmsNode.NodeType newtype)
Deprecated.
|
boolean |
updateOS(String newos)
Deprecated.
|
boolean |
updateParentId(int newparentId)
Deprecated.
|
boolean |
updateSystemContact(String newsyscontact)
Deprecated.
|
boolean |
updateSystemDescription(String newsysdescr)
Deprecated.
|
boolean |
updateSystemLocation(String newsyslocation)
Deprecated.
|
boolean |
updateSystemName(String newsysname)
Deprecated.
|
boolean |
updateSystemOID(String newsysoid)
Deprecated.
Update the value of sysoid associated with this node entry.
|
public int getNodeId()
public String getDistributedPollerName()
public Timestamp getCreationTime()
public String getFormattedCreationTime()
public void setCreationTime(String time) throws ParseException
time
- The creation time.ParseException
public void setCreationTime(Date time)
time
- The creation time.public void setCreationTime(Timestamp time)
time
- The creation time.public boolean hasParentId()
public int getParentId()
public void setParentId(int id)
id
- The new parent id.public boolean hasParentIdChanged()
public boolean updateParentId(int newparentId)
public OnmsNode.NodeType getNodeType()
public void setNodeType(OnmsNode.NodeType type)
type
- The new node type.public boolean hasNodeTypeChanged()
public boolean updateNodeType(OnmsNode.NodeType newtype)
public String getSystemOID()
public void setSystemOID(String oid)
public boolean hasSystemOIDChanged()
public boolean updateSystemOID(String newsysoid)
public String getSystemName()
public void setSystemName(String name)
name
- The new system namepublic boolean hasSystemNameChanged()
public boolean updateSystemName(String newsysname)
public String getSystemDescription()
public void setSystemDescription(String descr)
descr
- The new system description.public boolean hasSystemDescriptionChanged()
public boolean updateSystemDescription(String newsysdescr)
public String getSystemLocation()
public void setSystemLocation(String loc)
loc
- The new locationpublic boolean hasSystemLocationChanged()
public boolean updateSystemLocation(String newsyslocation)
public String getSystemContact()
public void setSystemContact(String contact)
contact
- The new system contactpublic boolean hasSystemContactChanged()
public boolean updateSystemContact(String newsyscontact)
public String getLabel()
public void setLabel(String label)
label
- The new label.public boolean hasLabelChanged()
public boolean updateLabel(String newlabel)
public OnmsNode.NodeLabelSource getLabelSource()
public void setLabelSource(OnmsNode.NodeLabelSource src)
src
- The new label source.public boolean hasLabelSourceChanged()
public boolean updateLabelSource(OnmsNode.NodeLabelSource newlabelSource)
public String getNetBIOSName()
public void setNetBIOSName(String name)
name
- The new NetBIOS name.public boolean hasNetBIOSNameChanged()
public boolean updateNetBIOSName(String newnbName)
public String getDomainName()
public void setDomainName(String domain)
domain
- The new domain name.public boolean hasDomainNameChanged()
public boolean updateDomainName(String domain)
public String getOS()
public void setOS(String os)
os
- The OS stringpublic boolean hasOSChanged()
public boolean updateOS(String newos)
public String getLastPollString()
public Timestamp getLastPoll()
public void setLastPoll(String time) throws ParseException
time
- The last poll time.ParseException
public void setLastPoll(Date time)
time
- The last poll time.public void setLastPoll(Timestamp time)
time
- The last poll time.public String getForeignSource()
public void setForeignSource(String foreignSource)
name
- The new NetBIOS name.public boolean hasForeignSource()
public boolean updateForeignSource(String newForeignSource)
public String getForeignId()
public void setForeignId(String foreignId)
name
- The new NetBIOS name.public boolean hasForeignId()
public boolean updateForeignId(String newForeignId)
public void store() throws SQLException
SQLException
public void store(Connection db) throws SQLException
db
- The database connection used to write the record.SQLException
public DbIpInterfaceEntry[] getInterfaces() throws SQLException
SQLException
public DbIpInterfaceEntry[] getInterfaces(Connection db) throws SQLException
SQLException
public DbIpInterfaceEntry[] getManagedInterfaces() throws SQLException
SQLException
public DbIpInterfaceEntry[] getManagedInterfaces(Connection db) throws SQLException
SQLException
public static DbIpInterfaceEntry getPrimarySnmpInterface(DbIpInterfaceEntry[] ipInterfaces)
public DbSnmpInterfaceEntry[] getSnmpInterfaces() throws SQLException
SQLException
public DbSnmpInterfaceEntry[] getSnmpInterfaces(Connection db) throws SQLException
SQLException
public static DbNodeEntry create()
store
.public static DbNodeEntry create(String poller)
store
.poller
- The name of the distributed poller to use.public static DbNodeEntry clone(DbNodeEntry entry)
entry
- The entry to be clonedpublic static DbNodeEntry get(int nid) throws SQLException
nid
- The node id keySQLException
public static DbNodeEntry get(int nid, String dpName) throws SQLException
nid
- The node id keySQLException
public static DbNodeEntry get(Connection db, int nid) throws SQLException
db
- The database connection used to load the entry.nid
- The node id keySQLException
public static DbNodeEntry get(Connection db, int nid, String dpName) throws SQLException
db
- The database connection used to load the entry.nid
- The node id keydpName
- The distribute poller name keySQLException
public String toString()
public void createAssetNodeEntry(Connection conn, int nodeid) throws SQLException
conn
- a Connection
object.nodeid
- a int.SQLException
- if any.Copyright © 2015. All rights reserved.