com.veraxsystems.icmp.ping
Class PingResult

java.lang.Object
  extended by com.veraxsystems.icmp.ping.PingResult

public class PingResult
extends java.lang.Object

The class is a definition of results returned by synchronous version of Ping.echo method.


Nested Class Summary
static class PingResult.ResultType
          Enum defines type of result
 
Constructor Summary
PingResult(java.net.InetAddress addressVal, IcmpStatus statusVal, PingResult.ResultType resultVal, long sendTimeVal, long responseTimeVal)
          Class constructor.
 
Method Summary
 java.net.InetAddress getAddress()
          The PingResult is response to ICMP EchoRequest.
 long getResponseTime()
          Get time of request processing.
 PingResult.ResultType getResult()
          Get type of result content.
 IcmpStatus getStatus()
          Get ICMP status.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PingResult

public PingResult(java.net.InetAddress addressVal,
                  IcmpStatus statusVal,
                  PingResult.ResultType resultVal,
                  long sendTimeVal,
                  long responseTimeVal)
Class constructor.

Parameters:
addressVal - the address of ICMP EchoRequest destination host
statusVal - status of ICMP response
resultVal - type of result
sendTimeVal - time when request echo was sent
Method Detail

getAddress

public java.net.InetAddress getAddress()
The PingResult is response to ICMP EchoRequest. This method get address of host the ICMP EchoRequest was sent to.

Returns:
address of host request was sent to

getResponseTime

public long getResponseTime()
Get time of request processing. It is difference between response receive time and request send time.

Returns:
echo processing time

getResult

public PingResult.ResultType getResult()
Get type of result content.

Returns:
result type

getStatus

public IcmpStatus getStatus()
Get ICMP status. The received response may be either successful EchoResponse or other kind of message. The status describes its type.

Returns:
status of ICMP response