Package 

Class UnknownAttributesAttribute

  • 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 ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public static String NAME
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getName() Returns the human readable name of this attribute.
      char getDataLength() Returns the length (in bytes) of this attribute's body.
      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.
      Iterator<Character> getAttributes() Returns an iterator over the list of attribute IDs contained by this attribute.
      int getAttributeCount() Returns the number of attribute IDs contained by this class.
      char getAttribute(int index) Returns the attribute id with index i.
      Array<byte> encode() Returns a binary representation of this attribute.
      boolean equals(Object obj) Compares two STUN Attributes.
      • Methods inherited from class org.ice4j.attribute.Attribute

        getAttributeType, getLocationInMessage, setLocationInMessage
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.
      • 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.
      • encode

         Array<byte> encode()

        Returns a binary representation of this attribute.

      • equals

         boolean equals(Object obj)

        Compares two STUN Attributes. Attributes are considered equal when their type, length, and all data are the same.

        Parameters:
        obj - the object to compare this attribute with.