net.tomp2p.natpmp
Class Message

java.lang.Object
  extended by net.tomp2p.natpmp.Message
Direct Known Subclasses:
ExternalAddressRequestMessage, MapRequestMessage

public abstract class Message
extends Object

The message class manages a message that is being sent to a NAT-PMP gateway. The class respects the back-off time defined in the NAT-PMP specification. Consumers of this class need to ensure that only one message is being sent at a time to remain compliant with the NAT-PMP specification. This class is thread-safe.

Author:
flszen
See Also:
ExternalAddressRequestMessage, MapRequestMessage

Method Summary
 NatPmpException getResponseException()
          Gets the excpetion associated with the response.
 ResultCode getResultCode()
          Gets the result code.
 Integer getSecondsSinceEpoch()
          Gets the seconds since epoch as received from the NAT-PMP gateway.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResponseException

public NatPmpException getResponseException()
Gets the excpetion associated with the response. This exception is generally provided by an external entity.

Returns:
The NatPmpException associated with the response.

getResultCode

public ResultCode getResultCode()
                         throws NatPmpException
Gets the result code.

Returns:
The result code.
Throws:
NatPmpException - Thrown when no response has been received or the response parsing ran into some trouble.

getSecondsSinceEpoch

public Integer getSecondsSinceEpoch()
                             throws NatPmpException
Gets the seconds since epoch as received from the NAT-PMP gateway.

Returns:
The seconds since the epoch on the gateway.
Throws:
NatPmpException - Thrown when no response has been received or the response parsing ran into some trouble.


Copyright © 2013. All Rights Reserved.