Package org.jivesoftware.openfire.net
Class Bind2Request
java.lang.Object
org.jivesoftware.openfire.net.Bind2Request
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 Summary
ConstructorsConstructorDescriptionBind2Request(String clientTag, List<org.dom4j.Element> featureRequests) Creates a new Bind2Request instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.dom4j.Elementstatic Bind2Requestfrom(org.dom4j.Element authenticateElement) Extracts bind information from a SASL2 authenticate element.generateResourceString(UserAgentInfo userAgentInfo) Generates a resource string using the user agent information or defaults.Gets the client software identifier tag.List<org.dom4j.Element>Gets the list of feature request elements.org.dom4j.ElementprocessFeatureRequests(LocalClientSession clientSession, org.dom4j.Element successElement) Process feature request elements using registered handlers.static voidregisterElementHandler(Bind2InlineHandler handler) Registers a handler for processing inline elements with a specific namespace.static Bind2InlineHandlerunregisterElementHandler(String namespace) Unregisters a handler for a specific namespace.
-
Constructor Details
-
Bind2Request
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
Registers a handler for processing inline elements with a specific namespace.- Parameters:
handler- The handler to register
-
unregisterElementHandler
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
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
Gets the client software identifier tag.- Returns:
- The client tag or null if none was provided.
-
getFeatureRequests
Gets the list of feature request elements.- Returns:
- An unmodifiable list of feature request elements.
-
generateResourceString
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).
-