org.littleshoot.stun.stack.message
Enum StunMessageType

java.lang.Object
  extended by java.lang.Enum<StunMessageType>
      extended by org.littleshoot.stun.stack.message.StunMessageType
All Implemented Interfaces:
Serializable, Comparable<StunMessageType>

public enum StunMessageType
extends Enum<StunMessageType>

STUN attribute types. These are converted to the full values including the class bits for ease of use. This is just a little easier that forcing implementors to deal with the STUN encoding structure specified in draft-ietf-behave-rfc3489bis-08.txt section 6.


Enum Constant Summary
ALLOCATE_ERROR_RESPONSE
          A TURN message indicating an error with allocating a new address.
ALLOCATE_REQUEST
          TURN allocate request method.
ALLOCATE_SUCCESS_RESPONSE
          TURN response to a successful allocate request.
BINDING_ERROR_RESPONSE
          Error binding response bits.
BINDING_REQUEST
          Binding request type ID.
BINDING_SUCCESS_RESPONSE
          Successful binding response bits.
CONNECT_REQUEST
          A TURN connection request.
CONNECTION_STATUS_INDICATION
          TURN connection status indication message.
DATA_INDICATION
          A TURN data indication message.
SEND_INDICATION
          A TURN send indication message.
 
Method Summary
 int toInt()
          Accessor for the int value of the message type.
static StunMessageType toType(int typeInt)
          Returns the enum for the corresponding int value, or null if no corresponding value exists.
static StunMessageType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StunMessageType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BINDING_REQUEST

public static final StunMessageType BINDING_REQUEST
Binding request type ID.


BINDING_SUCCESS_RESPONSE

public static final StunMessageType BINDING_SUCCESS_RESPONSE
Successful binding response bits.


BINDING_ERROR_RESPONSE

public static final StunMessageType BINDING_ERROR_RESPONSE
Error binding response bits.


ALLOCATE_REQUEST

public static final StunMessageType ALLOCATE_REQUEST
TURN allocate request method.


ALLOCATE_SUCCESS_RESPONSE

public static final StunMessageType ALLOCATE_SUCCESS_RESPONSE
TURN response to a successful allocate request.


ALLOCATE_ERROR_RESPONSE

public static final StunMessageType ALLOCATE_ERROR_RESPONSE
A TURN message indicating an error with allocating a new address.


SEND_INDICATION

public static final StunMessageType SEND_INDICATION
A TURN send indication message.


DATA_INDICATION

public static final StunMessageType DATA_INDICATION
A TURN data indication message.


CONNECTION_STATUS_INDICATION

public static final StunMessageType CONNECTION_STATUS_INDICATION
TURN connection status indication message. TODO: The number for this message is wrong and is just chosen to be unique. There's a conflict in draft-ietf-behave-turn-03.txt where allocate requests have the same message type ID.


CONNECT_REQUEST

public static final StunMessageType CONNECT_REQUEST
A TURN connection request.

Method Detail

values

public static StunMessageType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StunMessageType c : StunMessageType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StunMessageType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toInt

public int toInt()
Accessor for the int value of the message type.

Returns:
The int value of the message type.

toType

public static StunMessageType toType(int typeInt)
Returns the enum for the corresponding int value, or null if no corresponding value exists.

Parameters:
typeInt - The type as an int.
Returns:
The corresponding enum value or null if no corresponding value exists.


Copyright © 2013 LittleShoot. All Rights Reserved.