org.littleshoot.stun.stack.message
Class StunMessageVisitorAdapter<T>

java.lang.Object
  extended by org.littleshoot.stun.stack.message.StunMessageVisitorAdapter<T>
Type Parameters:
T - The class the visitor methods return.
All Implemented Interfaces:
StunMessageVisitor<T>

public class StunMessageVisitorAdapter<T>
extends Object
implements StunMessageVisitor<T>

Adapter class for convenient creation of message visitor subclasses. This will log errors whenever something is visited that's not overidden. If a subclass should handle a message, it therefore must override the appropriate visit method.


Constructor Summary
StunMessageVisitorAdapter()
           
 
Method Summary
 T visitAllocateErrorResponse(AllocateErrorResponse response)
          Visits a response for a failed Allocate Request.
 T visitAllocateRequest(AllocateRequest request)
          Visits the TURN usage allocate request message.
 T visitAllocateSuccessResponse(AllocateSuccessResponse response)
          Visits a response for a successful Allocate Request.
 T visitBindingErrorResponse(BindingErrorResponse response)
          Visits a binding error response.
 T visitBindingRequest(BindingRequest request)
          Visits a binding message.
 T visitBindingSuccessResponse(BindingSuccessResponse response)
          Visits a binding success response.
 T visitCanceledMessage(CanceledStunMessage message)
          Visits a STUN message indicating the STUN transaction was canceled.
 T visitConnectErrorMesssage(ConnectErrorStunMessage message)
          Visits a STUN "message" indicating there was a connection error, such as an ICMP error or a failure to create a TCP connection.
 T visitConnectionStatusIndication(ConnectionStatusIndication indication)
          Visits a connection status indication message informing clients of the connection status of remote hosts.
 T visitConnectRequest(ConnectRequest request)
          Visits a connection request from a client.
 T visitDataIndication(DataIndication data)
           
 T visitNullMessage(NullStunMessage message)
          Visits the absence of a message.
 T visitSendIndication(SendIndication request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StunMessageVisitorAdapter

public StunMessageVisitorAdapter()
Method Detail

visitAllocateRequest

public T visitAllocateRequest(AllocateRequest request)
Description copied from interface: StunMessageVisitor
Visits the TURN usage allocate request message.

Specified by:
visitAllocateRequest in interface StunMessageVisitor<T>
Parameters:
request - The TURN usage allocate request.
Returns:
The return type for this visitor.

visitBindingRequest

public T visitBindingRequest(BindingRequest request)
Description copied from interface: StunMessageVisitor
Visits a binding message.

Specified by:
visitBindingRequest in interface StunMessageVisitor<T>
Parameters:
request - The binding message.
Returns:
The return type for this visitor.

visitConnectRequest

public T visitConnectRequest(ConnectRequest request)
Description copied from interface: StunMessageVisitor
Visits a connection request from a client. Only STUN servers will respond to this request. This request indicates the client wishes to allow connections from the host specified in the REMOTE ADDRESS attribute.

Specified by:
visitConnectRequest in interface StunMessageVisitor<T>
Parameters:
request - The connect request.
Returns:
The return type for this visitor.

visitConnectionStatusIndication

public T visitConnectionStatusIndication(ConnectionStatusIndication indication)
Description copied from interface: StunMessageVisitor
Visits a connection status indication message informing clients of the connection status of remote hosts. The connection status is sent in the CONNECT STAT attribute.

Specified by:
visitConnectionStatusIndication in interface StunMessageVisitor<T>
Parameters:
indication - The connection status indication message.
Returns:
The return type for this visitor.

visitDataIndication

public T visitDataIndication(DataIndication data)
Specified by:
visitDataIndication in interface StunMessageVisitor<T>

visitSendIndication

public T visitSendIndication(SendIndication request)
Specified by:
visitSendIndication in interface StunMessageVisitor<T>

visitAllocateSuccessResponse

public T visitAllocateSuccessResponse(AllocateSuccessResponse response)
Description copied from interface: StunMessageVisitor
Visits a response for a successful Allocate Request.

Specified by:
visitAllocateSuccessResponse in interface StunMessageVisitor<T>
Parameters:
response - The response to a successful Allocate Request.
Returns:
The return type for this visitor.

visitAllocateErrorResponse

public T visitAllocateErrorResponse(AllocateErrorResponse response)
Description copied from interface: StunMessageVisitor
Visits a response for a failed Allocate Request.

Specified by:
visitAllocateErrorResponse in interface StunMessageVisitor<T>
Parameters:
response - The response to a failed Allocate Request.
Returns:
The return type for this visitor.

visitBindingSuccessResponse

public T visitBindingSuccessResponse(BindingSuccessResponse response)
Description copied from interface: StunMessageVisitor
Visits a binding success response.

Specified by:
visitBindingSuccessResponse in interface StunMessageVisitor<T>
Parameters:
response - The binding success response.
Returns:
The return type for this visitor.

visitBindingErrorResponse

public T visitBindingErrorResponse(BindingErrorResponse response)
Description copied from interface: StunMessageVisitor
Visits a binding error response.

Specified by:
visitBindingErrorResponse in interface StunMessageVisitor<T>
Parameters:
response - Binding error response.
Returns:
The return type for this visitor.

visitNullMessage

public T visitNullMessage(NullStunMessage message)
Description copied from interface: StunMessageVisitor
Visits the absence of a message. This can occur, for example, when a request receives no response whatsoever.

Specified by:
visitNullMessage in interface StunMessageVisitor<T>
Parameters:
message - The message to visit.
Returns:
The return type for this visitor.

visitCanceledMessage

public T visitCanceledMessage(CanceledStunMessage message)
Description copied from interface: StunMessageVisitor
Visits a STUN message indicating the STUN transaction was canceled. This allows visitors to differentiate between canceled messages and messages where the server never responded.

Specified by:
visitCanceledMessage in interface StunMessageVisitor<T>
Parameters:
message - The canceled message.
Returns:
The type the visitor returns.

visitConnectErrorMesssage

public T visitConnectErrorMesssage(ConnectErrorStunMessage message)
Description copied from interface: StunMessageVisitor
Visits a STUN "message" indicating there was a connection error, such as an ICMP error or a failure to create a TCP connection.

Specified by:
visitConnectErrorMesssage in interface StunMessageVisitor<T>
Parameters:
message - The connection error message.
Returns:
The type the visitor returns.


Copyright © 2013 LittleShoot. All Rights Reserved.