com.adventnet.snmp.snmp2
Class TimeoutPolicy

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.TimeoutPolicy

public abstract class TimeoutPolicy
extends java.lang.Object

This provides a convenient base class from which other timeout policies can be easily derived.


Constructor Summary
TimeoutPolicy()
           
 
Method Summary
abstract  int calculateTimeout(int timeout, int retries)
          This method should calculate the timeout value and return it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeoutPolicy

public TimeoutPolicy()
Method Detail

calculateTimeout

public abstract int calculateTimeout(int timeout,
                                     int retries)
This method should calculate the timeout value and return it. The first argument is the timeout value that is set on the pdu before sending a SNMP request and the retries is the iteration.

Here is a better explanation:
For example, if the timeout value is 5000 milliSeconds and the retries value is 3, then this method will be called with the following values.
calculateTimeout(5000, 0) -- this should return the timeout for the actual request that is sent
calculateTimeout(5000, 1) -- this should return the timeout for the first re-try
calculateTimeout(5000, 2) -- this should return the timeout for the second re-try
calculateTimeout(5000, 3) -- this should return the timeout for the third re-try

Parameters:
timeout - this is the timeout value ( in milliSeconds ) that is set on the pdu.
retries - this denotes the request that is sent.
Returns:
This method should return the calculated time-out value in milliSeconds.


Copyright (c)AdventNet Inc., 1996-2004