public abstract class ConnectionConfiguration
extends java.lang.Object
ConnectionConfiguration.Builder.setXmppAddressAndPassword(CharSequence, String).
Technically there are typically at least two parameters required: Some kind of credentials for authentication. And the XMPP service domain. The credentials often consists of a username and password use for the SASL authentication. But there are also other authentication mechanisms, like client side certificates, which do not require a particular username and password.
There are some misconceptions about XMPP client-to-server parameters: The first is that the username used for authentication will be equal to the localpart of the bound XMPP address after authentication. While this is usually true, it is not required. Technically the username used for authentication and the resulting XMPP address are completely independent from each other. The second common misconception steers from the terms "XMPP host" and "XMPP service domain": An XMPP service host is a system which hosts one or multiple XMPP domains. The "XMPP service domain" will be usually the domainpart of the bound JID. This domain is used to verify the remote endpoint, typically using TLS. This third misconception is that the XMPP service domain is required to become the domainpart of the bound JID. Again, while this is very common to be true, it is not strictly required.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConnectionConfiguration.Builder<B extends ConnectionConfiguration.Builder<B,C>,C extends ConnectionConfiguration>
A builder for XMPP connection configurations.
|
static class |
ConnectionConfiguration.DnssecMode
Determines the requested DNSSEC security mode.
|
static class |
ConnectionConfiguration.SecurityMode
An enumeration for TLS security modes that are available when making a connection
to the XMPP server.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowNullOrEmptyUsername |
protected org.minidns.dnsname.DnsName |
host |
protected java.net.InetAddress |
hostAddress |
protected UInt16 |
port |
protected ProxyInfo |
proxy |
protected org.jxmpp.jid.DomainBareJid |
xmppServiceDomain
The XMPP domain of the XMPP Service.
|
protected org.minidns.dnsname.DnsName |
xmppServiceDomainDnsName |
| Modifier | Constructor and Description |
|---|---|
protected |
ConnectionConfiguration(ConnectionConfiguration.Builder<?,?> builder) |
| Modifier and Type | Method and Description |
|---|---|
org.jxmpp.jid.EntityBareJid |
getAuthzid()
Returns the optional XMPP address to be requested as the SASL authorization identity.
|
javax.security.auth.callback.CallbackHandler |
getCallbackHandler()
Returns a CallbackHandler to obtain information, such as the password or
principal information during the SASL authentication.
|
SmackDebuggerFactory |
getDebuggerFactory()
Returns the Smack debugger factory.
|
ConnectionConfiguration.DnssecMode |
getDnssecMode() |
java.util.Set<java.lang.String> |
getEnabledSaslMechanisms()
Return the explicitly enabled SASL mechanisms.
|
java.lang.String[] |
getEnabledSSLCiphers()
Return the enabled SSL/TLS ciphers.
|
java.lang.String[] |
getEnabledSSLProtocols()
Return the enabled SSL/TLS protocols.
|
org.minidns.dnsname.DnsName |
getHost() |
java.net.InetAddress |
getHostAddress() |
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Returns the configured HostnameVerifier of this ConnectionConfiguration or the Smack default
HostnameVerifier configured with
SmackConfiguration.setDefaultHostnameVerifier(HostnameVerifier). |
java.lang.String |
getHostString() |
java.util.Locale |
getLanguage()
Returns the stream language to use when connecting to the server.
|
java.lang.String |
getPassword()
Returns the password to use when trying to reconnect to the server.
|
UInt16 |
getPort() |
ProxyInfo |
getProxyInfo()
Get the configured proxy information (if any).
|
org.jxmpp.jid.parts.Resourcepart |
getResource()
Returns the resource to use when trying to reconnect to the server.
|
ConnectionConfiguration.SecurityMode |
getSecurityMode()
Returns the TLS security mode used when making the connection.
|
org.jxmpp.jid.DomainBareJid |
getServiceName()
Deprecated.
use
getXMPPServiceDomain() instead. |
javax.net.SocketFactory |
getSocketFactory()
Returns the socket factory used to create new xmppConnection sockets.
|
java.lang.CharSequence |
getUsername()
Returns the username to use when trying to reconnect to the server.
|
java.lang.String |
getXmlLang()
Returns the xml:lang string of the stream language to use when connecting to the server.
|
org.jxmpp.jid.DomainBareJid |
getXMPPServiceDomain()
Returns the XMPP domain used by this configuration.
|
org.minidns.dnsname.DnsName |
getXmppServiceDomainAsDnsNameIfPossible()
Returns the XMPP service domain as DNS name if possible.
|
boolean |
isCompressionEnabled()
Returns true if the connection is going to use stream compression.
|
boolean |
isEnabledSaslMechanism(java.lang.String saslMechanism)
Check if the given SASL mechansism is enabled in this connection configuration.
|
boolean |
isSendPresence()
Returns true if an available presence should be sent when logging in while reconnecting.
|
protected final org.jxmpp.jid.DomainBareJid xmppServiceDomain
protected final org.minidns.dnsname.DnsName xmppServiceDomainDnsName
protected final java.net.InetAddress hostAddress
protected final org.minidns.dnsname.DnsName host
protected final UInt16 port
protected final ProxyInfo proxy
protected final boolean allowNullOrEmptyUsername
protected ConnectionConfiguration(ConnectionConfiguration.Builder<?,?> builder)
public java.lang.String getHostString()
public org.minidns.dnsname.DnsName getHost()
public java.net.InetAddress getHostAddress()
public UInt16 getPort()
@Deprecated public org.jxmpp.jid.DomainBareJid getServiceName()
getXMPPServiceDomain() instead.public org.jxmpp.jid.DomainBareJid getXMPPServiceDomain()
public org.minidns.dnsname.DnsName getXmppServiceDomainAsDnsNameIfPossible()
null.null.public ConnectionConfiguration.SecurityMode getSecurityMode()
ConnectionConfiguration.SecurityMode.required.public ConnectionConfiguration.DnssecMode getDnssecMode()
public java.lang.String[] getEnabledSSLProtocols()
public java.lang.String[] getEnabledSSLCiphers()
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
SmackConfiguration.setDefaultHostnameVerifier(HostnameVerifier).nullpublic SmackDebuggerFactory getDebuggerFactory()
nullpublic javax.security.auth.callback.CallbackHandler getCallbackHandler()
public javax.net.SocketFactory getSocketFactory()
public ProxyInfo getProxyInfo()
null.public java.lang.CharSequence getUsername()
public java.lang.String getPassword()
public org.jxmpp.jid.parts.Resourcepart getResource()
public java.util.Locale getLanguage()
public java.lang.String getXmlLang()
If the developer sets the language to null, this will also return null, leading to the removal of the xml:lang tag from the stream. If a Locale("") is configured, this will return "", which can be used as an override.
public org.jxmpp.jid.EntityBareJid getAuthzid()
public boolean isSendPresence()
public boolean isCompressionEnabled()
public boolean isEnabledSaslMechanism(java.lang.String saslMechanism)
saslMechanism - TODO javadoc me pleasepublic java.util.Set<java.lang.String> getEnabledSaslMechanisms()
null if no SASL mechanisms where
explicitly enabled, i.e. all SALS mechanisms supported and announced by the service will be considered.null.