Package org.opennms.netmgt.icmp.jni
Class JniPingRequest
- java.lang.Object
- 
- org.opennms.netmgt.icmp.jni.JniPingRequest
 
- 
- All Implemented Interfaces:
- Comparable<Delayed>,- Delayed,- EchoPacket,- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
 
 public class JniPingRequest extends Object implements org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>, 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 SummaryConstructors Constructor 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)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Delayed request)compareTodoubleelapsedTime(TimeUnit timeUnit)Returns the round trip time in the requested TimeUnit (note that a fractional value will be returned if necessary)longgetDelay(TimeUnit unit)JniPingRequestIdgetId()getIdintgetIdentifier()static longgetNextTID()longgetReceivedTimeNanos()longgetSentTimeNanos()intgetSequenceNumber()longgetThreadId()booleanisEchoReply()booleanisExpired()isExpiredbooleanisProcessed()isProcessedvoidprocessError(Throwable t)booleanprocessResponse(JniPingResponse reply)processResponseJniPingRequestprocessTimeout()processTimeoutvoidsend(org.opennms.protocols.icmp.IcmpSocket icmpSocket)Send this JniPingRequest through the given icmpSocketStringtoString()toString
 
- 
- 
- 
Constructor Detail- 
JniPingRequestpublic JniPingRequest(JniPingRequestId id, long timeout, int retries, int packetsize, PingResponseCallback callback) 
 - 
JniPingRequestpublic JniPingRequest(InetAddress addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, int packetsize, PingResponseCallback cb) 
 - 
JniPingRequestpublic JniPingRequest(InetAddress addr, int identifier, int sequenceNumber, long timeout, int retries, int packetsize, PingResponseCallback cb) 
 
- 
 - 
Method Detail- 
getNextTIDpublic static final long getNextTID() 
 - 
processResponsepublic boolean processResponse(JniPingResponse reply) processResponse - Specified by:
- processResponsein interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
- Parameters:
- reply- a- org.opennms.netmgt.icmp.spi.JniPingResponse.PingReplyobject.
- Returns:
- a boolean.
 
 - 
processTimeoutpublic JniPingRequest processTimeout() processTimeout - Specified by:
- processTimeoutin interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
- Returns:
- a JniPingRequestobject.
 
 - 
isExpiredpublic boolean isExpired() isExpired - Returns:
- a boolean.
 
 - 
toStringpublic String toString() toString 
 - 
getDelaypublic long getDelay(TimeUnit unit) - Specified by:
- getDelayin interface- Delayed
- Specified by:
- getDelayin interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
 
 - 
compareTopublic int compareTo(Delayed request) compareTo - Specified by:
- compareToin interface- Comparable<Delayed>
- Parameters:
- request- a- Delayedobject.
- Returns:
- a int.
 
 - 
getIdpublic JniPingRequestId getId() getId - Specified by:
- getIdin interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
- Returns:
- a org.opennms.netmgt.icmp.spi.JniPingRequestId.PingRequestIdobject.
 
 - 
processErrorpublic void processError(Throwable t) - Specified by:
- processErrorin interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
 
 - 
isProcessedpublic boolean isProcessed() isProcessed - Specified by:
- isProcessedin interface- org.opennms.protocols.rt.Request<JniPingRequestId,JniPingRequest,JniPingResponse>
- Returns:
- a boolean.
 
 - 
sendpublic void send(org.opennms.protocols.icmp.IcmpSocket icmpSocket) Send this JniPingRequest through the given icmpSocket- Parameters:
- icmpSocket- a- IcmpSocketobject.
 
 - 
isEchoReplypublic boolean isEchoReply() - Specified by:
- isEchoReplyin interface- EchoPacket
 
 - 
getIdentifierpublic int getIdentifier() - Specified by:
- getIdentifierin interface- EchoPacket
 
 - 
getSequenceNumberpublic int getSequenceNumber() - Specified by:
- getSequenceNumberin interface- EchoPacket
 
 - 
getThreadIdpublic long getThreadId() - Specified by:
- getThreadIdin interface- EchoPacket
 
 - 
getReceivedTimeNanospublic long getReceivedTimeNanos() - Specified by:
- getReceivedTimeNanosin interface- EchoPacket
 
 - 
getSentTimeNanospublic long getSentTimeNanos() - Specified by:
- getSentTimeNanosin interface- EchoPacket
 
 - 
elapsedTimepublic 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 interface- EchoPacket
 
 
- 
 
-