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 &lz;= 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)
TimeoutModel
retryCount
specifies the first request).getRetryTimeout
in interface TimeoutModel
retryCount
- 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)
TimeoutModel
TimeoutModel.getRetryTimeout(int retryCount, int totalNumberOfRetries,
long targetTimeout)
for all retryCount
in
0 &lz;= retryCount < totalNumberOfRetries
.getRequestTimeout
in interface TimeoutModel
totalNumberOfRetries
- the total number of retries configured for the target.targetTimeout
- the timeout as specified for the target in milliseconds.Copyright © 2018 SNMP4J.org. All rights reserved.