|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.capsd.DbSnmpInterfaceEntry
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.
Field Summary | |
private static int |
CHANGED_DESCRIPTION
|
private static int |
CHANGED_IFADDRESS
|
private static int |
CHANGED_IFADMINSTATUS
|
private static int |
CHANGED_IFALIAS
|
private static int |
CHANGED_IFNAME
|
private static int |
CHANGED_IFOPERSTATUS
|
private static int |
CHANGED_IFSPEED
|
private static int |
CHANGED_IFTYPE
|
private static int |
CHANGED_NETMASK
|
private static int |
CHANGED_PHYSADDR
|
private int |
m_changed
The bit map used to determine which elements have changed since the record was created. |
private boolean |
m_fromDb
True if this recored was loaded from the database. |
private int |
m_ifAdminStatus
|
private java.lang.String |
m_ifAlias
|
private java.lang.String |
m_ifDescription
|
private int |
m_ifIndex
The SNMP ifIndex |
private java.lang.String |
m_ifName
|
private int |
m_ifOperStatus
|
private int |
m_ifSpeed
|
private int |
m_ifType
|
private java.net.InetAddress |
m_ipAddr
The IP address. |
private java.net.InetAddress |
m_netmask
|
private int |
m_nodeId
The node identifier |
private java.lang.String |
m_physAddr
|
private static java.lang.String |
SQL_LOAD_REC
The SQL statement used to read a node from the database. |
Constructor Summary | |
private |
DbSnmpInterfaceEntry()
Default constructor. |
private |
DbSnmpInterfaceEntry(int nid,
int ifIndex)
Constructs a new interface. |
private |
DbSnmpInterfaceEntry(int nid,
int ifIndex,
boolean exists)
Constructs a new interface. |
Method Summary | |
(package private) static DbSnmpInterfaceEntry |
create(int nid,
int ifIndex)
Creates a new entry. |
(package private) static DbSnmpInterfaceEntry |
get(java.sql.Connection db,
int nid,
int ifIndex)
Retreives a current record from the database based upon the key fields of nodeID and ifIndex. |
(package private) static DbSnmpInterfaceEntry |
get(int nid,
int ifIndex)
Retreives a current record from the database based upon the key fields of nodeID and ifindex. |
(package private) int |
getAdminStatus()
|
(package private) java.lang.String |
getAlias()
|
(package private) java.lang.String |
getDescription()
|
(package private) java.net.InetAddress |
getIfAddress()
Returns the IP address for the entry. |
(package private) int |
getIfIndex()
Returns the current ifIndex |
(package private) java.lang.String |
getName()
|
(package private) java.net.InetAddress |
getNetmask()
|
(package private) int |
getNodeId()
Returns the node entry's unique identifier. |
(package private) int |
getOperationalStatus()
|
(package private) java.lang.String |
getPhysicalAddress()
|
(package private) int |
getSpeed()
|
(package private) int |
getType()
|
(package private) boolean |
hasAdminStatusChanged()
|
(package private) boolean |
hasAliasChanged()
|
(package private) boolean |
hasDescriptionChanged()
|
(package private) boolean |
hasIfAddressChanged()
|
(package private) boolean |
hasIfIndex()
Returns true if the ifIndex is defined. |
(package private) boolean |
hasNameChanged()
|
(package private) boolean |
hasNetmaskChanged()
|
(package private) boolean |
hasOperationalStatusChanged()
|
(package private) boolean |
hasPhysicalAddressChanged()
|
(package private) boolean |
hasSpeedChanged()
|
(package private) boolean |
hasTypeChanged()
|
private void |
insert(java.sql.Connection c)
Inserts the new interface into the ipInterface table of the OpenNMS databasee. |
private boolean |
load(java.sql.Connection c)
Load the current interface from the database. |
static void |
main(java.lang.String[] args)
For debugging only |
(package private) void |
setAdminStatus(int status)
|
(package private) void |
setAlias(java.lang.String alias)
|
(package private) void |
setDescription(java.lang.String descr)
|
(package private) void |
setIfAddress(java.net.InetAddress addr)
|
(package private) void |
setName(java.lang.String name)
|
(package private) void |
setNetmask(java.net.InetAddress mask)
|
(package private) void |
setOperationalStatus(int status)
|
(package private) void |
setPhysicalAddress(java.lang.String addr)
|
(package private) void |
setSpeed(int speed)
|
(package private) void |
setType(int type)
|
(package private) void |
store()
Updates the interface information in the configured database. |
(package private) void |
store(java.sql.Connection db)
Updates the interface 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 ipInterface table. |
(package private) boolean |
updateAdminStatus(int newIfAdminStatus)
|
(package private) boolean |
updateAlias(java.lang.String newIfAlias)
|
(package private) boolean |
updateDescription(java.lang.String newIfDescription)
|
(package private) boolean |
updateIfAddress(java.net.InetAddress addr)
|
(package private) boolean |
updateName(java.lang.String newIfName)
|
(package private) boolean |
updateNetmask(java.net.InetAddress newNetmask)
|
(package private) boolean |
updateOperationalStatus(int newIfOperStatus)
|
(package private) boolean |
updatePhysicalAddress(java.lang.String newPhysAddr)
|
(package private) boolean |
updateSpeed(int newIfSpeed)
|
(package private) boolean |
updateType(int newIfType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.lang.String SQL_LOAD_REC
private boolean m_fromDb
private int m_nodeId
private java.net.InetAddress m_ipAddr
private int m_ifIndex
private java.net.InetAddress m_netmask
private java.lang.String m_physAddr
private java.lang.String m_ifDescription
private int m_ifType
private java.lang.String m_ifName
private java.lang.String m_ifAlias
private int m_ifSpeed
private int m_ifAdminStatus
private int m_ifOperStatus
private int m_changed
private static final int CHANGED_IFADDRESS
private static final int CHANGED_NETMASK
private static final int CHANGED_PHYSADDR
private static final int CHANGED_DESCRIPTION
private static final int CHANGED_IFTYPE
private static final int CHANGED_IFNAME
private static final int CHANGED_IFSPEED
private static final int CHANGED_IFADMINSTATUS
private static final int CHANGED_IFOPERSTATUS
private static final int CHANGED_IFALIAS
Constructor Detail |
private DbSnmpInterfaceEntry()
private DbSnmpInterfaceEntry(int nid, int ifIndex)
nid
- The node identifier.ifIndex
- The interface index to loadprivate DbSnmpInterfaceEntry(int nid, int ifIndex, boolean exists)
nid
- The node identifier.ifIndex
- The interface index to loadexists
- True if the interface already exists.Method Detail |
private void insert(java.sql.Connection c) throws java.sql.SQLException
c
- The connection to the database.
java.sql.SQLException
- Thrown if an error occurs with the connectionprivate void update(java.sql.Connection c) throws java.sql.SQLException
c
- The connection used for the update.
java.sql.SQLException
- Thrown if an error occurs with the connectionprivate boolean load(java.sql.Connection c) throws java.sql.SQLException
c
- The connection used to load the data.
java.sql.SQLException
- Thrown if an error occurs with the connectionint getNodeId()
java.net.InetAddress getIfAddress()
void setIfAddress(java.net.InetAddress addr)
boolean hasIfAddressChanged()
boolean updateIfAddress(java.net.InetAddress addr)
boolean hasIfIndex()
int getIfIndex()
java.net.InetAddress getNetmask()
void setNetmask(java.net.InetAddress mask)
boolean hasNetmaskChanged()
boolean updateNetmask(java.net.InetAddress newNetmask)
java.lang.String getPhysicalAddress()
void setPhysicalAddress(java.lang.String addr)
boolean hasPhysicalAddressChanged()
boolean updatePhysicalAddress(java.lang.String newPhysAddr)
java.lang.String getDescription()
void setDescription(java.lang.String descr)
boolean hasDescriptionChanged()
boolean updateDescription(java.lang.String newIfDescription)
java.lang.String getName()
void setName(java.lang.String name)
boolean hasNameChanged()
boolean updateName(java.lang.String newIfName)
int getType()
void setType(int type)
boolean hasTypeChanged()
boolean updateType(int newIfType)
int getSpeed()
void setSpeed(int speed)
boolean hasSpeedChanged()
boolean updateSpeed(int newIfSpeed)
int getAdminStatus()
void setAdminStatus(int status)
boolean hasAdminStatusChanged()
boolean updateAdminStatus(int newIfAdminStatus)
int getOperationalStatus()
void setOperationalStatus(int status)
boolean hasOperationalStatusChanged()
boolean updateOperationalStatus(int newIfOperStatus)
java.lang.String getAlias()
void setAlias(java.lang.String alias)
boolean hasAliasChanged()
boolean updateAlias(java.lang.String newIfAlias)
void store() throws java.sql.SQLException
java.sql.SQLException
void store(java.sql.Connection db) throws java.sql.SQLException
db
- The database connection used to write the record.
java.sql.SQLException
static DbSnmpInterfaceEntry create(int nid, int ifIndex)
store
.
nid
- The node id of the interface.ifIndex
- The ifIndex of the interface
static DbSnmpInterfaceEntry get(int nid, int ifIndex) throws java.sql.SQLException
nid
- The node id keyifIndex
- the interface index.
java.sql.SQLException
static DbSnmpInterfaceEntry get(java.sql.Connection db, int nid, int ifIndex) throws java.sql.SQLException
db
- The databse connection used to load the entry.nid
- The node id keyifIndex
- The interface index.
java.sql.SQLException
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |