org.littleshoot.stun.stack.message.attributes
Enum StunAttributeType

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

public enum StunAttributeType
extends Enum<StunAttributeType>

STUN attribute types. We don't use an enum here becuase an enum would require unnecessary conversion from an int read from the network to the corresponding enum value, requiring an extra Map lookup. This is also simpler.


Enum Constant Summary
ALTERNATE_SERVER
          The alternate server attribute.
CONNECT_STAT
          Attribute for describing the TURN connection status.
DATA
          Used in TURN Data and Send Indication and messages to wrap the actual data.
ERROR_CODE
          The error code attribute.
FINGERPRINT
          The fingerprint attribute.
ICE_CONTROLLED
          Indicates that an ICE client believes it is currently in the controlled role.
ICE_CONTROLLING
          Indicates that an ICE client believes it is currently in the controlling role.
ICE_PRIORITY
          The priority that is to be associated with an ICE peer reflexive candidate, should one be discovered by the check with a request using this attribute.
ICE_USE_CANDIDATE
          Indicates that the ICE candidate pair resulting from this check should be used for transmission of media.
MAPPED_ADDRESS
          The mapped address attribute.
MESSAGE_INTEGRITY
          The message integrity attribute.
NONCE
          The nonce attribute.
PASSWORD
          The password attribute.
REALM
          The realm attribute.
REFRESH_INTERVAL
          The refresh interval attribute.
RELAY_ADDRESS
          The relay address allocated for a client on a TURN server.
REMOTE_ADDRESS
          Used in Data and Send Indication messages to describe where the data came from.
SERVER
          The server attribute.
UNKNOWN_ATTRIBUTES
          The unknown attributes attribute.
USERNAME
          The username attribute.
XOR_MAPPED_ADDRESS
          The XOR mapped address attribute.
 
Method Summary
 int toInt()
          Returns the int value for this type.
static StunAttributeType toType(int typeInt)
          Returns the enum for the corresponding int value, or null if no corresponding value exists.
static StunAttributeType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StunAttributeType[] 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

MAPPED_ADDRESS

public static final StunAttributeType MAPPED_ADDRESS
The mapped address attribute.


USERNAME

public static final StunAttributeType USERNAME
The username attribute.


PASSWORD

public static final StunAttributeType PASSWORD
The password attribute.


MESSAGE_INTEGRITY

public static final StunAttributeType MESSAGE_INTEGRITY
The message integrity attribute.


ERROR_CODE

public static final StunAttributeType ERROR_CODE
The error code attribute.


UNKNOWN_ATTRIBUTES

public static final StunAttributeType UNKNOWN_ATTRIBUTES
The unknown attributes attribute.


REALM

public static final StunAttributeType REALM
The realm attribute.


NONCE

public static final StunAttributeType NONCE
The nonce attribute.


XOR_MAPPED_ADDRESS

public static final StunAttributeType XOR_MAPPED_ADDRESS
The XOR mapped address attribute.


FINGERPRINT

public static final StunAttributeType FINGERPRINT
The fingerprint attribute. TODO: This is 0x8023 in draft-ietf-behave-rfc3489bis-06.txt, but that conflicts with ALTERNATE SERVER. Looks like maybe it should be 0x8021?


SERVER

public static final StunAttributeType SERVER
The server attribute.


ALTERNATE_SERVER

public static final StunAttributeType ALTERNATE_SERVER
The alternate server attribute.


REFRESH_INTERVAL

public static final StunAttributeType REFRESH_INTERVAL
The refresh interval attribute.


RELAY_ADDRESS

public static final StunAttributeType RELAY_ADDRESS
The relay address allocated for a client on a TURN server.


REMOTE_ADDRESS

public static final StunAttributeType REMOTE_ADDRESS
Used in Data and Send Indication messages to describe where the data came from.


DATA

public static final StunAttributeType DATA
Used in TURN Data and Send Indication and messages to wrap the actual data.


CONNECT_STAT

public static final StunAttributeType CONNECT_STAT
Attribute for describing the TURN connection status.


ICE_PRIORITY

public static final StunAttributeType ICE_PRIORITY
The priority that is to be associated with an ICE peer reflexive candidate, should one be discovered by the check with a request using this attribute.


ICE_USE_CANDIDATE

public static final StunAttributeType ICE_USE_CANDIDATE
Indicates that the ICE candidate pair resulting from this check should be used for transmission of media.


ICE_CONTROLLED

public static final StunAttributeType ICE_CONTROLLED
Indicates that an ICE client believes it is currently in the controlled role.


ICE_CONTROLLING

public static final StunAttributeType ICE_CONTROLLING
Indicates that an ICE client believes it is currently in the controlling role.

Method Detail

values

public static StunAttributeType[] 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 (StunAttributeType c : StunAttributeType.values())
    System.out.println(c);

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

valueOf

public static StunAttributeType 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()
Returns the int value for this type.

Returns:
The int value for this type.

toType

public static StunAttributeType 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.