java.lang.Object
net.i2p.addressbook.HostChecker.PingResult
- Enclosing class:
HostChecker
Ping result data structure containing the outcome of a host reachability test. Immutable - all fields are final.
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe host category from categories.txt, or null.final StringLeaseSet encryption types as a string like "[6,4]", or null.final booleanTrue if the host was reachable viaLeaseSetlookup, ping, or HTTP HEAD.final longResponse time in milliseconds, or -1 if not available.final longTimestamp of when this result was recorded (Java time).Constructor Summary
ConstructorsConstructorDescriptionPingResult(boolean reachable, long timestamp, long responseTime) Create a new PingResult with minimal fields.PingResult(boolean reachable, long timestamp, long responseTime, String category) Create a new PingResult without LeaseSet types.PingResult(boolean reachable, long timestamp, long responseTime, String category, String leaseSetTypes) Create a new PingResult with all fields.Method Summary
Field Details
reachable
public final boolean reachableTrue if the host was reachable viaLeaseSetlookup, ping, or HTTP HEAD.timestamp
public final long timestampTimestamp of when this result was recorded (Java time).responseTime
public final long responseTimeResponse time in milliseconds, or -1 if not available.category
The host category from categories.txt, or null.leaseSetTypes
LeaseSet encryption types as a string like "[6,4]", or null.
Constructor Details
PingResult
public PingResult(boolean reachable, long timestamp, long responseTime, String category, String leaseSetTypes) Create a new PingResult with all fields.- Parameters:
reachable- true if host was reachabletimestamp- time of the test resultresponseTime- response time in ms, or -1category- the host categoryleaseSetTypes- the LeaseSet encryption types
PingResult
Create a new PingResult without LeaseSet types.- Parameters:
reachable- true if the host answered the reachability testtimestamp- when the test ran, in milliseconds since the epochresponseTime- how long the reply took in milliseconds, or -1 if not measuredcategory- the host's category from categories.txt, or null if unclassified
PingResult
public PingResult(boolean reachable, long timestamp, long responseTime) Create a new PingResult with minimal fields.- Parameters:
reachable- true if the host answered the reachability testtimestamp- when the test ran, in milliseconds since the epochresponseTime- how long the reply took in milliseconds, or -1 if not measured