net.tomp2p.natpmp
Class ExternalAddressRequestMessage

java.lang.Object
  extended by net.tomp2p.natpmp.Message
      extended by net.tomp2p.natpmp.ExternalAddressRequestMessage

public class ExternalAddressRequestMessage
extends Message

This class manages an External Address message. This class is thread-safe. After instantiation, this class may be added to the message queue on the NatPmpDevice.

Author:
flszen

Constructor Summary
ExternalAddressRequestMessage(MessageResponseInterface listener)
          Constructs a new ExternalAddressRequestMessage.
 
Method Summary
 Inet4Address getExternalAddress()
          Gets the NAT-PMP gateway's external address.
 
Methods inherited from class net.tomp2p.natpmp.Message
getResponseException, getResultCode, getSecondsSinceEpoch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalAddressRequestMessage

public ExternalAddressRequestMessage(MessageResponseInterface listener)
Constructs a new ExternalAddressRequestMessage.

Parameters:
listener - The MessageResponseInterface that will respond to the message result.
Method Detail

getExternalAddress

public Inet4Address getExternalAddress()
                                throws NatPmpException
Gets the NAT-PMP gateway's external address.

Returns:
The external Inet4Address of the NAT-PMP gateway.
Throws:
NatPmpException - Thrown when no response has been received or the response parsing ran into some trouble.


Copyright © 2013. All Rights Reserved.