com.sun.management.snmp.agent
Class SnmpUsmProxy

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
              extended by com.sun.management.snmp.agent.SnmpUsmProxy
All Implemented Interfaces:
SnmpMibAgentMBean, Serializable, MBeanRegistration

public class SnmpUsmProxy
extends SnmpV3Proxy

The SnmpUsmProxy class provides an implementation of an SNMP V3 proxy. It uses the Usm based manager API in order to forward calls to distant peer. This is the object to instantiate in order to proxy an SNMP V3 agent that is Usm based.

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
SnmpUsmProxy(SnmpEngine engine, SnmpUsmPeer peer, String rootOid)
          Initializes this SNMP proxy with a SnmpPeer to which calls are forwarded.
SnmpUsmProxy(SnmpEngine engine, SnmpUsmPeer peer, String rootOid, String name)
          Initializes this SNMP proxy with a SnmpPeer to which calls are forwarded.
 
Method Summary
protected  SnmpParams createParameters(SnmpPdu pdu)
          Factory parameters method.
 SnmpEngineId getEngineId()
          The distant EngineId.
protected  boolean handleReport(SnmpRequest request)
          Called when a report is received when forwarding a request.
 void resyncOnTimelinessReport(boolean retry)
          When receiving a report, the proxy will resynchronize if the report is due to a timeliness desynchronization.
 
Methods inherited from class com.sun.management.snmp.agent.SnmpV3Proxy
translateParameters
 
Methods inherited from class com.sun.management.snmp.agent.SnmpProxy
check, forwardSetRequestOnCheck, get, get, getBulk, getEngine, getMibName, getNext, getNext, getPeer, getRootOid, getTimeout, 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

SnmpUsmProxy

public SnmpUsmProxy(SnmpEngine engine,
                    SnmpUsmPeer peer,
                    String rootOid)
             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 proxy name default value is "SnmpUsmProxy".

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

SnmpUsmProxy

public SnmpUsmProxy(SnmpEngine engine,
                    SnmpUsmPeer 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 SnmpEngineId getEngineId()
The distant EngineId.

Specified by:
getEngineId in class SnmpV3Proxy
Returns:
The peer engine Id.

resyncOnTimelinessReport

public void resyncOnTimelinessReport(boolean retry)
When receiving a report, the proxy will resynchronize if the report is due to a timeliness desynchronization. Default value is true.

Parameters:
retry - true will retry, false will not.

handleReport

protected boolean handleReport(SnmpRequest request)
Called when a report is received when forwarding a request. If the returned value is true, the proxy will retry the current request.

Overrides:
handleReport in class SnmpProxy
Parameters:
request - The request containing the received report.
Returns:
true means retry the call, the report has been handled; false means don't retry, the report wasn't fixed.

If the received report is NotInTimeWindow, the SnmpUsmPeer is resynchronized. If the synchronization succeeded, true is returned, false otherwise.


createParameters

protected final SnmpParams createParameters(SnmpPdu pdu)
                                     throws SnmpStatusException
Factory parameters method. Overload this method in order to create your own parameters.

Specified by:
createParameters in class SnmpV3Proxy
Parameters:
pdu - The pdu received in the SnmpMibRequest or null if received pdu was null.
Returns:
The Usm 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.