-
- All Implemented Interfaces:
public class UnknownAttributesAttribute extends Attribute
The UNKNOWN-ATTRIBUTES attribute is present only in a Binding Error Response or Shared Secret Error Response when the response code in the ERROR-CODE attribute is 420. The attribute contains a list of 16 bit values, each of which represents an attribute type that was not understood by the server. If the number of unknown attributes is an odd number, one of the attributes MUST be repeated in the list, so that the total length of the list is a multiple of 4 bytes. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Attribute 1 Type | Attribute 2 Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Attribute 3 Type | Attribute 4 Type ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
Method Summary
Modifier and Type Method Description StringgetName()Returns the human readable name of this attribute. chargetDataLength()Returns the length (in bytes) of this attribute's body. voidaddAttributeID(char attributeID)Adds the specified attribute type to the list of unknown attributes. booleancontains(char attributeID)Verifies whether the specified attributeID is contained by this attribute. Iterator<Character>getAttributes()Returns an iterator over the list of attribute IDs contained by this attribute. intgetAttributeCount()Returns the number of attribute IDs contained by this class. chargetAttribute(int index)Returns the attribute id with index i. Array<byte>encode()Returns a binary representation of this attribute. booleanequals(Object obj)Compares two STUN Attributes. -
-
Method Detail
-
getName
String getName()
Returns the human readable name of this attribute. Attribute names do not really matter from the protocol point of view. They are only used for debugging and readability.
-
getDataLength
char getDataLength()
Returns the length (in bytes) of this attribute's body. If the number of unknown attributes is an odd number, one of the attributes MUST be repeated in the list, so that the total length of the list is a multiple of 4 bytes.
-
addAttributeID
void addAttributeID(char attributeID)
Adds the specified attribute type to the list of unknown attributes.
- Parameters:
attributeID- the id of an attribute to be listed as unknown in this attribute
-
contains
boolean contains(char attributeID)
Verifies whether the specified attributeID is contained by this attribute.
- Parameters:
attributeID- the attribute id to look for.
-
getAttributes
Iterator<Character> getAttributes()
Returns an iterator over the list of attribute IDs contained by this attribute.
-
getAttributeCount
int getAttributeCount()
Returns the number of attribute IDs contained by this class.
-
getAttribute
char getAttribute(int index)
Returns the attribute id with index i.
- Parameters:
index- the index of the attribute id to return.
-
-
-
-