public class UnknownAttributesAttribute extends Attribute
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Attribute name.
|
private ArrayList<Character> |
unknownAttributes
A list of attribute types that were not understood by the server.
|
ALTERNATE_SERVER, attributeType, CHANGE_REQUEST, CHANGED_ADDRESS, CHANNEL_NUMBER, CONNECTION_ID, DATA, DESTINATION_ADDRESS, DONT_FRAGMENT, ERROR_CODE, EVEN_PORT, FINGERPRINT, HEADER_LENGTH, ICE_CONTROLLED, ICE_CONTROLLING, LIFETIME, MAGIC_COOKIE, MAPPED_ADDRESS, MESSAGE_INTEGRITY, NONCE, PASSWORD, PRIORITY, REALM, REFLECTED_FROM, REMOTE_ADDRESS, REQUESTED_ADDRESS_FAMILY, REQUESTED_TRANSPORT, RESERVATION_TOKEN, RESPONSE_ADDRESS, SOFTWARE, SOURCE_ADDRESS, UNKNOWN_ATTRIBUTES, UNKNOWN_OPTIONAL_ATTRIBUTE, USE_CANDIDATE, USERNAME, XOR_MAPPED_ADDRESS, XOR_ONLY, XOR_PEER_ADDRESS, XOR_RELAYED_ADDRESS
Constructor and Description |
---|
UnknownAttributesAttribute()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeID(char attributeID)
Adds the specified attribute type to the list of unknown attributes.
|
boolean |
contains(char attributeID)
Verifies whether the specified attributeID is contained by this attribute.
|
(package private) void |
decodeAttributeBody(byte[] attributeValue,
char offset,
char length)
Sets this attribute's fields according to attributeValue array.
|
byte[] |
encode()
Returns a binary representation of this attribute.
|
boolean |
equals(Object obj)
Compares two STUN Attributes.
|
char |
getAttribute(int index)
Returns the attribute id with index i.
|
int |
getAttributeCount()
Returns the number of attribute IDs contained by this class.
|
Iterator<Character> |
getAttributes()
Returns an iterator over the list of attribute IDs contained by this
attribute.
|
char |
getDataLength()
Returns the length (in bytes) of this attribute's body.
|
String |
getName()
Returns the human readable name of this attribute.
|
getAttributeType, getLocationInMessage, setAttributeType, setLocationInMessage
public static String NAME
public String getName()
public char getDataLength()
getDataLength
in class Attribute
public void addAttributeID(char attributeID)
attributeID
- the id of an attribute to be listed as unknown in this
attributepublic boolean contains(char attributeID)
attributeID
- the attribute id to look for.public Iterator<Character> getAttributes()
public int getAttributeCount()
public char getAttribute(int index)
index
- the index of the attribute id to return.public byte[] encode()
public boolean equals(Object obj)
void decodeAttributeBody(byte[] attributeValue, char offset, char length) throws StunException
decodeAttributeBody
in class Attribute
attributeValue
- a binary array containing this attribute's field
values and NOT containing the attribute header.offset
- the position where attribute values begin (most often
offset is equal to the index of the first byte after
length)length
- the length of the binary array.StunException
- if attrubteValue contains invalid data.Copyright © 2018. All rights reserved.