Package 

Class ChangeRequestAttribute

  • All Implemented Interfaces:

    
    public class ChangeRequestAttribute
    extends Attribute
                        

    This class represents the STUN CHANGE-REQUEST attribute. The CHANGE-REQUEST attribute is used by the client to request that the server use a different address and/or port when sending the response. The attribute is 32 bits long, although only two bits (A and B) are used:

    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  
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 0|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
    The meaning of the flags is: A: This is the "change IP" flag. If true, it requests the server to send the Binding Response with a different IP address than the one the Binding Request was received on. B: This is the "change port" flag. If true, it requests the server to send the Binding Response with a different port than the one the Binding Request was received on.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean getChangeIpFlag() Returns the value of the changeIpFlag.
      void setChangeIpFlag(boolean changeIP) Sets the value of the changeIpFlag.
      boolean getChangePortFlag() Returns the value of the changePortFlag.
      void setChangePortFlag(boolean changePort) Sets the value of the changePortFlag.
      String getName() Returns the human readable name of this attribute.
      boolean equals(Object obj) Compares two STUN Attributes.
      char getDataLength() Returns the length of this attribute's body.
      Array<byte> encode() Returns a binary representation of this attribute.
      • 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

      • getChangeIpFlag

         boolean getChangeIpFlag()

        Returns the value of the changeIpFlag. The "change IP" flag, if true, requests the server to send the Binding Response with a different IP address than the one the Binding Request was received on.

      • setChangeIpFlag

         void setChangeIpFlag(boolean changeIP)

        Sets the value of the changeIpFlag. The "change IP" flag, if true, requests the server to send the Binding Response with a different IP address than the one the Binding Request was received on.

        Parameters:
        changeIP - the new value of the changeIpFlag.
      • getChangePortFlag

         boolean getChangePortFlag()

        Returns the value of the changePortFlag. The "change port" flag. If true, requests the server to send the Binding Response with a different port than the one the Binding Request was received on.

      • setChangePortFlag

         void setChangePortFlag(boolean changePort)

        Sets the value of the changePortFlag. The "change port" flag. If true, requests the server to send the Binding Response with a different port than the one the Binding Request was received on.

        Parameters:
        changePort - the new value of the changePort flag.
      • 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.

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

         char getDataLength()

        Returns the length of this attribute's body.

      • encode

         Array<byte> encode()

        Returns a binary representation of this attribute.