Class PingRequest
java.lang.Object
com.tccc.kos.core.service.network.beans.PingRequest
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 -
Method Summary
Modifier and TypeMethodDescriptionReturn the hostname the ping should target.intReturn the ip version to use for the ping operation: 0 : Automatically ping the ip version 4 : Use ip4 6 : Use ip6intReturn the number of pings to perform.intReturn the interval between pings in ms.intReturn the timeout for an individual ping in ms.intReturn the timeout for the entire ping request in ms.voidsetHostname(String hostname) Set the hostname the ping should target.voidsetIpVersion(int ipversion) Set the ip version to use for the ping operation: 0 : Automatically ping the ip version 4 : Use ip4 6 : Use ip6voidsetPingCount(int pingCount) Set the number of pings to perform.voidsetPingInterval(int pingInterval) Set the interval between pings in ms.voidsetPingTimeout(int pingTimeout) Set the timeout for an individual ping in ms.voidsetTotalTimeout(int totalTimeout) Set the timeout for the entire ping request in ms.
-
Constructor Details
-
PingRequest
public PingRequest()
-
-
Method Details
-
getHostname
Return the hostname the ping should target. This can be either a dns name or an ip address. -
setHostname
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
-