public class DefaultTimeoutModel extends Object implements TimeoutModel
DefaultTimeoutModel implements a timeout model that uses
constant timeouts between retries.
The total time waited before a request is timed out is therefore:
(totalNumberOfRetries + 1) * targetTimeout where each (re)try
is timed out after targetTimeout milliseconds.
| Constructor and Description |
|---|
DefaultTimeoutModel() |
| Modifier and Type | Method and Description |
|---|---|
long |
getRequestTimeout(int totalNumberOfRetries,
long targetTimeout)
Gets the timeout for all retries, which is defined as the sum of
TimeoutModel.getRetryTimeout(int retryCount, int totalNumberOfRetries,
long targetTimeout)
for all retryCount in
0 <= retryCount < totalNumberOfRetries. |
long |
getRetryTimeout(int retryCount,
int totalNumberOfRetries,
long targetTimeout)
Gets the timeout for the specified retry (a zero value for
retryCount specifies the first request). |
public long getRetryTimeout(int retryCount,
int totalNumberOfRetries,
long targetTimeout)
TimeoutModelretryCount specifies the first request).getRetryTimeout in interface TimeoutModelretryCount - the number of retries already performed for the target.totalNumberOfRetries - the total number of retries configured for the target.targetTimeout - the timeout as specified for the target in milliseconds.public long getRequestTimeout(int totalNumberOfRetries,
long targetTimeout)
TimeoutModelTimeoutModel.getRetryTimeout(int retryCount, int totalNumberOfRetries,
long targetTimeout)
for all retryCount in
0 <= retryCount < totalNumberOfRetries.getRequestTimeout in interface TimeoutModeltotalNumberOfRetries - the total number of retries configured for the target.targetTimeout - the timeout as specified for the target in milliseconds.Copyright © 2016 SNMP4J.org. All Rights Reserved.