Class PingRequest

java.lang.Object
com.tccc.kos.core.service.network.beans.PingRequest

public class PingRequest extends Object
Parameters for requesting a ping operation. The network stack can perform multiple pings in a single request with various timeout parameters. A ping request results in a PingResponse which contains statistics for the ping.
Version:
2024-05-24
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the hostname the ping should target.
    int
    Return the ip version to use for the ping operation: 0 : Automatically ping the ip version 4 : Use ip4 6 : Use ip6
    int
    Return the number of pings to perform.
    int
    Return the interval between pings in ms.
    int
    Return the timeout for an individual ping in ms.
    int
    Return the timeout for the entire ping request in ms.
    void
    setHostname(String hostname)
    Set the hostname the ping should target.
    void
    setIpVersion(int ipversion)
    Set the ip version to use for the ping operation: 0 : Automatically ping the ip version 4 : Use ip4 6 : Use ip6
    void
    setPingCount(int pingCount)
    Set the number of pings to perform.
    void
    setPingInterval(int pingInterval)
    Set the interval between pings in ms.
    void
    setPingTimeout(int pingTimeout)
    Set the timeout for an individual ping in ms.
    void
    setTotalTimeout(int totalTimeout)
    Set the timeout for the entire ping request in ms.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PingRequest

      public PingRequest()
  • Method Details

    • getHostname

      public String getHostname()
      Return the hostname the ping should target. This can be either a dns name or an ip address.
    • setHostname

      public void setHostname(String hostname)
      Set the hostname the ping should target. this can be either a dns name or an ip address.
      Parameters:
      hostname - dns name or ip address
    • getIpVersion

      public int getIpVersion()
      Return the ip version to use for the ping operation:
      • 0 : Automatically ping the ip version
      • 4 : Use ip4
      • 6 : Use ip6
    • setIpVersion

      public void setIpVersion(int ipversion)
      Set the ip version to use for the ping operation:
      • 0 : Automatically ping the ip version
      • 4 : Use ip4
      • 6 : Use ip6
      Parameters:
      ipversion - the version to use
    • getPingCount

      public int getPingCount()
      Return the number of pings to perform. This is maximum number of pings performed and the actual number of pings may be less based on timeouts.
    • setPingCount

      public void setPingCount(int pingCount)
      Set the number of pings to perform. This is maximum number of pings performed and the actual number of pings may be less based on timeouts.
      Parameters:
      pingCount - the max number of pings to perform
    • getPingInterval

      public int getPingInterval()
      Return the interval between pings in ms. This is the delay from the end of one ping to the start of the next ping.
    • setPingInterval

      public void setPingInterval(int pingInterval)
      Set the interval between pings in ms. This is the delay from the end of one ping to the start of the next ping.
      Parameters:
      pingInterval - the delay between pings in ms
    • getPingTimeout

      public int getPingTimeout()
      Return the timeout for an individual ping in ms. Any ping that takes longer than this to complete will be considered to have failed.
    • setPingTimeout

      public void setPingTimeout(int pingTimeout)
      Set the timeout for an individual ping in ms. Any ping that takes longer than this to complete will be considered to have failed.
      Parameters:
      pingTimeout - the timeout for an individual ping in ms
    • getTotalTimeout

      public int getTotalTimeout()
      Return the timeout for the entire ping request in ms. Any pings not performed by this timeout will be skipped.
    • setTotalTimeout

      public void setTotalTimeout(int totalTimeout)
      Set the timeout for the entire ping request in ms. Any pings not performed by this timeout will be skipped.
      Parameters:
      totalTimeout - the timeout for an individual ping in ms