java.lang.Object | |
↳ | com.sun.jmx.snmp.agent.SnmpTableSupport |
This class is an abstraction for an SNMP table. It is the base class for implementing SNMP tables in the MBean world.
Its responsibility is to synchronize the MBean view of the table (Table of entries) with the MIB view (array of OID indexes). Each object of this class will be bound to the Metadata object which manages the same SNMP Table within the MIB.
For each table defined in a MIB, mibgen will generate a specific class called TableTableName that will subclass this class, and a corresponding TableNameMeta class extending SnmpMibTable and corresponding to the MIB view of the same table.
Objects of this class are instantiated by MBeans representing the SNMP Group to which the table belong.
This API is a Sun Microsystems internal API and is subject to change without notice.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
entries | The list of entries | ||||||||||
meta | The associated metadata object | ||||||||||
theMib | The MIB to which this table belongs |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initializes the table.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This callback is called by the associated metadata object
when a new table entry has been registered in the
table metadata.
| |||||||||||
Enables to add an SNMP entry listener to this
SnmpMibTable . | |||||||||||
Builds the default ObjectName of an entry from the SnmpIndex
identifying this entry.
| |||||||||||
Builds an SnmpOid from an SnmpIndex object.
| |||||||||||
Builds an entry SnmpIndex from its row OID.
| |||||||||||
Creates a new entry in the table.
| |||||||||||
Returns the entry located at the given position in the table.
| |||||||||||
Returns a
NotificationInfo object containing the
notification class and the notification type sent by the
SnmpMibTable . | |||||||||||
Returns the number of entries registered in the table.
| |||||||||||
Tells whether a new entry should be created when a SET operation
is received for an entry that does not exist yet.
| |||||||||||
Tells whether the metadata object to which this table is linked
requires entries to be registered.
| |||||||||||
This callback is called by the associated metadata object
when a new table entry has been removed from the
table metadata.
| |||||||||||
Enables to remove an SNMP entry listener from this
SnmpMibTable . | |||||||||||
This method lets you dynamically switch the creation policy.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add an entry in this table.
| |||||||||||
Add an entry in this table.
| |||||||||||
Allocates an ArrayList for storing table entries.
| |||||||||||
Binds this table with its associated metadata, registering itself
as an SnmpTableEntryFactory.
| |||||||||||
Builds an SnmpIndex object from the index part of an OID.
| |||||||||||
Returns the entries in the table.
| |||||||||||
Returns the metadata object associated with this table.
| |||||||||||
Remove an entry from this table.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Initializes the table. The steps are these:
mib | The MIB to which this table belong. |
---|
This callback is called by the associated metadata object
when a new table entry has been registered in the
table metadata.
This method will update the entries
list.
pos | The position at which the new entry was inserted in the table. |
---|---|
row | The row OID of the new entry |
name | The ObjectName of the new entry (as specified by the factory) |
entry | The new entry (as returned by the factory) |
meta | The table metadata object. |
SnmpStatusException |
---|
Enables to add an SNMP entry listener to this
SnmpMibTable
.
listener | The listener object which will handle the notifications emitted by the registered MBean. |
---|---|
filter | The filter object. If filter is null, no filtering will be performed before handling notifications. |
handback | The context to be sent to the listener when a notification is emitted. |
IllegalArgumentException | Listener parameter is null. |
---|
Builds the default ObjectName of an entry from the SnmpIndex identifying this entry. No access is made on the entry itself. This method is generated by mibgen and used internally. You can subclass this method if you want to change the default ObjectName policy. This is only meaningfull when entries are registered MBeans.
index | The SnmpIndex identifying the entry from which we want to build the default ObjectName. |
---|
SnmpStatusException | if the given index is not valid. |
---|
Builds an SnmpOid from an SnmpIndex object. This method is generated by mibgen and used internally.
index | An SnmpIndex object identifying a table entry. |
---|
SnmpStatusException | if the given index is not valid. |
---|
Builds an entry SnmpIndex from its row OID. This method is generated by mibgen and used internally.
rowOid | The SnmpOid object identifying a table entry. |
---|
rowOid
.SnmpStatusException | if the index cannot be built from the given OID. |
---|
Creates a new entry in the table.
This factory method is generated by mibgen and used internally.
It is part of the
SnmpTableEntryFactory
interface.
You may subclass this method to implement any specific behaviour
your application requires.
request | The SNMP subrequest containing the sublist of varbinds for the new entry. |
---|---|
rowOid | The OID indexing the conceptual row (entry) for which the creation was requested. |
depth | The depth reached in the OID tree (the position at which the columnar object ids start in the OIDs included in the varbind). |
meta | The metadata object impacted by the subrequest |
SnmpStatusException | if the entry cannot be created. |
---|
Returns the entry located at the given position in the table.
null
if no entry can be found at this position.
Returns a NotificationInfo
object containing the
notification class and the notification type sent by the
SnmpMibTable
.
Returns the number of entries registered in the table.
Tells whether a new entry should be created when a SET operation
is received for an entry that does not exist yet.
This method calls isCreationEnabled()
on the metadata
object associated with this table.
false
]Tells whether the metadata object to which this table is linked requires entries to be registered. In this case passing an ObjectName when registering entries will be mandatory.
true
if the associated metadata requires entries
to be registered (mibgen generated generic metadata).
This callback is called by the associated metadata object
when a new table entry has been removed from the
table metadata.
This method will update the entries
list.
pos | The position from which the entry was deleted |
---|---|
row | The row OID of the deleted entry |
name | The ObjectName of the deleted entry (may be null if ObjectName's were not required) |
entry | The deleted entry (may be null if only ObjectName's were required) |
meta | The table metadata object. |
SnmpStatusException |
---|
Enables to remove an SNMP entry listener from this
SnmpMibTable
.
listener | The listener object which will handle the notifications emitted by the registered MBean. This method will remove all the information related to this listener. |
---|
ListenerNotFoundException | The listener is not registered in the MBean. |
---|
This method lets you dynamically switch the creation policy.
setCreationEnabled()
will switch the policy of
remote entry creation via SET operations, by calling
setCreationEnabled()
on the metadata object
associated with this table.
By default remote entry creation via SET operation is disabled.
remoteCreationFlag | Tells whether remote entry creation must
be enabled or disabled.
setCreationEnabled(true) will enable remote entry
creation via SET operations.setCreationEnabled(false) will disable remote entry
creation via SET operations.By default remote entry creation via SET operation is disabled. |
---|
Add an entry in this table. This method registers an entry in the table and performs synchronization with the associated table metadata object.
index | The SnmpIndex built from the given entry. |
---|---|
name | The ObjectName with which this entry will be registered. |
entry | The entry that should be added in the table. |
SnmpStatusException | if the entry cannot be registered with the given index. |
---|
Add an entry in this table. This method registers an entry in the table and perform synchronization with the associated table metadata object. This method assumes that the given entry will not be registered, or will be registered with its default ObjectName built from the associated SnmpIndex.
If the entry is going to be registered, then
addEntry(SnmpIndex, ObjectName, Object)
should be prefered.
This function is mainly provided for backward compatibility.
index | The SnmpIndex built from the given entry. |
---|---|
entry | The entry that should be added in the table. |
SnmpStatusException | if the entry cannot be registered with the given index. |
---|
Allocates an ArrayList for storing table entries.
This method is called within the constructor at object creation.
Any object implementing the List
interface can
be used.
null
is returned then no entry will be stored in the list
and getEntry() will always return null.
Binds this table with its associated metadata, registering itself as an SnmpTableEntryFactory.
Builds an SnmpIndex object from the index part of an OID. This method is generated by mibgen and used internally.
oid | The OID from which to build the index, represented as an array of long. |
---|---|
start | The position where to start from in the OID array. |
SnmpStatusException | if the given index is not valid. |
---|
Returns the entries in the table.
Returns the metadata object associated with this table. This method is generated by mibgen and used internally.
mib | The SnmpMib object holding the Metadata corresponding to this table. |
---|
null
if this implementation of the
MIB doesn't support this table.
Remove an entry from this table. This method unregisters an entry from the table and performs synchronization with the associated table metadata object.
index | The SnmpIndex identifying the entry. |
---|---|
entry | The entry that should be removed in the table. This
parameter is optional and can be omitted if it doesn't
need to be passed along to the
removeEntryCb() callback defined in the
SnmpTableCallbackHandler
interface. |
SnmpStatusException | if the entry cannot be unregistered. |
---|