|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.agent.SnmpMibAgent com.sun.management.snmp.agent.SnmpErrorHandlerAgent
public class SnmpErrorHandlerAgent
A simple MIB agent that implements SNMP calls (get, set, getnext and getbulk) in a way that only errors or exceptions are returned. Every call done on this agent fails. Error handling is done according to the manager's SNMP protocol version.
It is used by SnmpAdaptorServer
for its default agent
behavior. When a received Oid doesn't match, this agent is called to
fill the result list with errors.
Field Summary |
---|
Fields inherited from class com.sun.management.snmp.agent.SnmpMibAgent |
---|
mibName, server |
Constructor Summary | |
---|---|
SnmpErrorHandlerAgent()
|
Method Summary | |
---|---|
void |
check(SnmpMibRequest inRequest)
Checks if a set operation can be performed. |
void |
get(SnmpMibRequest inRequest)
Processes a get operation. |
void |
getBulk(SnmpMibRequest inRequest,
int nonRepeat,
int maxRepeat)
Processes a getBulk operation. |
void |
getNext(SnmpMibRequest inRequest)
Processes a getNext operation. |
long[] |
getRootOid()
Gets the root object identifier of the MIB. |
void |
init()
Initializes the MIB (with no registration of the MBeans into the MBean server). |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Initializes the MIB but each single MBean representing the MIB is inserted into the MBean server. |
void |
set(SnmpMibRequest inRequest)
Processes a set operation. |
Methods inherited from class com.sun.management.snmp.agent.SnmpMibAgent |
---|
getBindingState, getMBeanServer, getMibName, getSnmpAdaptor, getSnmpAdaptorName, newMibRequest, newMibRequest, postDeregister, postRegister, preDeregister, setSnmpAdaptor, setSnmpAdaptor, setSnmpAdaptor, setSnmpAdaptor, setSnmpAdaptorName, setSnmpAdaptorName, setSnmpAdaptorName, setSnmpAdaptorName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SnmpErrorHandlerAgent()
Method Detail |
---|
public void init() throws IllegalAccessException
init
in class SnmpMibAgent
IllegalAccessException
- The MIB cannot be initialized.public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
preRegister
in class SnmpMibAgent
server
- The MBean server to register the service with.name
- The object name.
Exception
public long[] getRootOid()
The root object identifier is the object identifier uniquely identifying the MIB.
getRootOid
in class SnmpMibAgent
public void get(SnmpMibRequest inRequest) throws SnmpStatusException
get
operation. It will throw an exception
for V1 requests or it will set exceptions within the list for
V2 requests.
get
in interface SnmpMibAgentMBean
get
in class SnmpMibAgent
inRequest
- The SnmpMibRequest object holding the list of
variable to be retrieved.
SnmpStatusException
- An error occurred during the operation.SnmpMibAgent.get(SnmpMibRequest)
public void check(SnmpMibRequest inRequest) throws SnmpStatusException
set
operation can be performed.
If the operation can not be performed, the method should emit a
SnmpStatusException
.
check
in interface SnmpMibAgentMBean
check
in class SnmpMibAgent
inRequest
- The SnmpMibRequest object holding the list of
variables to be set. This list is composed of
SnmpVarBind
objects.
SnmpStatusException
- The set
operation
cannot be performed.SnmpMibAgent.check(SnmpMibRequest)
public void set(SnmpMibRequest inRequest) throws SnmpStatusException
set
operation. Should never be called
(check previously called having failed).
set
in interface SnmpMibAgentMBean
set
in class SnmpMibAgent
inRequest
- The SnmpMibRequest object holding the list of
variable to be set.
SnmpStatusException
- An error occurred during the operation.SnmpMibAgent.set(SnmpMibRequest)
public void getNext(SnmpMibRequest inRequest) throws SnmpStatusException
getNext
operation. It will throw an
exception for V1 requests or it will set exceptions within the
list for V2 requests..
getNext
in interface SnmpMibAgentMBean
getNext
in class SnmpMibAgent
inRequest
- The SnmpMibRequest object holding the list of
variables to be retrieved.
SnmpStatusException
- An error occurred during the operation.SnmpMibAgent.getNext(SnmpMibRequest)
public void getBulk(SnmpMibRequest inRequest, int nonRepeat, int maxRepeat) throws SnmpStatusException
getBulk
operation. It will throw an
exception if the request is a V1 one or it will set exceptions
within the list for V2 ones.
getBulk
in interface SnmpMibAgentMBean
getBulk
in class SnmpMibAgent
inRequest
- The SnmpMibRequest object holding the list of
variable to be retrieved.nonRepeat
- The number of variables, starting with the first
variable in the variable-bindings, for which a single
lexicographic successor is requested.maxRepeat
- The number of lexicographic successors requested
for each of the last R variables. R is the number of variables
following the first nonRepeat
variables for which
multiple lexicographic successors are requested.
SnmpStatusException
- An error occurred during the operation.SnmpMibAgent.getBulk(SnmpMibRequest,int,int)
|
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 |