|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The MBean interface of SnmpTable class
Method Summary | |
ArrayList |
addRow(Collection varbinds)
Adds a new row. |
ArrayList |
addRow(SnmpTableEntry entry)
Adds a new row. |
ArrayList |
addRow(SnmpTableEntry entry,
String suffix)
Adds a new row. |
ArrayList |
deleteRow(SnmpTableEntry entry)
Deletes the specified entry |
ArrayList |
deleteRow(String indexSuffix)
Removes the row with the passed indexSuffix |
int |
getColumnCount()
Returns the number of columns in this table |
String |
getIndexSuffix(int index)
Returns the index suffix of row at specified index |
SnmpTableEntry |
getNextOID(SnmpOID oid)
Returns null if next OID is out of this table's subtree; Its next oid is in this subtree, it returns an SnmpTableEntry object which contains the next OID (SnmpTableEntry.setOID method must be called, otherwise it may cause exceptions), caller will use SnmpTableEntry.getOID() to retrieve that OID value. |
SnmpTableEntry |
getNextOID(SnmpOID oid,
SnmpPdu pdu)
Returns null if next OID is out of this table's subtree; If the next oid is in this subtree, it returns an SnmpTableEntry object which contains the next OID (SnmpTableEntry.setOID method must be called, otherwise it may cause exceptions), caller will use SnmpTableEntry.getOID() to retrieve that OID value. |
SnmpTableEntry |
getOID(SnmpOID oid)
Returns null if passed oid doesn't exist in this subtree; a non-null object if this oid exists in this subtree. |
SnmpTableEntry |
getOID(SnmpOID oid,
SnmpPdu pdu)
Returns null if passed oid doesn't exist in this subtree; a non-null object if this oid exists in this subtree. |
SnmpTableEntry |
getRow(int index)
Returns row at specified index |
SnmpTableEntry |
getRow(String indexSuffix)
Returns row whose index suffix is equal to the passed indexSuffix |
int |
getRowCount()
Returns the number of rows in this table |
Vector |
getRows()
Returns all rows in a Vector object. |
void |
postAddRow(SnmpTableEntry entry)
Gets called after this row is added |
void |
postDeleteRow(SnmpTableEntry entry)
Gets called after this row is deleted |
void |
postSetValue(SnmpTableEntry entry,
SnmpVarBind newValue,
Collection varbinds)
Deprecated, use postSetValue instead |
void |
postSetValue(SnmpTableEntry entry,
SnmpVarBind newValue,
SnmpPdu pdu)
Gets called after setting new value to the passed entry object. |
boolean |
preAddRow(SnmpTableEntry entry)
Gets called before this row is added. |
boolean |
preDeleteRow(SnmpTableEntry entry)
Gets called before this row is deleted. |
boolean |
preSetValue(SnmpTableEntry entry,
SnmpVarBind newValue,
Collection varbinds)
Deprecated, use preSetValue instead |
void |
preSetValue(SnmpTableEntry entry,
SnmpVarBind newValue,
SnmpPdu pdu)
Gets called before setting new value to the passed entry object when agent receives an SNMP SET request. |
Method Detail |
public ArrayList addRow(SnmpTableEntry entry, String suffix)
Note: It's not the preferred method for adding rows in most cases. addRow(SnmpTableEntry entry) method should be used instead.
entry
- the new row to be addedsuffix
- the index suffix
addRow(SnmpTableEntry)
public ArrayList addRow(SnmpTableEntry entry)
entry
- the new row to be added
public ArrayList addRow(Collection varbinds)
varbinds
- an array of SnmpVarBind objects, which contain the name/value of each column.
public ArrayList deleteRow(SnmpTableEntry entry)
public ArrayList deleteRow(String indexSuffix)
indexSuffix
indexSuffix
- the index suffix of the row to be removed
public String getIndexSuffix(int index)
index
- the row index
IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= size()).public int getRowCount()
public int getColumnCount()
public SnmpTableEntry getRow(int index)
index
- the row index
IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= size()).public SnmpTableEntry getRow(String indexSuffix)
indexSuffix
SnmpTableEntry
object. Or null if nothing found.public Vector getRows()
Vector
object. Each element in the vector
is a SnmpTableEntry
object.
public boolean preAddRow(SnmpTableEntry entry)
entry
- an instance of SnmpTableEntry or its sub class
public void postAddRow(SnmpTableEntry entry)
entry
- an instance of SnmpTableEntry or its sub classpublic boolean preDeleteRow(SnmpTableEntry entry)
entry
- an instance of SnmpTableEntry or its sub class
public void postDeleteRow(SnmpTableEntry entry)
entry
- an instance of SnmpTableEntry or its sub classpublic void preSetValue(SnmpTableEntry entry, SnmpVarBind newValue, SnmpPdu pdu)
Because SNMP SET operation is atomic, you may need to override this method in
your table classes which accept SET operations, and check the validity of passed newValue
and the pdu object. If the value is not acceptable, SnmpException
needs to be thrown, so this SET operation fails
and proper error code is returned to SNMP manager.
Note: SNMP version information of the received packet
can be retrieved by calling pdu.getVersion()
entry
- SnmpTableEntry object for the row affected. It is null if this table is self-managed or this
SET request is for creating a new row. For dynamic row creation, the passed entry
is null, overriding
preAddRow(SnmpTableEntry entry)
method to get its valuenewValue
- the new value which is being processedpdu
- PDU object received
SnmpException
- Throw an SnmpException if the passed newValue
is not acceptable, and you
need to set SnmpException object's errorStatus field, which will be used in the response PDU's errorStatus field.public boolean preSetValue(SnmpTableEntry entry, SnmpVarBind newValue, Collection varbinds)
preSetValue
instead
public void postSetValue(SnmpTableEntry entry, SnmpVarBind newValue, SnmpPdu pdu)
entry
- SnmpTableEntry object for the row affected. It is null if this table is self-managed or this
SET request is for creating a new row. For dynamic row creation, the passed entry
is null, overriding
postAddRow(SnmpTableEntry entry)
method to get its valuenewValue
- the new value which is being processedpdu
- PDU object receivedpublic void postSetValue(SnmpTableEntry entry, SnmpVarBind newValue, Collection varbinds)
postSetValue
instead
public SnmpTableEntry getNextOID(SnmpOID oid, SnmpPdu pdu)
If setProcessSnmpRequestDirectly(true)
is invoked for the table,
this method is required, otherwise this method won't be used.
oid
- oid to be processedpdu
- PDU object receivedpublic SnmpTableEntry getNextOID(SnmpOID oid)
If setProcessSnmpRequestDirectly(true)
is invoked for the table,
this method is required, otherwise this method won't be used.
public SnmpTableEntry getOID(SnmpOID oid, SnmpPdu pdu)
If setProcessSnmpRequestDirectly(true)
is invoked for the table,
this method is required, otherwise this method won't be used.
oid
- oid to be processedpdu
- PDU object receivedpublic SnmpTableEntry getOID(SnmpOID oid)
If setProcessSnmpRequestDirectly(true)
is invoked for the table,
this method is required, otherwise this method won't be used.
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |