Class Bind2Request

java.lang.Object
org.jivesoftware.openfire.net.Bind2Request

public class Bind2Request extends Object
Represents a SASL2 bind2 request from a client. The bind request contains an optional tag identifying the client software and can include additional feature requests in other namespaces.
  • Constructor Details

    • Bind2Request

      public Bind2Request(String clientTag, List<org.dom4j.Element> featureRequests)
      Creates a new Bind2Request instance.
      Parameters:
      clientTag - Optional string identifying the client software, can be null.
      featureRequests - List of feature request elements, can be empty but not null.
  • Method Details

    • registerElementHandler

      public static void registerElementHandler(Bind2InlineHandler handler)
      Registers a handler for processing inline elements with a specific namespace.
      Parameters:
      handler - The handler to register
    • unregisterElementHandler

      public static Bind2InlineHandler unregisterElementHandler(String namespace)
      Unregisters a handler for a specific namespace.
      Parameters:
      namespace - The namespace of the handler to remove
      Returns:
      The removed handler, or null if none was registered for this namespace
    • processFeatureRequests

      public org.dom4j.Element processFeatureRequests(LocalClientSession clientSession, org.dom4j.Element successElement)
      Process feature request elements using registered handlers.
      Returns:
      Element for
    • featureElement

      public static org.dom4j.Element featureElement()
    • from

      public static Bind2Request from(org.dom4j.Element authenticateElement)
      Extracts bind information from a SASL2 authenticate element.
      Parameters:
      authenticateElement - The authenticate element from which to extract bind data.
      Returns:
      A Bind2Request instance containing the extracted data, or null if no bind element was found.
    • getClientTag

      public String getClientTag()
      Gets the client software identifier tag.
      Returns:
      The client tag or null if none was provided.
    • getFeatureRequests

      public List<org.dom4j.Element> getFeatureRequests()
      Gets the list of feature request elements.
      Returns:
      An unmodifiable list of feature request elements.
    • generateResourceString

      public String generateResourceString(UserAgentInfo userAgentInfo)
      Generates a resource string using the user agent information or defaults.
      Parameters:
      userAgentInfo - The user agent information, can be null
      Returns:
      A resource string containing the client tag (if provided) followed by random string (hex or UUID).