|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.agent.SnmpMibNode com.sun.management.snmp.agent.SnmpMibTable com.sun.management.snmp.usm.usmmib.UsmUserTableMeta
public class UsmUserTableMeta
The class is used for implementing the "UsmUserTable" group. The group is defined with the following oid: 1.3.6.1.6.3.15.1.2.2.
Field Summary | |
---|---|
protected SnmpStandardObjectServer |
objectserver
Reference to the object server. |
Fields inherited from class com.sun.management.snmp.agent.SnmpMibTable |
---|
creationEnabled, factory, nodeId, theMib |
Fields inherited from class com.sun.management.snmp.agent.SnmpMibNode |
---|
noSuchInstanceException, noSuchNameException, noSuchObjectException, varList |
Constructor Summary | |
---|---|
UsmUserTableMeta(SnmpMib myMib,
SnmpStandardObjectServer objserv)
Constructor for the table. |
Method Summary | |
---|---|
void |
addEntry(SnmpOid rowOid,
ObjectName objname,
Object entry)
Add a new entry in this SnmpMibTable . |
void |
check(SnmpMibSubRequest req,
SnmpOid rowOid,
int depth)
This method is used internally and is implemented by the SnmpMibTable subclasses generated by mibgen . |
void |
createNewEntry(SnmpMibSubRequest req,
SnmpOid rowOid,
int depth)
This method is invoked when the creation of a new entry is requested by a remote SNMP manager. |
protected UsmUserEntryMeta |
createUsmUserEntryMetaNode(String snmpEntryName,
String tableName,
SnmpMib mib,
MBeanServer server)
Factory method for "UsmUserEntry" entry metadata class. |
void |
get(SnmpMibSubRequest req,
SnmpOid rowOid,
int depth)
This method is used internally and is implemented by the SnmpMibTable subclasses generated by mibgen . |
long |
getNextVarEntryId(SnmpOid rowOid,
long var,
Object data)
Returns the arc of the next columnar object following "var". |
int |
getRowStatus(SnmpOid rowOid,
Object userData)
|
boolean |
hasRowStatus()
Return true if the conceptual row contains a columnar
object used to control creation/deletion of rows in this table. |
boolean |
isReadableEntryId(SnmpOid rowOid,
long var,
Object data)
Returns true if "var" identifies a readable scalar object. |
boolean |
isRegistrationRequired()
Tell whether the specific version of this metadata generated by mibgen requires entries to be registered with
the MBeanServer. |
boolean |
isRowReady(SnmpOid rowOid,
Object userData)
Tell whether the specified row is ready and can be put in the notInService state. |
boolean |
isRowStatus(SnmpOid rowOid,
long var,
Object userData)
Return true if the columnar object identified by var
is used to control the addition/deletion of rows in this table. |
int |
mapRowStatus(SnmpOid rowOid,
SnmpVarBind vbstatus,
Object userData)
Map the value of the vbstatus varbind to the
corresponding RowStatus code defined in
EnumRowStatus . |
void |
registerEntryNode(SnmpMib mib,
MBeanServer server)
|
void |
set(SnmpMibSubRequest req,
SnmpOid rowOid,
int depth)
This method is used internally and is implemented by the SnmpMibTable subclasses generated by mibgen . |
SnmpValue |
setRowStatus(SnmpOid rowOid,
int status,
Object userData)
Set the control variable to the specified newStatus
value. |
void |
validateVarEntryId(SnmpOid rowOid,
long var,
Object data)
check that the given "var" identifies a columnar object. |
Methods inherited from class com.sun.management.snmp.agent.SnmpMibTable |
---|
addEntry, addNotificationListener, beginRowAction, check, checkRemoveTableRow, checkRowStatusChange, contains, endRowAction, get, getBasicEntries, getEntry, getEntryName, getNextOid, getNextOid, getNextVarEntryId, getNotificationInfo, getRowAction, getSize, isCreationEnabled, registerEntryFactory, removeEntry, removeEntry, removeEntry, removeNotificationListener, removeTableRow, set, setCreationEnabled, skipEntryVariable |
Methods inherited from class com.sun.management.snmp.agent.SnmpMibNode |
---|
getNextIdentifier, getNextVarId, getNextVarId, getRootOid, skipVariable, sort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SnmpStandardObjectServer objectserver
Constructor Detail |
---|
public UsmUserTableMeta(SnmpMib myMib, SnmpStandardObjectServer objserv)
Method Detail |
---|
protected UsmUserEntryMeta createUsmUserEntryMetaNode(String snmpEntryName, String tableName, SnmpMib mib, MBeanServer server)
snmpEntryName
- Name of the SNMP Entry object (conceptual row) ("UsmUserEntry")tableName
- Name of the table in which the entries are registered ("UsmUserTable")mib
- The SnmpMib object in which this table is registeredserver
- MBeanServer for this table entries (may be null)
public void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth) throws SnmpStatusException
SnmpMibTable
setCreationEnabled(true)
and
setCreationEnabled(false)
on this object.
This method is called internally by the SNMP runtime and you should never need to call it directly. However you might want to extend it in order to implement your own specific application behavior, should the default behavior not be at your convenience.
createNewEntry
in class SnmpMibTable
req
- The SNMP subrequest requesting this creationrowOid
- The OID indexing the conceptual row (entry) for which
the creation was requested.depth
- The position of the columnar object arc in the OIDs
from the varbind list.
SnmpStatusException
- if the entry cannot be created.public boolean isRegistrationRequired()
SnmpMibTable
mibgen
requires entries to be registered with
the MBeanServer. In this case an ObjectName will have to be
passed to addEntry() in order for the table to behave correctly
(case of the generic metadata).
If that version of the metadata does not require entry to be registered, then passing an ObjectName becomes optional (null can be passed instead).
isRegistrationRequired
in class SnmpMibTable
true
if registration is required by this
version of the metadata.public void registerEntryNode(SnmpMib mib, MBeanServer server)
public void addEntry(SnmpOid rowOid, ObjectName objname, Object entry) throws SnmpStatusException
SnmpMibTable
SnmpMibTable
.
Also triggers the addEntryCB() callback of the
SnmpTableEntryFactory
interface
if this node is bound to a factory.
addEntry
in class SnmpMibTable
rowOid
- The SnmpOid
identifying the table
row to be added.objname
- The ObjectName with which this entry is registered.
This parameter can be omitted if isRegistrationRequired()
return false.entry
- The entry to add.
SnmpStatusException
- The entry couldn't be added
at the position identified by the given
rowOid
, or if this version of the metadata
requires ObjectName's, and the given name is null.public boolean isRowStatus(SnmpOid rowOid, long var, Object userData)
SnmpMibTable
var
is used to control the addition/deletion of rows in this table.
By default, this method assumes that there is no control variable
and always return false
If this table was defined using SMIv2, and if it contains a
control variable with RowStatus syntax, mibgen
will generate a non default implementation for this method
that will identify the RowStatus control variable.
You will have to redefine this method if you need to implement control variables that do not conform to RFC 2579 RowStatus TEXTUAL-CONVENTION.
isRowStatus
in class SnmpMibTable
rowOid
- The SnmpOid
identifying the table
row involved in the operation.var
- The OID arc identifying the involved columnar object.userData
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.public boolean hasRowStatus()
SnmpMibTable
true
if the conceptual row contains a columnar
object used to control creation/deletion of rows in this table.
This columnar object can be either a variable with RowStatus syntax as defined by RFC 2579, or a plain variable whose semantics is table specific.
By default, this function returns false
, and it is
assumed that the table has no such control variable.
When mibgen
is used over SMIv2 MIBs, it will generate
an hasRowStatus()
method returning true
for each table containing an object with RowStatus syntax.
When this method returns false
the default mechanism
for remote entry creation is used.
Otherwise, creation/deletion is performed as specified
by the control variable (see getRowAction() for more details).
This method is called internally when a SET request involving this table is processed.
If you need to implement a control variable which do not use
the RowStatus convention as defined by RFC 2579, you should
subclass the generated table metadata class in order to redefine
this method and make it returns true
.
You will then have to redefine the isRowStatus(), mapRowStatus(),
isRowReady(), and setRowStatus() methods to suit your specific
implementation.
hasRowStatus
in class SnmpMibTable
true
if this table contains a control
variable (e.g. a variable with RFC 2579 RowStatus syntax),
false
if this table does not contain
any control variable.public SnmpValue setRowStatus(SnmpOid rowOid, int status, Object userData) throws SnmpStatusException
SnmpMibTable
newStatus
value.
This method maps the given newStatus
to the appropriate
value for the control variable, then sets the control variable in
the entry identified by rowOid
. It returns the new
value of the control variable.
By default, it is assumed that there is no control variable so this
method does nothing and simply returns null
.
If this table was defined using SMIv2, and if it contains a
control variable with RowStatus syntax, mibgen
will generate a non default implementation for this method.
You will have to redefine this method if you need to implement control variables that do not conform to RFC 2579 RowStatus TEXTUAL-CONVENTION.
setRowStatus
in class SnmpMibTable
rowOid
- The SnmpOid
identifying the table
row involved in the operation.status
- The new status for the row: one of the
RowStatus code defined in
EnumRowStatus
. These codes
correspond to RowStatus codes as defined in RFC 2579,
plus the unspecified value which is Java DMK specific.userData
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
new SnmpInt(newStatus)
) or null
if the table do not have any control variable.
SnmpStatusException
- If the given newStatus
could not be set on the specified entry, or if the
given newStatus
is not valid.EnumRowStatus
public boolean isRowReady(SnmpOid rowOid, Object userData) throws SnmpStatusException
SnmpMibTable
This method is called only once, after all the varbind have been set on a new entry for which createAndWait was specified.
If the entry is not yet ready, this method should return false.
It will then be the responsibility of the entry to switch its
own state to notInService when it becomes ready.
No further call to isRowReady()
will be made.
By default, this method always return true.
mibgen
will not generate any specific implementation
for this method - meaning that by default, a row created using
createAndWait will always be placed in notInService
state at the end of the request.
If this table was defined using SMIv2, and if it contains a
control variable with RowStatus syntax, mibgen
will generate an implementation for this method that will
delegate the work to the metadata class modeling the conceptual
row, so that you can override the default behavior by subclassing
that metadata class.
You will have to redefine this method if this default mechanism does not suit your needs.
isRowReady
in class SnmpMibTable
rowOid
- The SnmpOid
identifying the table
row involved in the operation.userData
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
true
if the row can be placed in
notInService state.
SnmpStatusException
- An error occurred while trying
to retrieve the row status, and the operation should
be aborted.EnumRowStatus
public int mapRowStatus(SnmpOid rowOid, SnmpVarBind vbstatus, Object userData) throws SnmpStatusException
SnmpMibTable
vbstatus
varbind to the
corresponding RowStatus code defined in
EnumRowStatus
.
These codes correspond to RowStatus codes as defined in RFC 2579,
plus the unspecified value which is Java DMK specific.
By default, this method assumes that the control variable is an Integer, and it simply returns its value without further analysis.
If this table was defined using SMIv2, and if it contains a
control variable with RowStatus syntax, mibgen
will generate a non default implementation for this method.
You will have to redefine this method if you need to implement control variables that do not conform to RFC 2579 RowStatus TEXTUAL-CONVENTION.
mapRowStatus
in class SnmpMibTable
rowOid
- The SnmpOid
identifying the table
row involved in the operation.vbstatus
- The SnmpVarBind containing the value of the control
variable, as identified by the isRowStatus() method.userData
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
vbstatus
.
SnmpStatusException
- if the value of the control variable
could not be mapped to a RowStatus code.EnumRowStatus
public int getRowStatus(SnmpOid rowOid, Object userData) throws SnmpStatusException
SnmpStatusException
public void get(SnmpMibSubRequest req, SnmpOid rowOid, int depth) throws SnmpStatusException
SnmpMibTable
SnmpMibTable
subclasses generated by mibgen
.
get
in class SnmpMibTable
SnmpStatusException
public void set(SnmpMibSubRequest req, SnmpOid rowOid, int depth) throws SnmpStatusException
SnmpMibTable
SnmpMibTable
subclasses generated by mibgen
.
set
in class SnmpMibTable
SnmpStatusException
public void check(SnmpMibSubRequest req, SnmpOid rowOid, int depth) throws SnmpStatusException
SnmpMibTable
SnmpMibTable
subclasses generated by mibgen
.
check
in class SnmpMibTable
SnmpStatusException
public void validateVarEntryId(SnmpOid rowOid, long var, Object data) throws SnmpStatusException
validateVarEntryId
in class SnmpMibTable
rowOid
- The OID index of the row involved in the operation.var
- The var we want to validate.data
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
SnmpStatusException
- If this id is not valid.public boolean isReadableEntryId(SnmpOid rowOid, long var, Object data) throws SnmpStatusException
isReadableEntryId
in class SnmpMibTable
rowOid
- The OID index of the row involved in the operation.var
- The OID arc.data
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
SnmpStatusException
- If this id is not valid.public long getNextVarEntryId(SnmpOid rowOid, long var, Object data) throws SnmpStatusException
getNextVarEntryId
in class SnmpMibTable
rowOid
- The OID index of the row involved in the operation.var
- Id of the variable we start from, looking for the next.data
- A contextual object containing user-data.
This object is allocated through the
SnmpUserDataFactory
for each incoming SNMP request.
SnmpStatusException
- If no id is found after the given id.
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |