java.lang.Object
net.i2p.addressbook.HostChecker.PingResult
Enclosing class:
HostChecker

public static class HostChecker.PingResultextends Object
Ping result data structure containing the outcome of a host reachability test. Immutable - all fields are final.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    The host category from categories.txt, or null.
    final String
    LeaseSet encryption types as a string like "[6,4]", or null.
    final boolean
    True if the host was reachable via LeaseSet lookup, ping, or HTTP HEAD.
    final long
    Response time in milliseconds, or -1 if not available.
    final long
    Timestamp of when this result was recorded (Java time).
  • Constructor Summary

    Constructors
    Constructor
    Description
    PingResult(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

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • reachable

      public final boolean reachable
      True if the host was reachable via LeaseSet lookup, ping, or HTTP HEAD.
    • timestamp

      public final long timestamp
      Timestamp of when this result was recorded (Java time).
    • responseTime

      public final long responseTime
      Response time in milliseconds, or -1 if not available.
    • category

      public final String category
      The host category from categories.txt, or null.
    • leaseSetTypes

      public final String 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 reachable
      timestamp - time of the test result
      responseTime - response time in ms, or -1
      category - the host category
      leaseSetTypes - the LeaseSet encryption types
    • PingResult

      public PingResult(boolean reachable, long timestamp, long responseTime, String category)
      Create a new PingResult without LeaseSet types.
      Parameters:
      reachable - true if the host answered the reachability test
      timestamp - when the test ran, in milliseconds since the epoch
      responseTime - how long the reply took in milliseconds, or -1 if not measured
      category - 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 test
      timestamp - when the test ran, in milliseconds since the epoch
      responseTime - how long the reply took in milliseconds, or -1 if not measured