|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smack.ConnectionConfiguration
public class ConnectionConfiguration
Configuration to use while establishing the connection to the server. It is possible to configure the path to the trustore file that keeps the trusted CA root certificates and enable or disable all or some of the checkings done while verifying server certificates.
It is also possible to configure if TLS, SASL, and compression are used or not.
Nested Class Summary | |
---|---|
static class |
ConnectionConfiguration.SecurityMode
An enumeration for TLS security modes that are available when making a connection to the XMPP server. |
Constructor Summary | |
---|---|
ConnectionConfiguration(String serviceName)
Creates a new ConnectionConfiguration for the specified service name. |
|
ConnectionConfiguration(String host,
int port)
Creates a new ConnectionConfiguration for a connection that will connect to the desired host and port. |
|
ConnectionConfiguration(String host,
int port,
String serviceName)
Creates a new ConnectionConfiguration using the specified host, port and service name. |
Method Summary | |
---|---|
String |
getHost()
Returns the host to use when establishing the connection. |
int |
getPort()
Returns the port to use when establishing the connection. |
ConnectionConfiguration.SecurityMode |
getSecurityMode()
Returns the TLS security mode used when making the connection. |
String |
getServiceName()
Returns the server name of the target server. |
javax.net.SocketFactory |
getSocketFactory()
Returns the socket factory used to create new xmppConnection sockets. |
String |
getTruststorePassword()
Returns the password to use to access the trust store file. |
String |
getTruststorePath()
Retuns the path to the trust store file. |
String |
getTruststoreType()
Returns the trust store type, or null if it's not set. |
boolean |
isCompressionEnabled()
Returns true if the connection is going to use stream compression. |
boolean |
isDebuggerEnabled()
Returns true if the new connection about to be establish is going to be debugged. |
boolean |
isExpiredCertificatesCheckEnabled()
Returns true if certificates presented by the server are going to be checked for their validity. |
boolean |
isNotMatchingDomainCheckEnabled()
Returns true if certificates presented by the server are going to be checked for their domain. |
boolean |
isReconnectionAllowed()
Returns if the reconnection mechanism is allowed to be used. |
boolean |
isSASLAuthenticationEnabled()
Returns true if the client is going to use SASL authentication when logging into the server. |
boolean |
isSelfSignedCertificateEnabled()
Returns true if self-signed certificates are going to be accepted. |
boolean |
isVerifyChainEnabled()
Returns true if the whole chain of certificates presented by the server are going to be checked. |
boolean |
isVerifyRootCAEnabled()
Returns true if root CA checking is going to be done. |
void |
setCompressionEnabled(boolean compressionEnabled)
Sets if the connection is going to use stream compression. |
void |
setDebuggerEnabled(boolean debuggerEnabled)
Sets if the new connection about to be establish is going to be debugged. |
void |
setExpiredCertificatesCheckEnabled(boolean expiredCertificatesCheckEnabled)
Sets if certificates presented by the server are going to be checked for their validity. |
void |
setNotMatchingDomainCheckEnabled(boolean notMatchingDomainCheckEnabled)
Sets if certificates presented by the server are going to be checked for their domain. |
void |
setReconnectionAllowed(boolean isAllowed)
Sets if the reconnection mechanism is allowed to be used. |
void |
setSASLAuthenticationEnabled(boolean saslAuthenticationEnabled)
Sets whether the client will use SASL authentication when logging into the server. |
void |
setSecurityMode(ConnectionConfiguration.SecurityMode securityMode)
Sets the TLS security mode used when making the connection. |
void |
setSelfSignedCertificateEnabled(boolean selfSignedCertificateEnabled)
Sets if self-signed certificates are going to be accepted. |
void |
setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the socket factory used to create new xmppConnection sockets. |
void |
setTruststorePassword(String truststorePassword)
Sets the password to use to access the trust store file. |
void |
setTruststorePath(String truststorePath)
Sets the path to the trust store file. |
void |
setTruststoreType(String truststoreType)
Sets the trust store type. |
void |
setVerifyChainEnabled(boolean verifyChainEnabled)
Sets if the whole chain of certificates presented by the server are going to be checked. |
void |
setVerifyRootCAEnabled(boolean verifyRootCAEnabled)
Sets if root CA checking is going to be done. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionConfiguration(String serviceName)
serviceName
- the name of the service provided by an XMPP server.public ConnectionConfiguration(String host, int port, String serviceName)
ConnectionConfiguration(String)
constructor. For example, say that an XMPP server is running at localhost
in an internal network on port 5222 but is configured to think that it's
"example.com" for testing purposes. This constructor is necessary to connect
to the server in that case since a DNS SRV lookup for example.com would not
point to the local testing server.
host
- the host where the XMPP server is running.port
- the port where the XMPP is listening.serviceName
- the name of the service provided by an XMPP server.public ConnectionConfiguration(String host, int port)
host
- the host where the XMPP server is running.port
- the port where the XMPP is listening.Method Detail |
---|
public String getServiceName()
public String getHost()
service name
.
public int getPort()
public ConnectionConfiguration.SecurityMode getSecurityMode()
ConnectionConfiguration.SecurityMode.enabled
.
public void setSecurityMode(ConnectionConfiguration.SecurityMode securityMode)
ConnectionConfiguration.SecurityMode.enabled
.
securityMode
- the security mode.public String getTruststorePath()
public void setTruststorePath(String truststorePath)
truststorePath
- the path to the truststore file.public String getTruststoreType()
public void setTruststoreType(String truststoreType)
truststoreType
- the trust store type.public String getTruststorePassword()
public void setTruststorePassword(String truststorePassword)
truststorePassword
- the password to use to access the truststore file.public boolean isVerifyChainEnabled()
public void setVerifyChainEnabled(boolean verifyChainEnabled)
verifyChainEnabled
- if the whole chaing of certificates presented by the server
are going to be checked.public boolean isVerifyRootCAEnabled()
public void setVerifyRootCAEnabled(boolean verifyRootCAEnabled)
verifyRootCAEnabled
- if root CA checking is going to be done.public boolean isSelfSignedCertificateEnabled()
public void setSelfSignedCertificateEnabled(boolean selfSignedCertificateEnabled)
selfSignedCertificateEnabled
- if self-signed certificates are going to be accepted.public boolean isExpiredCertificatesCheckEnabled()
public void setExpiredCertificatesCheckEnabled(boolean expiredCertificatesCheckEnabled)
expiredCertificatesCheckEnabled
- if certificates presented by the server are going
to be checked for their validity.public boolean isNotMatchingDomainCheckEnabled()
public void setNotMatchingDomainCheckEnabled(boolean notMatchingDomainCheckEnabled)
notMatchingDomainCheckEnabled
- if certificates presented by the server are going
to be checked for their domain.public boolean isCompressionEnabled()
public void setCompressionEnabled(boolean compressionEnabled)
compressionEnabled
- if the connection is going to use stream compression.public boolean isSASLAuthenticationEnabled()
public void setSASLAuthenticationEnabled(boolean saslAuthenticationEnabled)
saslAuthenticationEnabled
- if the client is going to use SASL authentication when
logging into the server.public boolean isDebuggerEnabled()
XMPPConnection.DEBUG_ENABLED
is used.
public void setDebuggerEnabled(boolean debuggerEnabled)
XMPPConnection.DEBUG_ENABLED
is used.
debuggerEnabled
- if the new connection about to be establish is going to be debugged.public void setReconnectionAllowed(boolean isAllowed)
isAllowed
- if the reconnection mechanism is allowed to use.public boolean isReconnectionAllowed()
public void setSocketFactory(javax.net.SocketFactory socketFactory)
socketFactory
- used to create new sockets.public javax.net.SocketFactory getSocketFactory()
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |