org.opennms.netmgt.icmp.jni6
Class Jni6PingRequest

java.lang.Object
  extended by org.opennms.netmgt.icmp.jni6.Jni6PingRequest
All Implemented Interfaces:
Comparable<Delayed>, Delayed, EchoPacket, org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>

public class Jni6PingRequest
extends 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
Jni6PingRequest(Inet6Address addr, int identifier, int sequenceNumber, long timeout, int retries, PingResponseCallback cb)
           
Jni6PingRequest(Inet6Address addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, PingResponseCallback cb)
           
Jni6PingRequest(Inet6Address addr, int identifier, int sequenceNumber, long threadId, long timeout, int retries, ThreadCategory logger, PingResponseCallback cb)
           
Jni6PingRequest(Jni6PingRequestId id, long timeout, int retries, ThreadCategory log, PingResponseCallback callback)
           
 
Method Summary
 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)
          
 Jni6PingRequestId 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)
           
 boolean processResponse(Jni6PingResponse reply)
          processResponse
 Jni6PingRequest processTimeout()
          processTimeout
 void send(org.opennms.protocols.icmp6.ICMPv6Socket socket)
          Send this JniPingRequest through the given icmpSocket
 String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Jni6PingRequest

public Jni6PingRequest(Jni6PingRequestId id,
                       long timeout,
                       int retries,
                       ThreadCategory log,
                       PingResponseCallback callback)

Jni6PingRequest

public Jni6PingRequest(Inet6Address addr,
                       int identifier,
                       int sequenceNumber,
                       long threadId,
                       long timeout,
                       int retries,
                       ThreadCategory logger,
                       PingResponseCallback cb)

Jni6PingRequest

public Jni6PingRequest(Inet6Address addr,
                       int identifier,
                       int sequenceNumber,
                       long threadId,
                       long timeout,
                       int retries,
                       PingResponseCallback cb)

Jni6PingRequest

public Jni6PingRequest(Inet6Address addr,
                       int identifier,
                       int sequenceNumber,
                       long timeout,
                       int retries,
                       PingResponseCallback cb)
Method Detail

getNextTID

public static final long getNextTID()

processResponse

public boolean processResponse(Jni6PingResponse reply)

processResponse

Specified by:
processResponse in interface org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
Parameters:
reply - a org.opennms.netmgt.icmp.Jni6PingResponse.JniPingResponse.PingReply object.
Returns:
a boolean.

processTimeout

public Jni6PingRequest processTimeout()

processTimeout

Specified by:
processTimeout in interface org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
Returns:
a Jni6PingRequest object.

isExpired

public boolean isExpired()

isExpired

Returns:
a boolean.

toString

public String toString()

toString

Overrides:
toString in class Object
Returns:
a String object.

getDelay

public long getDelay(TimeUnit unit)

Specified by:
getDelay in interface Delayed
Specified by:
getDelay in interface org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>

compareTo

public int compareTo(Delayed request)

compareTo

Specified by:
compareTo in interface Comparable<Delayed>
Parameters:
request - a Delayed object.
Returns:
a int.

getId

public Jni6PingRequestId getId()

getId

Specified by:
getId in interface org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>
Returns:
a org.opennms.netmgt.icmp.Jni6PingRequestId.JniPingRequestId.PingRequestId object.

processError

public void processError(Throwable t)
Specified by:
processError in interface org.opennms.protocols.rt.Request<Jni6PingRequestId,Jni6PingRequest,Jni6PingResponse>

isProcessed

public boolean isProcessed()

isProcessed

Specified by:
isProcessed in interface org.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 - a IcmpSocket object.

isEchoReply

public boolean isEchoReply()
Specified by:
isEchoReply in interface EchoPacket

getIdentifier

public int getIdentifier()
Specified by:
getIdentifier in interface EchoPacket

getSequenceNumber

public int getSequenceNumber()
Specified by:
getSequenceNumber in interface EchoPacket

getThreadId

public long getThreadId()
Specified by:
getThreadId in interface EchoPacket

getReceivedTimeNanos

public long getReceivedTimeNanos()
Specified by:
getReceivedTimeNanos in interface EchoPacket

getSentTimeNanos

public long getSentTimeNanos()
Specified by:
getSentTimeNanos in interface EchoPacket

elapsedTime

public double elapsedTime(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 interface EchoPacket


Copyright © 2011. All Rights Reserved.