Package org.igniterealtime.jbosh
Class BOSHClientConfig.Builder
java.lang.Object
org.igniterealtime.jbosh.BOSHClientConfig.Builder
- Enclosing class:
BOSHClientConfig
Class instance builder, after the builder pattern. This allows each
BOSHClientConfig
instance to be immutable while providing
flexibility when building new BOSHClientConfig
instances.
Instances of this class are not thread-safe. If template-style
use is desired, see the create(BOSHClientConfig)
method.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the immutable object instance with the current configuration.static BOSHClientConfig.Builder
Creates a new builder instance, used to create instances of theBOSHClientConfig
class.static BOSHClientConfig.Builder
create
(BOSHClientConfig cfg) Creates a new builder instance using the existing configuration provided as a starting point.setCompressionEnabled
(boolean enabled) Set whether or not compression of the underlying data stream should be attempted.Set the ID of the client station, to be forwarded to the connection manager when new sessions are created.Specify the hostname and port of an HTTP proxy to connect through.Sets the destination server/domain that the client should connect to.setSSLContext
(SSLContext ctx) Set the SSL context to use for this session.setXMLLang
(String lang) Set the default language of any human-readable content within the XML.
-
Field Details
-
bURI
-
bDomain
-
bFrom
-
bLang
-
bRoute
-
bProxyHost
-
bProxyPort
private int bProxyPort -
bSSLContext
-
bCompression
-
-
Constructor Details
-
Builder
Creates a new builder instance, used to create instances of theBOSHClientConfig
class.- Parameters:
cmURI
- URI to use to contact the connection managerdomain
- target domain to communicate with
-
-
Method Details
-
create
Creates a new builder instance, used to create instances of theBOSHClientConfig
class.- Parameters:
cmURI
- URI to use to contact the connection managerdomain
- target domain to communicate with- Returns:
- builder instance
-
create
Creates a new builder instance using the existing configuration provided as a starting point.- Parameters:
cfg
- configuration to copy- Returns:
- builder instance
-
setFrom
Set the ID of the client station, to be forwarded to the connection manager when new sessions are created.- Parameters:
id
- client ID- Returns:
- builder instance
-
setXMLLang
Set the default language of any human-readable content within the XML.- Parameters:
lang
- XML language ID- Returns:
- builder instance
-
setRoute
Sets the destination server/domain that the client should connect to. Connection managers may be configured to enable sessions with more that one server in different domains. When requesting a session with such a "proxy" connection manager, a client should use this method to specify the server with which it wants to communicate.- Parameters:
protocol
- connection protocol (e.g, "xmpp")host
- host or domain to be served by the remote server. Note that this is not necessarily the host name or domain name of the remote server.port
- port number of the remote server- Returns:
- builder instance
-
setProxy
Specify the hostname and port of an HTTP proxy to connect through.- Parameters:
hostName
- proxy hostnameport
- proxy port number- Returns:
- builder instance
-
setSSLContext
Set the SSL context to use for this session. This can be used to configure certificate-based authentication, etc..- Parameters:
ctx
- SSL context- Returns:
- builder instance
-
setCompressionEnabled
Set whether or not compression of the underlying data stream should be attempted. By default, compression is disabled.- Parameters:
enabled
- set totrue
if compression should be attempted when possible,false
to disable compression- Returns:
- builder instance
-
build
Build the immutable object instance with the current configuration.- Returns:
- BOSHClientConfig instance
-