public class ConnectionListener extends Object
Constructor and Description |
---|
ConnectionListener(ConnectionType type,
String tcpPortPropertyName,
int defaultPort,
String isEnabledPropertyName,
String maxPoolSizePropertyName,
String maxReadBufferPropertyName,
String tlsPolicyPropertyName,
String clientAuthPolicyPropertyName,
InetAddress bindAddress,
CertificateStoreConfiguration identityStoreConfiguration,
CertificateStoreConfiguration trustStoreConfiguration,
String compressionPolicyPropertyName)
Instantiates a new connection listener.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptSelfSignedCertificates()
A boolean that indicates if self-signed peer certificates can be used to establish an encrypted connection.
|
void |
enable(boolean enable)
Activates or deactivates the listener, and changes the configuration accordingly.
|
ConnectionConfiguration |
generateConnectionConfiguration()
Generates an immutable ConnectionConfiguration based on the current state.
|
InetAddress |
getBindAddress()
Returns the network address on which connections are accepted when this listener is enabled.
|
Connection.ClientAuth |
getClientAuth() |
Connection.CompressionPolicy |
getCompressionPolicy()
Returns whether compression is optional or disabled for new connections.
|
Set<String> |
getEncryptionCipherSuites()
A collection of cipher suite names that can be used for encryption of connections.
|
protected String |
getEncryptionCipherSuitesCommaSeparated() |
Set<String> |
getEncryptionProtocols()
A collection of protocol names that can be used for encryption of connections.
|
protected String |
getEncryptionProtocolsCommaSeparated() |
CertificateStoreConfiguration |
getIdentityStoreConfiguration()
Returns the configuration for the identity store that identifies this instance of Openfire to the peer
on connections created by this listener.
|
int |
getPort()
The TCP port number on which connections will be accepted when this listener is enabled.
|
ServerPort |
getServerPort()
Deprecated.
To obtain the state of this instance, use corresponding getters instead.
|
org.apache.mina.transport.socket.nio.NioSocketAcceptor |
getSocketAcceptor()
Returns the MINA-specific socket acceptor that is managed by the instance.
|
Connection.TLSPolicy |
getTLSPolicy()
Returns whether TLS is mandatory, optional, disabled or mandatory immediately for new connections.
|
CertificateStoreConfiguration |
getTrustStoreConfiguration()
Returns the configuration for the trust store that is used to identify/trust peers on connections created by this
listener.
|
ConnectionType |
getType()
Returns the type of connection that is accepted by this listener.
|
boolean |
isEnabled()
Return if the configuration allows this listener to be enabled (but does not verify that the listener is
indeed active).
|
void |
restart()
Starts or restarts this instance (typically used to put into effect a configuration change).
|
void |
setAcceptSelfSignedCertificates(boolean accept)
Configuresif self-signed peer certificates can be used to establish an encrypted connection.
|
void |
setClientAuth(Connection.ClientAuth clientAuth) |
void |
setCompressionPolicy(Connection.CompressionPolicy policy)
Sets whether compression is optional or disabled for new connections.
|
void |
setEncryptionCipherSuites(Set<String> cipherSuites)
Defines the collection of cipher suite (by name) that can be used for encryption of connections.
|
void |
setEncryptionCipherSuites(String[] cipherSuites)
Defines the collection of cipher suite (by name) that can be used for encryption of connections.
|
void |
setEncryptionProtocols(Set<String> protocols)
Defines the collection of protocols (by name) that can be used for encryption of connections.
|
void |
setEncryptionProtocols(String[] protocols)
Defines the collection of protocols (by name) that can be used for encryption of connections.
|
void |
setIdentityStoreConfiguration(CertificateStoreConfiguration configuration)
Replaces the configuration for the identity store that identifies this instance of Openfire to the peer
on connections created by this listener.
|
void |
setPort(int port)
Changes the TCP port on which connections are accepted, This configuration change is persisted.
|
void |
setTLSPolicy(Connection.TLSPolicy policy)
Sets whether TLS is mandatory, optional, disabled or mandatory immediately for new connections.
|
void |
setTrustStoreConfiguration(CertificateStoreConfiguration configuration)
Replaces the configuration for the trust store that is used to identify/trust peers on connections created by
this listener.
|
void |
setVerifyCertificateValidity(boolean verify)
Configures if the current validity of certificates (based on their 'notBefore' and 'notAfter' property values) is
used when they are used to establish an encrypted connection..
|
void |
start()
Attempts to start the connection acceptor, creating a new instance when needed.
|
protected void |
stop()
Attempts to stop the connection acceptor.
|
String |
toString() |
boolean |
verifyCertificateValidity()
A boolean that indicates if the current validity of certificates (based on their 'notBefore' and 'notAfter'
property values) is used when they are used to establish an encrypted connection..
|
public ConnectionListener(ConnectionType type, String tcpPortPropertyName, int defaultPort, String isEnabledPropertyName, String maxPoolSizePropertyName, String maxReadBufferPropertyName, String tlsPolicyPropertyName, String clientAuthPolicyPropertyName, InetAddress bindAddress, CertificateStoreConfiguration identityStoreConfiguration, CertificateStoreConfiguration trustStoreConfiguration, String compressionPolicyPropertyName)
isEnabledPropertyName
- Property name (of a boolean) that toggles availability. Null to indicate that this listener is 'always on'maxPoolSizePropertyName
- Property name (of an int) that defines maximum IO processing threads. Null causes an unconfigurable default amount to be used.maxReadBufferPropertyName
- Property name (of an int) that defines maximum amount (in bytes) of IO data can be cached, pending processing. Null to indicate boundless caches.tlsPolicyPropertyName
- Property name (of a string) that defines the applicable TLS Policy. Or, the value Connection.TLSPolicy
to indicate unconfigurable TLS Policy. Cannot be null.clientAuthPolicyPropertyName
- Property name (of an string) that defines maximum IO processing threads. Null causes a unconfigurabel value of 'wanted' to be used.public boolean isEnabled()
public void enable(boolean enable)
public void start()
restart()
should be
used to explicitly define the need to stop a previous connection). The current implementation of this method will
stop a pre-existing acceptor, but only when it is currently not serving connections. When the acceptor is not
idle, this method has no effect. This behavior might change in the future.public ConnectionConfiguration generateConnectionConfiguration()
protected void stop()
public void restart()
public org.apache.mina.transport.socket.nio.NioSocketAcceptor getSocketAcceptor()
public InetAddress getBindAddress()
public ConnectionType getType()
public int getPort()
public void setPort(int port)
port
- A port number.public Connection.ClientAuth getClientAuth()
public void setClientAuth(Connection.ClientAuth clientAuth)
public Connection.TLSPolicy getTLSPolicy()
public void setTLSPolicy(Connection.TLSPolicy policy)
policy
- an encryption policy (not null).public Connection.CompressionPolicy getCompressionPolicy()
public void setCompressionPolicy(Connection.CompressionPolicy policy)
policy
- a compression policy (not null).public CertificateStoreConfiguration getIdentityStoreConfiguration()
public void setIdentityStoreConfiguration(CertificateStoreConfiguration configuration)
configuration
- The identity store configuration (not null)public CertificateStoreConfiguration getTrustStoreConfiguration()
public void setTrustStoreConfiguration(CertificateStoreConfiguration configuration)
configuration
- The configuration of the identity store (not null)public boolean acceptSelfSignedCertificates()
public void setAcceptSelfSignedCertificates(boolean accept)
accept
- true when self-signed certificates are accepted, otherwise false.public boolean verifyCertificateValidity()
public void setVerifyCertificateValidity(boolean verify)
verify
- true when certificates are required to be valid to establish a secured connection, otherwise false.public Set<String> getEncryptionProtocols()
protected String getEncryptionProtocolsCommaSeparated()
public void setEncryptionProtocols(Set<String> protocols)
protocols
- An (ordered) set of protocol names, can be null.public void setEncryptionProtocols(String[] protocols)
protocols
- An array of protocol names, can be null.public Set<String> getEncryptionCipherSuites()
protected String getEncryptionCipherSuitesCommaSeparated()
public void setEncryptionCipherSuites(Set<String> cipherSuites)
cipherSuites
- An (ordered) set of cipher suite names, can be null.public void setEncryptionCipherSuites(String[] cipherSuites)
cipherSuites
- An array of cipher suite names, can be null.@Deprecated public ServerPort getServerPort()
Copyright © 2003-2008 Jive Software.