Class Bind

  • All Implemented Interfaces:
    Comparable<StreamFeature>

    public final class Bind
    extends StreamFeature
    The implementation of the <bind/> element, which is used during resource binding.

    7.4. Advertising Support

    Upon sending a new response stream header to the client after successful SASL negotiation, the server MUST include a <bind/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace in the stream features it presents to the client.

    7.6.1. Success Case

    A client requests a server-generated resourcepart by sending an IQ stanza of type "set" (see Section 8.2.3) containing an empty <bind/> element qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace.

    Once the server has generated an XMPP resourcepart for the client, it MUST return an IQ stanza of type "result" to the client, which MUST include a <jid/> child element that specifies the full JID for the connected resource as determined by the server.

    This class is immutable.

    • Constructor Detail

      • Bind

        public Bind()
        Creates an empty <bind/> element.
      • Bind

        public Bind​(String resource)
        Creates a <bind/> element with a resource.
        Parameters:
        resource - The resource.
      • Bind

        public Bind​(Jid jid)
        Creates a <bind/> element with a JID.
        Parameters:
        jid - The JID.
    • Method Detail

      • getJid

        public final Jid getJid()
        Gets the JID, which has been generated by the server after resource binding.
        Returns:
        The JID.
      • getResource

        public final String getResource()
        Gets the resource.
        Returns:
        The resource.
      • isMandatory

        public final boolean isMandatory()
        Description copied from class: StreamFeature
        Indicates, whether this feature is mandatory to negotiate. By default a feature is not mandatory. Override this method for mandatory-to-negotiate features.
        Overrides:
        isMandatory in class StreamFeature
        Returns:
        True, if the feature is mandatory.
      • getPriority

        public final int getPriority()
        Description copied from class: StreamFeature
        Gets the priority of the feature, i.e. when it will be negotiated during feature negotiation.
        Overrides:
        getPriority in class StreamFeature
        Returns:
        The priority.