com.adventnet.snmp.snmp2
Class ExponentialTimeoutPolicy

java.lang.Object
  extended by com.adventnet.snmp.snmp2.TimeoutPolicy
      extended by com.adventnet.snmp.snmp2.ExponentialTimeoutPolicy

 class ExponentialTimeoutPolicy
extends TimeoutPolicy


Constructor Summary
ExponentialTimeoutPolicy()
           
 
Method Summary
 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

ExponentialTimeoutPolicy

ExponentialTimeoutPolicy()
Method Detail

calculateTimeout

public int calculateTimeout(int timeout,
                            int retries)
Description copied from class: TimeoutPolicy
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

Specified by:
calculateTimeout in class TimeoutPolicy
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.