public class JniPingRequest extends Object implements Request<JniPingRequestId,JniPingRequest,JniPingResponse>, EchoPacket
Constructor and Description |
---|
JniPingRequest(InetAddress addr,
int identifier,
int sequenceNumber,
long timeout,
int retries,
int packetsize,
PingResponseCallback cb) |
JniPingRequest(InetAddress addr,
int identifier,
int sequenceNumber,
long threadId,
long timeout,
int retries,
int packetsize,
PingResponseCallback cb) |
JniPingRequest(JniPingRequestId id,
long timeout,
int retries,
int packetsize,
PingResponseCallback callback) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Delayed request)
compareTo
|
double |
elapsedTime(TimeUnit timeUnit)
Returns the round trip time in the requested TimeUnit
(note that a fractional value will be returned if necessary)
|
long |
getDelay(TimeUnit unit)
Indicates how many units of time are remaining until this request times
out.
|
JniPingRequestId |
getId()
getId
|
int |
getIdentifier() |
static long |
getNextTID() |
long |
getReceivedTimeNanos() |
long |
getSentTimeNanos() |
int |
getSequenceNumber() |
long |
getThreadId() |
boolean |
isEchoReply() |
boolean |
isExpired()
isExpired
|
boolean |
isProcessed()
isProcessed
|
void |
processError(Throwable t)
If an error or exception occurs during processing of this request then
processError is called with the error or exception object.
|
boolean |
processResponse(JniPingResponse reply)
processResponse
|
JniPingRequest |
processTimeout()
processTimeout
|
void |
send(org.opennms.protocols.icmp.IcmpSocket icmpSocket)
Send this JniPingRequest through the given icmpSocket
|
String |
toString()
toString
|
public JniPingRequest(JniPingRequestId id, long timeout, int retries, int packetsize, PingResponseCallback callback)
public JniPingRequest(InetAddress addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, int packetsize, PingResponseCallback cb)
public JniPingRequest(InetAddress addr, int identifier, int sequenceNumber, long timeout, int retries, int packetsize, PingResponseCallback cb)
public static final long getNextTID()
public boolean processResponse(JniPingResponse reply)
processResponse
processResponse
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
reply
- a org.opennms.netmgt.icmp.spi.JniPingResponse.PingReply
object.public JniPingRequest processTimeout()
processTimeout
processTimeout
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
JniPingRequest
object.public boolean isExpired()
isExpired
public String toString()
toString
public long getDelay(TimeUnit unit)
getDelay
in interface Delayed
getDelay
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
public int compareTo(Delayed request)
compareTo
compareTo
in interface Comparable<Delayed>
request
- a Delayed
object.public JniPingRequestId getId()
getId
getId
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
org.opennms.netmgt.icmp.spi.JniPingRequestId.PingRequestId
object.public void processError(Throwable t)
Request
processError
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
public boolean isProcessed()
isProcessed
isProcessed
in interface Request<JniPingRequestId,JniPingRequest,JniPingResponse>
public void send(org.opennms.protocols.icmp.IcmpSocket icmpSocket)
icmpSocket
- a IcmpSocket
object.public boolean isEchoReply()
isEchoReply
in interface EchoPacket
public int getIdentifier()
getIdentifier
in interface EchoPacket
public int getSequenceNumber()
getSequenceNumber
in interface EchoPacket
public long getThreadId()
getThreadId
in interface EchoPacket
public long getReceivedTimeNanos()
getReceivedTimeNanos
in interface EchoPacket
public long getSentTimeNanos()
getSentTimeNanos
in interface EchoPacket
public double elapsedTime(TimeUnit timeUnit)
EchoPacket
elapsedTime
in interface EchoPacket
Copyright © 2022. All rights reserved.