public final class XmppSessionConfiguration
extends java.lang.Object
A configuration for an XmppSession
.
Most importantly it allows you to introduce custom extensions to your XmppSession
, simply by passing your JAXB annotated classes to the builder of this class and then use this configuration for the session.
Use the builder()
to create instances of this class:
XmppSessionConfiguration configuration = XmppSessionConfiguration.builder()
.extensions(Extension.of(MyClass1.class), Extension.of(MyClass2.class))
.debugger(ConsoleDebugger.class)
.build();
This class is immutable.
Modifier and Type | Class and Description |
---|---|
static class |
XmppSessionConfiguration.Builder
A builder to create an
XmppSessionConfiguration instance. |
Modifier and Type | Method and Description |
---|---|
static XmppSessionConfiguration.Builder |
builder()
Creates a builder for this class.
|
java.util.List<java.lang.String> |
getAuthenticationMechanisms()
Gets the preferred authentication (SASL) mechanisms.
|
java.nio.file.Path |
getCacheDirectory()
Gets the caching directory for directory-based caches used for: XEP-0084: User Avatar XEP-0115: Entity Capabilities XEP-0153: vCard-Based Avatars By default this directory is called
xmpp.rocks and is located in the operating system’s application data folder:For Windows it is %APPDATA% , which usually is C:\Users{USERNAME}\AppData\Roaming For Mac it is ~/Library/Application Support Else it is the user’s home directory. |
java.lang.Class<? extends XmppDebugger> |
getDebugger()
Gets the current debugger for this session.
|
static XmppSessionConfiguration |
getDefault()
Gets the default configuration.
|
java.time.Duration |
getDefaultResponseTimeout()
Gets the response timeout.
|
java.util.function.Supplier<Presence> |
getInitialPresence()
Gets a supplier for initial presence which is sent during login.
|
java.util.Locale |
getLanguage()
Gets the preferred or default language for any human-readable XML character data to be sent over the stream.
|
java.lang.String |
getNameServer()
Gets the name server used for resolving DNS SRV and TXT records during connecting.
|
ReconnectionStrategy |
getReconnectionStrategy()
Gets the reconnection strategy.
|
java.util.concurrent.ThreadFactory |
getThreadFactory(java.lang.String name)
Gets the thread factory for the session.
|
javax.xml.stream.XMLInputFactory |
getXmlInputFactory()
Gets the XML input factory.
|
javax.xml.stream.XMLOutputFactory |
getXmlOutputFactory()
Gets the XML output factory.
|
boolean |
isCloseOnShutdown()
Indicates, if the session is gracefully closed on shutdown of the runtime (JVM).
|
static void |
setDefault(XmppSessionConfiguration configuration)
Sets the default configuration.
|
public static XmppSessionConfiguration getDefault()
Gets the default configuration.
public static void setDefault(XmppSessionConfiguration configuration)
Sets the default configuration.
configuration
- The default configuration.public static XmppSessionConfiguration.Builder builder()
Creates a builder for this class.
public final java.lang.Class<? extends XmppDebugger> getDebugger()
Gets the current debugger for this session. If no debugger was set, the default debugger is the ConsoleDebugger
.
public final java.time.Duration getDefaultResponseTimeout()
Gets the response timeout.
public final java.util.List<java.lang.String> getAuthenticationMechanisms()
Gets the preferred authentication (SASL) mechanisms.
XmppSessionConfiguration.Builder.authenticationMechanisms(String...)
public final java.nio.file.Path getCacheDirectory()
Gets the caching directory for directory-based caches used for:
By default this directory is calledxmpp.rocks
and is located in the operating system’s application data folder: For Windows it is %APPDATA%
, which usually is C:\Users{USERNAME}\AppData\Roaming
For Mac it is ~/Library/Application Support
Else it is the user’s home directory.
public final java.util.function.Supplier<Presence> getInitialPresence()
Gets a supplier for initial presence which is sent during login.
public final java.util.Locale getLanguage()
Gets the preferred or default language for any human-readable XML character data to be sent over the stream.
public final ReconnectionStrategy getReconnectionStrategy()
Gets the reconnection strategy.
public final java.lang.String getNameServer()
Gets the name server used for resolving DNS SRV and TXT records during connecting.
public final java.util.concurrent.ThreadFactory getThreadFactory(java.lang.String name)
Gets the thread factory for the session.
name
- The default thread name.public final boolean isCloseOnShutdown()
Indicates, if the session is gracefully closed on shutdown of the runtime (JVM).
public final javax.xml.stream.XMLInputFactory getXmlInputFactory()
Gets the XML input factory.
public final javax.xml.stream.XMLOutputFactory getXmlOutputFactory()
Gets the XML output factory.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.