org.littleshoot.stun.stack.message.turn
Class AllocateSuccessResponse

java.lang.Object
  extended by org.littleshoot.stun.stack.message.AbstractStunMessage
      extended by org.littleshoot.stun.stack.message.turn.AllocateSuccessResponse
All Implemented Interfaces:
StunMessage, VisitableStunMessage

public final class AllocateSuccessResponse
extends AbstractStunMessage

Creates a new response to an allocate request. This includes the mapped address the server has allocated to proxy data to the TURN client.


Constructor Summary
AllocateSuccessResponse(org.apache.commons.id.uuid.UUID transactionId, InetSocketAddress relayAddress, InetSocketAddress mappedAddress)
          Creates a new successful response to an allocate request.
AllocateSuccessResponse(org.apache.commons.id.uuid.UUID transactionId, Map<StunAttributeType,StunAttribute> attributes)
          Creates a new successful response to an allocate request.
 
Method Summary
<T> T
accept(StunMessageVisitor<T> visitor)
          Accepts the specified visitor class.
 InetSocketAddress getMappedAddress()
          Accessor for the mapped address in the response.
 InetSocketAddress getRelayAddress()
          Accessor for the RELAY ADDRESS in the response.
 
Methods inherited from class org.littleshoot.stun.stack.message.AbstractStunMessage
createAttributes, createRemoteAddress, getAttributes, getBodyLength, getTotalLength, getTransactionId, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AllocateSuccessResponse

public AllocateSuccessResponse(org.apache.commons.id.uuid.UUID transactionId,
                               Map<StunAttributeType,StunAttribute> attributes)
Creates a new successful response to an allocate request.

Parameters:
transactionId - The ID of the transaction, matching the ID of the request.
attributes - The message attributes.

AllocateSuccessResponse

public AllocateSuccessResponse(org.apache.commons.id.uuid.UUID transactionId,
                               InetSocketAddress relayAddress,
                               InetSocketAddress mappedAddress)
Creates a new successful response to an allocate request.

Parameters:
transactionId - The ID of the transaction, matching the ID of the request.
relayAddress - The allocated RELAY ADDRESS on the server.
mappedAddress - The MAPPED ADDRESS, or the "server reflexive" address.
Method Detail

getMappedAddress

public InetSocketAddress getMappedAddress()
Accessor for the mapped address in the response.

Returns:
The mapped address.

getRelayAddress

public InetSocketAddress getRelayAddress()
Accessor for the RELAY ADDRESS in the response.

Returns:
The RELAY ADDRESS.

accept

public <T> T accept(StunMessageVisitor<T> visitor)
Description copied from interface: VisitableStunMessage
Accepts the specified visitor class.

Type Parameters:
T - The type the visitor will return.
Parameters:
visitor - The visitor to accept.
Returns:
The return value of the visitor.


Copyright © 2013 LittleShoot. All Rights Reserved.