com.sun.management.snmp.agent
Class SnmpV3Proxy

java.lang.Object
  extended by com.sun.management.snmp.agent.SnmpMibAgent
      extended by com.sun.management.snmp.agent.SnmpProxy
          extended by com.sun.management.snmp.agent.SnmpV3Proxy
All Implemented Interfaces:
SnmpMibAgentMBean, Serializable, MBeanRegistration
Direct Known Subclasses:
SnmpUsmProxy

public abstract class SnmpV3Proxy
extends SnmpProxy

The SnmpV3Proxy class is an abstract class that provides services to proxy an SNMP V3 agent.

It mains role is to handle various SNMP V1 V2 and V3 security contexts. Some rules are applied when call are received in an SNMP version and are forwarded in SNMP V3.

These rules are coded in the method translateParameters. If you want to change them, just overload this method.

Rules when forwarding to SNMP V3 peer details. You can change them by subclassing the proxy:

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sun.management.snmp.agent.SnmpProxy
defaultTimeout
 
Fields inherited from class com.sun.management.snmp.agent.SnmpMibAgent
server
 
Constructor Summary
SnmpV3Proxy(SnmpEngine engine, SnmpPeer peer, String rootOid, String name)
          Initializes this SNMP proxy with a SnmpPeer to which calls are forwarded.
 
Method Summary
protected abstract  SnmpParams createParameters(SnmpPdu pdu)
          Factory parameters method.
abstract  SnmpEngineId getEngineId()
          The distant EngineId.
protected  SnmpParams translateParameters(SnmpMibRequest req)
          Return the parameters to use when sending the call.
 
Methods inherited from class com.sun.management.snmp.agent.SnmpProxy
check, forwardSetRequestOnCheck, get, get, getBulk, getEngine, getMibName, getNext, getNext, getPeer, getRootOid, getTimeout, handleReport, hideInvalidResponseError, init, isInvalidResponseErrorHidden, isSetRequestForwardedOnCheck, preRegister, set, set, setTimeout, skipError, skipError
 
Methods inherited from class com.sun.management.snmp.agent.SnmpMibAgent
getBindingState, getMBeanServer, 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

SnmpV3Proxy

public SnmpV3Proxy(SnmpEngine engine,
                   SnmpPeer peer,
                   String rootOid,
                   String name)
            throws SnmpStatusException
Initializes this SNMP proxy with a SnmpPeer to which calls are forwarded. The passed root oid is used when registering the proxy within the adaptor. The name is used when registering the proxy in the SnmpAdaptorServer

Parameters:
engine - The SNMP adaptor engine.
peer - The peer representing the proxied agent.
rootOid - The proxy root oid.
name - The proxy name.
Throws:
IllegalArgumentException - if the passed engine is null.
SnmpStatusException - An error occurred while accessing a MIB node.
Method Detail

getEngineId

public abstract SnmpEngineId getEngineId()
The distant EngineId. This abstract method must be implemented by subclasses. The distant engine id is retrieved by the concrete subclass.

Returns:
The peer engine Id.

createParameters

protected abstract SnmpParams createParameters(SnmpPdu pdu)
                                        throws SnmpStatusException
Factory parameters method. Overload this method in order to create your own parameters. e.g. Usm based parameters are specific to the security model. A proxy of a Usm enabled SNMP V3 agent will provide SnmpUsmParameters instance.

Parameters:
pdu - Can be null.
Returns:
Snmp parameters to use when forwarding the call.
Throws:
SnmpStatusException

translateParameters

protected SnmpParams translateParameters(SnmpMibRequest req)
                                  throws SnmpStatusException
Return the parameters to use when sending the call. The info contained in the SnmpMibRequest pdu are reused in order to construct new SnmpParams. The returned parameters are passed to the session default peer. Overload this method in order to change the default policy.

Overrides:
translateParameters in class SnmpProxy
Parameters:
req - The received request.
Returns:
The parameters to use when forwarding the call.
Throws:
SnmpStatusException

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.