public class

SnmpErrorHandlerAgent

extends SnmpMibAgent
implements Serializable
java.lang.Object
   ↳ com.sun.jmx.snmp.agent.SnmpMibAgent
     ↳ com.sun.jmx.snmp.agent.SnmpErrorHandlerAgent

Class Overview

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.

This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

[Expand]
Inherited Fields
From class com.sun.jmx.snmp.agent.SnmpMibAgent
Public Constructors
SnmpErrorHandlerAgent()
Public Methods
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.
[Expand]
Inherited Methods
From class com.sun.jmx.snmp.agent.SnmpMibAgent
From class java.lang.Object
From interface com.sun.jmx.snmp.agent.SnmpMibAgentMBean
From interface javax.management.MBeanRegistration

Public Constructors

public SnmpErrorHandlerAgent ()

Public Methods

public void check (SnmpMibRequest inRequest)

Checks if a set operation can be performed. If the operation can not be performed, the method should emit a SnmpStatusException.

Parameters
inRequest The SnmpMibRequest object holding the list of variables to be set. This list is composed of SnmpVarBind objects.
Throws
SnmpStatusException The set operation cannot be performed.

public void get (SnmpMibRequest inRequest)

Processes a get operation. It will throw an exception for V1 requests or it will set exceptions within the list for V2 requests.

Parameters
inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
Throws
SnmpStatusException An error occured during the operation.

public void getBulk (SnmpMibRequest inRequest, int nonRepeat, int maxRepeat)

Processes a 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.

Parameters
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.
Throws
SnmpStatusException An error occured during the operation.

public void getNext (SnmpMibRequest inRequest)

Processes a getNext operation. It will throw an exception for V1 requests or it will set exceptions within the list for V2 requests..

Parameters
inRequest The SnmpMibRequest object holding the list of variables to be retrieved.
Throws
SnmpStatusException An error occured during the operation.

public long[] getRootOid ()

Gets the root object identifier of the MIB.

The root object identifier is the object identifier uniquely identifying the MIB.

Returns
  • The returned oid is null.

public void init ()

Initializes the MIB (with no registration of the MBeans into the MBean server). Does nothing.

Throws
IllegalAccessException The MIB cannot be initialized.

public ObjectName preRegister (MBeanServer server, ObjectName name)

Initializes the MIB but each single MBean representing the MIB is inserted into the MBean server.

Parameters
server The MBean server to register the service with.
name The object name.
Returns
  • The passed name paramter.
Throws
Exception

public void set (SnmpMibRequest inRequest)

Processes a set operation. Should never be called (check previously called having failed).

Parameters
inRequest The SnmpMibRequest object holding the list of variable to be set.
Throws
SnmpStatusException An error occured during the operation.