Package rocks.xmpp.extensions.httpbind
Class BoshConnectionConfiguration
- java.lang.Object
-
- rocks.xmpp.core.net.client.ClientConnectionConfiguration
-
- rocks.xmpp.extensions.httpbind.BoshConnectionConfiguration
-
- All Implemented Interfaces:
ConnectionConfiguration
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.
Usage
In order to create an instance of this class you have to use the builder pattern as shown below.
BoshConnectionConfiguration boshConnectionConfiguration = BoshConnectionConfiguration.builder() .hostname("localhost") .port(5280) .path("/http-bind/") .build();
The above sample boshConnectionConfiguration will connect to
http://localhost:5280/http-bind/
.This class is immutable.
- See Also:
TcpConnectionConfiguration
,BoshConnection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BoshConnectionConfiguration.Builder
A builder to create aBoshConnectionConfiguration
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BoshConnectionConfiguration.Builder
builder()
Creates a new builder.CompletableFuture<Connection>
createConnection(XmppSession xmppSession, SessionOpen sessionOpen)
A factory method to create the connection.static BoshConnectionConfiguration
getDefault()
Gets the default boshConnectionConfiguration.String
getPath()
Gets the path on the host, e.g.String
getRoute()
Gets the route.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.String
toString()
-
Methods inherited from class rocks.xmpp.core.net.client.ClientConnectionConfiguration
getChannelEncryption, getCompressionMethods, getConnectTimeout, getHostname, getHostnameVerifier, getPort, getProxy, getSSLContext
-
-
-
-
Method Detail
-
getDefault
public static BoshConnectionConfiguration getDefault()
Gets the default boshConnectionConfiguration.- Returns:
- The default boshConnectionConfiguration.
-
setDefault
public static void setDefault(BoshConnectionConfiguration configuration)
Sets the default configuration.- Parameters:
configuration
- The default configuration.
-
builder
public static BoshConnectionConfiguration.Builder builder()
Creates a new builder.- Returns:
- The builder.
-
createConnection
public final CompletableFuture<Connection> createConnection(XmppSession xmppSession, SessionOpen sessionOpen)
Description copied from class:ClientConnectionConfiguration
A factory method to create the connection.- Specified by:
createConnection
in classClientConnectionConfiguration
- Parameters:
xmppSession
- The XMPP session, which is associated with the connection.sessionOpen
- The session open element.- Returns:
- The connection.
-
getWait
public final Duration getWait()
Gets the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session.- Returns:
- The wait time.
-
getPath
public final String getPath()
Gets the path on the host, e.g. "/http-bind/".- Returns:
- The path on the host.
-
getRoute
public final String getRoute()
Gets the route.- Returns:
- The route.
-
isUseKeySequence
public final boolean isUseKeySequence()
If the connection is secured via a key sequence mechanism.- Returns:
- If the connection is secured via a key sequence mechanism.
-
toString
public final String toString()
- Overrides:
toString
in classClientConnectionConfiguration
-
-