public final class BoshConnectionConfiguration extends ClientConnectionConfiguration
A configuration for a BOSH connection. It allows you to configure basic connection settings like hostname and port, but also BOSH specific settings like the wait interval, a route or the use of a key sequencing mechanism.
BoshConnectionConfiguration boshConnectionConfiguration = BoshConnectionConfiguration.builder()
.hostname("localhost")
.port(5280)
.path("/http-bind/")
.build();
The above sample configuration will connect to http://localhost:5280/http-bind/
.
This class is immutable.
SocketConnectionConfiguration
,
BoshConnection
Modifier and Type | Class and Description |
---|---|
static class |
BoshConnectionConfiguration.Builder
A builder to create a
BoshConnectionConfiguration instance. |
Modifier and Type | Method and Description |
---|---|
static BoshConnectionConfiguration.Builder |
builder()
Creates a new builder.
|
Connection |
createConnection(XmppSession xmppSession)
A factory method to create the connection.
|
static BoshConnectionConfiguration |
getDefault()
Gets the default configuration.
|
java.lang.String |
getPath()
Gets the path on the host, e.g.
|
java.lang.String |
getRoute()
Gets the route.
|
java.time.Duration |
getWait()
Gets the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session.
|
boolean |
isUseKeySequence()
If the connection is secured via a key sequence mechanism.
|
static void |
setDefault(BoshConnectionConfiguration configuration)
Sets the default configuration.
|
java.lang.String |
toString() |
getChannelEncryption, getCompressionMethods, getConnectTimeout, getHostname, getHostnameVerifier, getPort, getProxy, getSSLContext
public static BoshConnectionConfiguration getDefault()
Gets the default configuration.
public static void setDefault(BoshConnectionConfiguration configuration)
Sets the default configuration.
configuration
- The default configuration.public static BoshConnectionConfiguration.Builder builder()
Creates a new builder.
public Connection createConnection(XmppSession xmppSession) throws java.lang.Exception
ClientConnectionConfiguration
A factory method to create the connection.
createConnection
in class ClientConnectionConfiguration
xmppSession
- The XMPP session, which is associated with the connection.java.lang.Exception
- Any exception which may occur during connection establishment.public final java.time.Duration getWait()
Gets the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session.
public final java.lang.String getPath()
Gets the path on the host, e.g. “/http-bind/”.
public final java.lang.String getRoute()
Gets the route.
public final boolean isUseKeySequence()
If the connection is secured via a key sequence mechanism.
public final java.lang.String toString()
toString
in class ClientConnectionConfiguration
Copyright © 2014–2019 XMPP.rocks. All rights reserved.