Package org.opennms.core.utils
Class TimeoutTracker
- java.lang.Object
-
- org.opennms.core.utils.TimeoutTracker
-
public class TimeoutTracker extends Object
Helper class used for tracking retires and timeouts for ServiceMonitors.- Author:
- Ben Reed, Mathew Brozowski
-
-
Constructor Summary
Constructors Constructor Description TimeoutTracker(Map<String,?> parameters, int defaultRetry, int defaultTimeout)
Constructor for TimeoutTracker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
elapsedTime(TimeUnit unit)
elapsedTimedouble
elapsedTimeInMillis()
elapsedTimeInMillislong
elapsedTimeNanos()
elapsedTimeNanosint
getAttempt()
getAttemptint
getConnectionTimeout()
getConnectionTimeoutint
getSoTimeout()
getSoTimeoutlong
getTimeoutInMillis()
getTimeoutInMillislong
getTimeoutInSeconds()
getTimeoutInSecondsvoid
nextAttempt()
nextAttemptvoid
reset()
resetboolean
shouldRetry()
shouldRetryvoid
startAttempt()
startAttemptString
toString()
-
-
-
Method Detail
-
shouldRetry
public boolean shouldRetry()
shouldRetry
- Returns:
- a boolean.
-
getTimeoutInMillis
public long getTimeoutInMillis()
getTimeoutInMillis
- Returns:
- a long.
-
getTimeoutInSeconds
public long getTimeoutInSeconds()
getTimeoutInSeconds
- Returns:
- a long.
-
reset
public void reset()
reset
-
nextAttempt
public void nextAttempt()
nextAttempt
-
getAttempt
public int getAttempt()
getAttempt
- Returns:
- a int.
-
startAttempt
public void startAttempt()
startAttempt
-
elapsedTimeInMillis
public double elapsedTimeInMillis()
elapsedTimeInMillis
- Returns:
- a double.
-
elapsedTimeNanos
public long elapsedTimeNanos()
elapsedTimeNanos
- Returns:
- a long.
-
elapsedTime
public double elapsedTime(TimeUnit unit)
elapsedTime
- Parameters:
unit
- aTimeUnit
object.- Returns:
- a double.
-
getSoTimeout
public int getSoTimeout()
getSoTimeout
- Returns:
- a int.
-
getConnectionTimeout
public int getConnectionTimeout()
getConnectionTimeout
- Returns:
- a int.
-
-