|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.management.snmp.agent.SnmpGenericObjectServer
public class SnmpGenericObjectServer
This class is a utility class that transforms SNMP GET / SET requests into standard JMX getAttributes() setAttributes() requests.
The transformation relies on the metadata information provided by the
SnmpGenericMetaServer
object which is
passed as the first parameter to every method. This SnmpGenericMetaServer
object is usually a Metadata object generated by mibgen
.
This class is used internally by mibgen generated metadata objects and you should never need to use it directly.
Field Summary | |
---|---|
protected MBeanServer |
server
The MBean server through which the MBeans will be accessed. |
Constructor Summary | |
---|---|
SnmpGenericObjectServer(MBeanServer server)
Builds a new SnmpGenericObjectServer. |
Method Summary | |
---|---|
void |
check(SnmpGenericMetaServer meta,
ObjectName name,
SnmpMibSubRequest req,
int depth)
Checks whether an SNMP SET request can be successfully performed. |
void |
check(SnmpGenericMetaServer meta,
ObjectName name,
SnmpValue x,
long id,
Object data)
Checks whether a SET operation can be performed on a given SNMP variable. |
SnmpValue |
get(SnmpGenericMetaServer meta,
ObjectName name,
long id,
Object data)
Get the value of an SNMP variable. |
void |
get(SnmpGenericMetaServer meta,
ObjectName name,
SnmpMibSubRequest req,
int depth)
Execute an SNMP GET request. |
void |
registerTableEntry(SnmpMibTable meta,
SnmpOid rowOid,
ObjectName objname,
Object entry)
|
void |
set(SnmpGenericMetaServer meta,
ObjectName name,
SnmpMibSubRequest req,
int depth)
Execute an SNMP SET request. |
SnmpValue |
set(SnmpGenericMetaServer meta,
ObjectName name,
SnmpValue x,
long id,
Object data)
Set the value of an SNMP variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final MBeanServer server
Constructor Detail |
---|
public SnmpGenericObjectServer(MBeanServer server)
server
- The MBeanServer in which the MBean accessed by this
MIB are registered.Method Detail |
---|
public void get(SnmpGenericMetaServer meta, ObjectName name, SnmpMibSubRequest req, int depth) throws SnmpStatusException
This method first builds the list of attributes that need to be retrieved from the MBean and then calls getAttributes() on the MBean server. Then it updates the SnmpMibSubRequest with the values retrieved from the MBean.
The SNMP metadata information is obtained through the given
meta
object, which usually is an instance of a
mibgen
generated class.
This method is called internally by mibgen
generated
objects and you should never need to call it directly.
meta
- The metadata object impacted by the subrequestname
- The ObjectName of the MBean impacted by this subrequestreq
- The SNMP subrequest to execute on the MBeandepth
- The depth of the SNMP object in the OID tree.
SnmpStatusException
- whenever an SNMP exception must be
raised. Raising an exception will abort the request.
req.registerGetException(VariableId,SnmpStatusException)
public SnmpValue get(SnmpGenericMetaServer meta, ObjectName name, long id, Object data) throws SnmpStatusException
You should never need to use this method directly.
meta
- The impacted metadata objectname
- The ObjectName of the impacted MBeanid
- The OID arc identifying the variable we're trying to set.data
- User contextual data allocated through the
SnmpUserDataFactory
SnmpStatusException
- whenever an SNMP exception must be
raised. Raising an exception will abort the request.
req.registerGetException(VariableId,SnmpStatusException)
public void set(SnmpGenericMetaServer meta, ObjectName name, SnmpMibSubRequest req, int depth) throws SnmpStatusException
This method first builds the list of attributes that need to be set on the MBean and then calls setAttributes() on the MBean server. Then it updates the SnmpMibSubRequest with the new values retrieved from the MBean.
The SNMP metadata information is obtained through the given
meta
object, which usually is an instance of a
mibgen
generated class.
This method is called internally by mibgen
generated
objects and you should never need to call it directly.
meta
- The metadata object impacted by the subrequestname
- The ObjectName of the MBean impacted by this subrequestreq
- The SNMP subrequest to execute on the MBeandepth
- The depth of the SNMP object in the OID tree.
SnmpStatusException
- whenever an SNMP exception must be
raised. Raising an exception will abort the request.
req.registerGetException(VariableId,SnmpStatusException)
public SnmpValue set(SnmpGenericMetaServer meta, ObjectName name, SnmpValue x, long id, Object data) throws SnmpStatusException
You should never need to use this method directly.
meta
- The impacted metadata objectname
- The ObjectName of the impacted MBeanx
- The new requested SnmpValueid
- The OID arc identifying the variable we're trying to set.data
- User contextual data allocated through the
SnmpUserDataFactory
SnmpStatusException
- whenever an SNMP exception must be
raised. Raising an exception will abort the request.
req.registerSetException(VariableId,SnmpStatusException)
public void check(SnmpGenericMetaServer meta, ObjectName name, SnmpMibSubRequest req, int depth) throws SnmpStatusException
For each variable in the subrequest, this method calls checkSetAccess() on the meta object, and then tries to invoke the checkAttributeName() method on the MBean. If this method is not defined then it is assumed that the SET won't fail.
This method is called internally by mibgen
generated
objects and you should never need to call it directly.
meta
- The metadata object impacted by the subrequestname
- The ObjectName of the MBean impacted by this subrequestreq
- The SNMP subrequest to execute on the MBeandepth
- The depth of the SNMP object in the OID tree.
SnmpStatusException
- if the requested SET operation must
be rejected. Raising an exception will abort the request.
req.registerCheckException(VariableId,SnmpStatusException)
public void check(SnmpGenericMetaServer meta, ObjectName name, SnmpValue x, long id, Object data) throws SnmpStatusException
meta
- The impacted metadata objectname
- The ObjectName of the impacted MBeanx
- The new requested SnmpValueid
- The OID arc identifying the variable we're trying to set.data
- User contextual data allocated through the
SnmpUserDataFactory
This method calls checkSetAccess() on the meta object, and then tries to invoke the checkAttributeName() method on the MBean. If this method is not defined then it is assumed that the SET won't fail.
This method is called internally by mibgen
generated
objects and you should never need to call it directly.
SnmpStatusException
- if the requested SET operation must
be rejected. Raising an exception will abort the request.
req.registerCheckException(VariableId,SnmpStatusException)
public void registerTableEntry(SnmpMibTable meta, SnmpOid rowOid, ObjectName objname, Object entry) throws SnmpStatusException
SnmpStatusException
|
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 |