Package rocks.xmpp.core.net.client
Class ClientConnectionConfiguration
- java.lang.Object
-
- rocks.xmpp.core.net.client.ClientConnectionConfiguration
-
- All Implemented Interfaces:
ConnectionConfiguration
- Direct Known Subclasses:
BoshConnectionConfiguration
,NettyTcpConnectionConfiguration
,SocketConnectionConfiguration
,TcpConnectionConfiguration
,WebSocketConnectionConfiguration
public abstract class ClientConnectionConfiguration extends Object implements ConnectionConfiguration
A base class for connection configurations.All connection methods have a few properties in common, which are abstracted in this class. Among these common properties are hostname, port, proxy, security settings and a timeout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientConnectionConfiguration.Builder<T extends ClientConnectionConfiguration.Builder<T,C>,C extends ClientConnectionConfiguration>
An abstract builder class for building immutable configuration objects.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract CompletableFuture<Connection>
createConnection(XmppSession xmppSession, SessionOpen sessionOpen)
A factory method to create the connection.ChannelEncryption
getChannelEncryption()
Gets the channel encryption mode used for the connection, which indicates, if and how the connection is to be secured.List<CompressionMethod>
getCompressionMethods()
Gets the compression methods.int
getConnectTimeout()
Gets the timeout for connection establishment.String
getHostname()
Gets the hostname.HostnameVerifier
getHostnameVerifier()
Gets the hostname verifier.int
getPort()
Gets the port.Proxy
getProxy()
Gets the proxy.SSLContext
getSSLContext()
Gets the SSL context.String
toString()
-
-
-
Method Detail
-
createConnection
public abstract CompletableFuture<Connection> createConnection(XmppSession xmppSession, SessionOpen sessionOpen)
A factory method to create the connection.- Parameters:
xmppSession
- The XMPP session, which is associated with the connection.sessionOpen
- The session open element.- Returns:
- The connection.
-
getHostname
public final String getHostname()
Gets the hostname.- Returns:
- The hostname.
-
getPort
public final int getPort()
Gets the port.- Returns:
- The port.
-
getProxy
public final Proxy getProxy()
Gets the proxy.- Returns:
- The proxy.
-
getChannelEncryption
public final ChannelEncryption getChannelEncryption()
Description copied from interface:ConnectionConfiguration
Gets the channel encryption mode used for the connection, which indicates, if and how the connection is to be secured.- Specified by:
getChannelEncryption
in interfaceConnectionConfiguration
- Returns:
- The channel encryption mode.
-
getSSLContext
public final SSLContext getSSLContext()
Gets the SSL context.- Specified by:
getSSLContext
in interfaceConnectionConfiguration
- Returns:
- The SSL context.
-
getHostnameVerifier
public final HostnameVerifier getHostnameVerifier()
Gets the hostname verifier.- Returns:
- The hostname verifier.
-
getConnectTimeout
public final int getConnectTimeout()
Gets the timeout for connection establishment.- Returns:
- The timeout.
-
getCompressionMethods
public final List<CompressionMethod> getCompressionMethods()
Gets the compression methods.- Returns:
- The compression methods.
-
-