public static final class XmppSessionConfiguration.Builder
extends java.lang.Object
A builder to create an XmppSessionConfiguration
instance.
Modifier and Type | Method and Description |
---|---|
XmppSessionConfiguration.Builder |
authenticationMechanisms(java.lang.String... authenticationMechanisms)
Sets the preferred mechanisms used for this XMPP session.
|
XmppSessionConfiguration |
build()
Builds the configuration.
|
XmppSessionConfiguration.Builder |
cacheDirectory(java.nio.file.Path path)
Sets the caching directory for directory-based caches used for: XEP-0084: User Avatar XEP-0115: Entity Capabilities XEP-0153: vCard-Based Avatars If you want to disable the use of directory caching, pass null.
|
XmppSessionConfiguration.Builder |
closeOnShutdown(boolean closeOnShutdown)
Indicates whether the XMPP session is closed, when the JVM is shut down.
|
XmppSessionConfiguration.Builder |
debugger(java.lang.Class<? extends XmppDebugger> xmppDebugger)
Sets the debugger.
|
XmppSessionConfiguration.Builder |
defaultResponseTimeout(java.time.Duration defaultResponseTimeout)
Sets the default response timeout for synchronous calls, usually IQ calls.
|
XmppSessionConfiguration.Builder |
extensions(Extension... extensions)
Adds extensions to the session.
|
XmppSessionConfiguration.Builder |
initialPresence(java.util.function.Supplier<Presence> presenceSupplier)
Sets a supplier for initial presence which is sent during login.
|
XmppSessionConfiguration.Builder |
language(java.util.Locale language)
Sets the preferred or default language for any human-readable XML character data to be sent over the stream.
|
XmppSessionConfiguration.Builder |
nameServer(java.lang.String nameServer)
Sets the name server used for resolving DNS SRV and TXT records during connecting.
|
XmppSessionConfiguration.Builder |
reconnectionStrategy(ReconnectionStrategy reconnectionStrategy)
Sets the reconnection strategy, which determined when to reconnect after a disconnection.
|
XmppSessionConfiguration.Builder |
threadFactory(java.util.concurrent.ThreadFactory threadFactory)
Sets a custom thread factory.
|
public final XmppSessionConfiguration.Builder debugger(java.lang.Class<? extends XmppDebugger> xmppDebugger)
Sets the debugger.
xmppDebugger
- The debugger or null, if you don’t want to use a debugger.public final XmppSessionConfiguration.Builder extensions(Extension... extensions)
Adds extensions to the session.
extensions
- The extensions.public final XmppSessionConfiguration.Builder defaultResponseTimeout(java.time.Duration defaultResponseTimeout)
Sets the default response timeout for synchronous calls, usually IQ calls.
defaultResponseTimeout
- The default response timeout.public final XmppSessionConfiguration.Builder authenticationMechanisms(java.lang.String... authenticationMechanisms)
Sets the preferred mechanisms used for this XMPP session.
Any entity that will act as a SASL client or a SASL server MUST maintain an ordered list of its preferred SASL mechanisms according to the client or server, where the list is ordered according to local policy or user configuration (which SHOULD be in order of perceived strength to enable the strongest authentication possible). The initiating entity MUST maintain its own preference order independent of the preference order of the receiving entity. A client MUST try SASL mechanisms in its preference order. For example, if the server offers the ordered list “PLAIN SCRAM-SHA-1 GSSAPI” or “SCRAM-SHA-1 GSSAPI PLAIN” but the client’s ordered list is “GSSAPI SCRAM-SHA-1”, the client MUST try GSSAPI first and then SCRAM-SHA-1 but MUST NOT try PLAIN (since PLAIN is not on its list).
authenticationMechanisms
- The preferred mechanisms.public final XmppSessionConfiguration.Builder cacheDirectory(java.nio.file.Path path)
Sets the caching directory for directory-based caches used for:
If you want to disable the use of directory caching, pass null.path
- The directory.XmppSessionConfiguration.getCacheDirectory()
public final XmppSessionConfiguration.Builder initialPresence(java.util.function.Supplier<Presence> presenceSupplier)
Sets a supplier for initial presence which is sent during login. If the supplier is null or returns null, no initial presence is sent.
presenceSupplier
- The presence supplier.public final XmppSessionConfiguration.Builder language(java.util.Locale language)
Sets the preferred or default language for any human-readable XML character data to be sent over the stream.
language
- The language.public final XmppSessionConfiguration.Builder reconnectionStrategy(ReconnectionStrategy reconnectionStrategy)
Sets the reconnection strategy, which determined when to reconnect after a disconnection.
reconnectionStrategy
- The reconnection strategy.public final XmppSessionConfiguration.Builder nameServer(java.lang.String nameServer)
Sets the name server used for resolving DNS SRV and TXT records during connecting.
For Oracle JDK, you could use one of sun.net.dns.ResolverConfiguration.open().nameservers()
.
If no name server is set, Google DNS Server (8.8.8.8) is used.
nameServer
- The name server.public final XmppSessionConfiguration.Builder threadFactory(java.util.concurrent.ThreadFactory threadFactory)
Sets a custom thread factory.
This is useful in managed environments where the thread creation should be managed by a container, e.g. javax.enterprise.concurrent.ManagedThreadFactory
threadFactory
- The thread factory.public final XmppSessionConfiguration.Builder closeOnShutdown(boolean closeOnShutdown)
Indicates whether the XMPP session is closed, when the JVM is shut down. If true
(default), a shutdown hook is added to the runtime, which will gracefully close the session on shutdown. If false
, no shutdown hook will be added to the runtime.
closeOnShutdown
- true, if a shutdown hook shall be added to the runtime.public final XmppSessionConfiguration build()
Builds the configuration.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.