Package org.opennms.netmgt.icmp.jni6
Class Jni6PingResponse
- java.lang.Object
-
- org.opennms.netmgt.icmp.jni6.Jni6PingResponse
-
- All Implemented Interfaces:
EchoPacket,org.opennms.protocols.rt.Response,org.opennms.protocols.rt.ResponseWithId<Jni6PingRequestId>
public final class Jni6PingResponse extends Object implements org.opennms.protocols.rt.ResponseWithId<Jni6PingRequestId>, EchoPacket
This class is use to encapsulate an ICMP reply that conforms to the
packetclass. The reply must be of type ICMP Echo Reply and be the correct length.When constructed by the
createmethod the returned reply encapsulates the sender's address and the received packet as final, non-mutable values for the instance.
-
-
Constructor Summary
Constructors Constructor Description Jni6PingResponse(Inet6Address addr, org.opennms.protocols.icmp6.ICMPv6EchoReply echoReply)Constructs a new reply with the passed address and packet as the contents of the reply.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleelapsedTime(TimeUnit timeUnit)Returns the round trip time in the requested TimeUnit (note that a fractional value will be returned if necessary)Inet6AddressgetAddress()Returns the internet address of the host that sent the reply.intgetIdentifier()longgetReceivedTimeNanos()Jni6PingRequestIdgetRequestId()getRequestIdlonggetSentTimeNanos()intgetSequenceNumber()longgetThreadId()booleanisEchoReply()Returns true if the recovered packet is an echo reply.StringtoString()
-
-
-
Constructor Detail
-
Jni6PingResponse
public Jni6PingResponse(Inet6Address addr, org.opennms.protocols.icmp6.ICMPv6EchoReply echoReply)
Constructs a new reply with the passed address and packet as the contents of the reply.- Parameters:
addr- The address of the ICMP sender.echoReply- The received packet.
-
-
Method Detail
-
getAddress
public Inet6Address getAddress()
Returns the internet address of the host that sent the reply.- Returns:
- a
InetAddressobject.
-
getRequestId
public Jni6PingRequestId getRequestId()
getRequestId
- Specified by:
getRequestIdin interfaceorg.opennms.protocols.rt.ResponseWithId<Jni6PingRequestId>- Returns:
- a
org.opennms.netmgt.icmp.spi.PingRequestIdobject.
-
isEchoReply
public boolean isEchoReply()
Returns true if the recovered packet is an echo reply.- Specified by:
isEchoReplyin interfaceEchoPacket- Returns:
- a boolean.
-
getIdentifier
public int getIdentifier()
- Specified by:
getIdentifierin interfaceEchoPacket
-
getSequenceNumber
public int getSequenceNumber()
- Specified by:
getSequenceNumberin interfaceEchoPacket
-
getThreadId
public long getThreadId()
- Specified by:
getThreadIdin interfaceEchoPacket
-
getSentTimeNanos
public long getSentTimeNanos()
- Specified by:
getSentTimeNanosin interfaceEchoPacket
-
getReceivedTimeNanos
public long getReceivedTimeNanos()
- Specified by:
getReceivedTimeNanosin interfaceEchoPacket
-
elapsedTime
public double elapsedTime(TimeUnit timeUnit)
Description copied from interface:EchoPacketReturns the round trip time in the requested TimeUnit (note that a fractional value will be returned if necessary)- Specified by:
elapsedTimein interfaceEchoPacket
-
-