|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opennms.netmgt.ping.Reply
public final class Reply
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 create method the returned reply
encapsulates the sender's address and the received packet as final,
non-mutable values for the instance.
| Constructor Summary | |
|---|---|
Reply(InetAddress addr,
org.opennms.protocols.icmp.ICMPEchoPacket pkt)
Constructs a new reply with the passed address and packet as the contents of the reply. |
|
| Method Summary | |
|---|---|
static Reply |
create(DatagramPacket packet)
Creates a new instance of the class using the passed datagram as the data source. |
InetAddress |
getAddress()
Returns the internet address of the host that sent the reply. |
short |
getIdentity()
Returns the identity of the packet. |
org.opennms.protocols.icmp.ICMPEchoPacket |
getPacket()
Returns the ICMP packet for the reply. |
boolean |
isEchoReply()
Returns true if the recovered packet is an echo reply. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Reply(InetAddress addr,
org.opennms.protocols.icmp.ICMPEchoPacket pkt)
addr - The address of the ICMP sender.pkt - The received packet.| Method Detail |
|---|
public boolean isEchoReply()
public final short getIdentity()
public final InetAddress getAddress()
public final org.opennms.protocols.icmp.ICMPEchoPacket getPacket()
public static Reply create(DatagramPacket packet)
Creates a new instance of the class using the passed datagram as the data source. The address and ping packet are extracted from the datagram and returned as a new instance of the class. In addition to extracting the packet, the packet's received time is updated to the current time.
If the received datagram is not an echo reply or an incorrect length then an exception is generated to alert the caller.
packet - The packet with the ICMP datagram.
IllegalArgumentException - Throw if the datagram is not the correct length or type.
IndexOutOfBoundsException - Thrown if the datagram does not contain sufficent data.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||