Package org.opennms.netmgt.icmp.jni6
Class Jni6PingRequest
- java.lang.Object
-
- org.opennms.netmgt.icmp.jni6.Jni6PingRequest
-
- All Implemented Interfaces:
java.lang.Comparable<java.util.concurrent.Delayed>
,java.util.concurrent.Delayed
,EchoPacket
,org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
public class Jni6PingRequest extends java.lang.Object implements org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>, EchoPacket
This class is used to encapsulate a ping request. A request consist of the pingable address and a signaled state.- Author:
- Ben Reed, Mathew Brozowski
-
-
Constructor Summary
Constructors Constructor Description Jni6PingRequest(java.net.Inet6Address addr, int identifier, int sequenceNumber, long timeout, int retries, int packetsize, PingResponseCallback cb)
Jni6PingRequest(java.net.Inet6Address addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, int packetsize, PingResponseCallback cb)
Jni6PingRequest(Jni6PingRequestId id, long timeout, int retries, int packetsize, PingResponseCallback callback)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.util.concurrent.Delayed request)
compareTodouble
elapsedTime(java.util.concurrent.TimeUnit timeUnit)
Returns the round trip time in the requested TimeUnit (note that a fractional value will be returned if necessary)long
getDelay(java.util.concurrent.TimeUnit unit)
Jni6PingRequestId
getId()
getIdint
getIdentifier()
static long
getNextTID()
long
getReceivedTimeNanos()
long
getSentTimeNanos()
int
getSequenceNumber()
long
getThreadId()
boolean
isEchoReply()
boolean
isExpired()
isExpiredboolean
isProcessed()
isProcessedvoid
processError(java.lang.Throwable t)
boolean
processResponse(Jni6PingResponse reply)
processResponseJni6PingRequest
processTimeout()
processTimeoutvoid
send(org.opennms.protocols.icmp6.ICMPv6Socket socket)
Send this JniPingRequest through the given icmpSocketjava.lang.String
toString()
toString
-
-
-
Constructor Detail
-
Jni6PingRequest
public Jni6PingRequest(Jni6PingRequestId id, long timeout, int retries, int packetsize, PingResponseCallback callback)
-
Jni6PingRequest
public Jni6PingRequest(java.net.Inet6Address addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, int packetsize, PingResponseCallback cb)
-
Jni6PingRequest
public Jni6PingRequest(java.net.Inet6Address addr, int identifier, int sequenceNumber, long timeout, int retries, int packetsize, PingResponseCallback cb)
-
-
Method Detail
-
getNextTID
public static final long getNextTID()
-
processResponse
public boolean processResponse(Jni6PingResponse reply)
processResponse
- Specified by:
processResponse
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
- Parameters:
reply
- aorg.opennms.netmgt.icmp.Jni6PingResponse.JniPingResponse.PingReply
object.- Returns:
- a boolean.
-
processTimeout
public Jni6PingRequest processTimeout()
processTimeout
- Specified by:
processTimeout
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
- Returns:
- a
Jni6PingRequest
object.
-
isExpired
public boolean isExpired()
isExpired
- Returns:
- a boolean.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
getDelay
public long getDelay(java.util.concurrent.TimeUnit unit)
- Specified by:
getDelay
in interfacejava.util.concurrent.Delayed
- Specified by:
getDelay
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
-
compareTo
public int compareTo(java.util.concurrent.Delayed request)
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<java.util.concurrent.Delayed>
- Parameters:
request
- aDelayed
object.- Returns:
- a int.
-
getId
public Jni6PingRequestId getId()
getId
- Specified by:
getId
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
- Returns:
- a
org.opennms.netmgt.icmp.Jni6PingRequestId.JniPingRequestId.PingRequestId
object.
-
processError
public void processError(java.lang.Throwable t)
- Specified by:
processError
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
-
isProcessed
public boolean isProcessed()
isProcessed
- Specified by:
isProcessed
in interfaceorg.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
- Returns:
- a boolean.
-
send
public void send(org.opennms.protocols.icmp6.ICMPv6Socket socket)
Send this JniPingRequest through the given icmpSocket- Parameters:
socket
- aIcmpSocket
object.
-
isEchoReply
public boolean isEchoReply()
- Specified by:
isEchoReply
in interfaceEchoPacket
-
getIdentifier
public int getIdentifier()
- Specified by:
getIdentifier
in interfaceEchoPacket
-
getSequenceNumber
public int getSequenceNumber()
- Specified by:
getSequenceNumber
in interfaceEchoPacket
-
getThreadId
public long getThreadId()
- Specified by:
getThreadId
in interfaceEchoPacket
-
getReceivedTimeNanos
public long getReceivedTimeNanos()
- Specified by:
getReceivedTimeNanos
in interfaceEchoPacket
-
getSentTimeNanos
public long getSentTimeNanos()
- Specified by:
getSentTimeNanos
in interfaceEchoPacket
-
elapsedTime
public double elapsedTime(java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:EchoPacket
Returns the round trip time in the requested TimeUnit (note that a fractional value will be returned if necessary)- Specified by:
elapsedTime
in interfaceEchoPacket
-
-