public class PingStatus extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
INVALID_DURATION
A value for
duration in case the ping ends up in some broken state where there is no meaningful
duration. |
| Constructor and Description |
|---|
PingStatus(PingDestination destination,
int code,
long timestamp,
int duration,
Traits traits)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static PingStatus |
error(PingDestination destination,
int code,
long timestamp)
Returns a new timeout
PingStatus with the given PingDestination, HTTP response code. |
int |
getCode() |
PingDestination |
getDestination() |
int |
getDuration() |
long |
getTimestamp() |
Traits |
getTraits() |
int |
hashCode() |
boolean |
isTimedOut() |
static PingStatus |
timeout(PingDestination destination,
long timestamp,
int duration)
Returns a new
PingStatus with the given PingDestination, timestamp,
duration and timedOut set to true. |
String |
toString() |
public static final int INVALID_DURATION
duration in case the ping ends up in some broken state where there is no meaningful
duration. The value is -1public PingStatus(PingDestination destination, int code, long timestamp, int duration, Traits traits)
destination - where the ping was sentcode - the HTTP response codetimestamp - the value of System.currentTimeMillis() when the response was received or when
the timeout or other error was detectedduration - Ping round trip duration in milliseconds or -1 if the ping timed outtimeout(PingDestination, long, int),
error(PingDestination, int, long)public static final PingStatus timeout(PingDestination destination, long timestamp, int duration)
PingStatus with the given PingDestination, timestamp,
duration and timedOut set to true.destination - the destination where the ping was senttimestamp - the value of System.currentTimeMillis() when the response was received or when the
timeout or other error was detectedduration - the ping round trip duration in milliseconds or -1 if the ping timed outPingStatuspublic static final PingStatus error(PingDestination destination, int code, long timestamp)
PingStatus with the given PingDestination, HTTP response code.destination - the destination where the ping was sentcode - the HTTP status code of the ping responsePingStatuspublic int getCode()
public int getDuration()
public boolean isTimedOut()
public long getTimestamp()
public PingDestination getDestination()
public Traits getTraits()
Copyright © 2015 Red Hat. All rights reserved.