Package org.jivesoftware.openfire.spi
Class ConnectionManagerImpl
- java.lang.Object
-
- org.jivesoftware.openfire.container.BasicModule
-
- org.jivesoftware.openfire.spi.ConnectionManagerImpl
-
- All Implemented Interfaces:
ConnectionManager
,Module
,CertificateEventListener
,PropertyEventListener
public class ConnectionManagerImpl extends BasicModule implements ConnectionManager, CertificateEventListener, PropertyEventListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
CAPACITY_FILTER_NAME
static String
COMPRESSION_FILTER_NAME
static String
EXECUTOR_FILTER_NAME
static String
TLS_FILTER_NAME
static String
XMPP_CODEC_FILTER_NAME
-
Fields inherited from interface org.jivesoftware.openfire.ConnectionManager
DEFAULT_COMPONENT_PORT, DEFAULT_COMPONENT_SSL_PORT, DEFAULT_MULTIPLEX_PORT, DEFAULT_MULTIPLEX_SSL_PORT, DEFAULT_PORT, DEFAULT_SERVER_PORT, DEFAULT_SERVER_SSL_PORT, DEFAULT_SSL_PORT
-
-
Constructor Summary
Constructors Constructor Description ConnectionManagerImpl()
Instantiates a new connection manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
enable(ConnectionType type, boolean startInSslMode, boolean enabled)
Enables or disables a connection listener.void
enableClientListener(boolean enabled)
Deprecated.void
enableClientSSLListener(boolean enabled)
Deprecated.void
enableComponentListener(boolean enabled)
Deprecated.void
enableComponentSslListener(boolean enabled)
Deprecated.void
enableConnectionManagerListener(boolean enabled)
Deprecated.void
enableConnectionManagerSslListener(boolean enabled)
Deprecated.void
enableServerListener(boolean enabled)
Deprecated.void
enableServerSslListener(boolean enabled)
Deprecated.InetAddress
getAdminConsoleListenAddress()
Returns the specific network interface on which the Openfire administration console should be configured to listen, or null when no such preference has been configured.int
getClientListenerPort()
Deprecated.int
getClientSSLListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getComponentAcceptor()
Deprecated.int
getComponentListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getComponentSslAcceptor()
Deprecated.int
getComponentSslListenerPort()
Deprecated.int
getConnectionManagerListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getConnectionManagerSocketAcceptor()
Deprecated.int
getConnectionManagerSslListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getConnectionManagerSslSocketAcceptor()
Deprecated.InetAddress
getListenAddress()
Returns the specific network interface on which Openfire is configured to listen, or null when no such preference has been configured.ConnectionListener
getListener(ConnectionType type, boolean startInSslMode)
Returns a connection listener.Set<ConnectionListener>
getListeners()
Returns all connection listeners.Set<ConnectionListener>
getListeners(ConnectionType type)
Returns al connection listeners for the provided type.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getMultiplexerSocketAcceptor()
Deprecated.Replaced by #getConnectionManagerSocketAcceptorint
getPort(ConnectionType type, boolean startInSslMode)
Retrieves the configured TCP port on which a listener accepts connections.Collection<ServerPort>
getPorts()
Deprecated.use #getListenersint
getServerListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getServerListenerSocketAcceptor()
Deprecated.int
getServerSslListenerPort()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getServerSslListenerSocketAcceptor()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getSocketAcceptor()
Deprecated.org.apache.mina.transport.socket.nio.NioSocketAcceptor
getSocketAcceptor(ConnectionType type, boolean startInSslMode)
org.apache.mina.transport.socket.nio.NioSocketAcceptor
getSSLSocketAcceptor()
Deprecated.void
initialize(XMPPServer server)
Initializes the basic module.boolean
isClientListenerEnabled()
Deprecated.boolean
isClientSSLListenerEnabled()
Deprecated.boolean
isComponentListenerEnabled()
Deprecated.boolean
isComponentSslListenerEnabled()
Deprecated.boolean
isConnectionManagerListenerEnabled()
Deprecated.boolean
isConnectionManagerSslListenerEnabled()
Deprecated.boolean
isEnabled(ConnectionType type, boolean startInSslMode)
Return if the configuration allows this listener to be enabled (but does not verify that the listener is indeed active) The #startInSslMode parameter is used to distinguish between listeners that expect to receive SSL encrypted data immediately, as opposed to connections that initially accept plain text data (the latter are typically subject to StartTLS for in-band encryption configuration).boolean
isServerListenerEnabled()
Deprecated.boolean
isServerSslListenerEnabled()
Deprecated.void
propertyDeleted(String property, Map<String,Object> params)
A property was deleted.void
propertySet(String property, Map<String,Object> params)
A property was set.void
setClientListenerPort(int port)
Deprecated.void
setClientSSLListenerPort(int port)
Deprecated.void
setComponentListenerPort(int port)
Deprecated.void
setComponentSslListenerPort(int port)
Deprecated.void
setConnectionManagerListenerPort(int port)
Deprecated.void
setConnectionManagerSslListenerPort(int port)
Deprecated.void
setPort(ConnectionType type, boolean startInSslMode, int port)
Sets the TCP port on which a listener accepts connections.void
setServerListenerPort(int port)
Deprecated.void
setServerSslListenerPort(int port)
Deprecated.void
start()
Starts the basic module.void
stop()
Stops the basic module.void
storeContentChanged(CertificateStore store)
Event triggered when the content of a certificate store was changed.void
xmlPropertyDeleted(String property, Map<String,Object> params)
An XML property was deleted.void
xmlPropertySet(String property, Map<String,Object> params)
An XML property was set.-
Methods inherited from class org.jivesoftware.openfire.container.BasicModule
destroy, getName
-
-
-
-
Field Detail
-
EXECUTOR_FILTER_NAME
public static final String EXECUTOR_FILTER_NAME
- See Also:
- Constant Field Values
-
TLS_FILTER_NAME
public static final String TLS_FILTER_NAME
- See Also:
- Constant Field Values
-
COMPRESSION_FILTER_NAME
public static final String COMPRESSION_FILTER_NAME
- See Also:
- Constant Field Values
-
XMPP_CODEC_FILTER_NAME
public static final String XMPP_CODEC_FILTER_NAME
- See Also:
- Constant Field Values
-
CAPACITY_FILTER_NAME
public static final String CAPACITY_FILTER_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionManagerImpl
public ConnectionManagerImpl() throws IOException
Instantiates a new connection manager.- Throws:
IOException
- if the identity or trust stores could not be loaded
-
-
Method Detail
-
getListenAddress
public InetAddress getListenAddress() throws UnknownHostException
Returns the specific network interface on which Openfire is configured to listen, or null when no such preference has been configured.- Returns:
- A network interface or null.
- Throws:
UnknownHostException
- When the configured network name cannot be resolved.
-
getAdminConsoleListenAddress
public InetAddress getAdminConsoleListenAddress() throws UnknownHostException
Returns the specific network interface on which the Openfire administration console should be configured to listen, or null when no such preference has been configured.- Returns:
- A network interface or null.
- Throws:
UnknownHostException
- When the configured network name cannot be resolved.
-
getListeners
public Set<ConnectionListener> getListeners()
Returns all connection listeners.- Returns:
- All connection listeners (never null).
-
getListener
public ConnectionListener getListener(ConnectionType type, boolean startInSslMode)
Returns a connection listener. The #startInSslMode parameter is used to distinguish between listeners that expect to receive SSL encrypted data immediately, as opposed to connections that initially accept plain text data (the latter are typically subject to StartTLS for in-band encryption configuration). When for a particular connection type only one of these options is implemented, the parameter value is ignored.- Parameters:
type
- The connection type for which a listener is to be configured.startInSslMode
- true when the listener to be configured is in legacy SSL mode, otherwise false.- Returns:
- The connection listener (never null).
-
getListeners
public Set<ConnectionListener> getListeners(ConnectionType type)
Returns al connection listeners for the provided type.- Parameters:
type
- The connection type for which a listener is to be configured.- Returns:
- The connection listener (never null).
-
isEnabled
public boolean isEnabled(ConnectionType type, boolean startInSslMode)
Return if the configuration allows this listener to be enabled (but does not verify that the listener is indeed active) The #startInSslMode parameter is used to distinguish between listeners that expect to receive SSL encrypted data immediately, as opposed to connections that initially accept plain text data (the latter are typically subject to StartTLS for in-band encryption configuration). When for a particular connection type only one of these options is implemented, the parameter value is ignored.- Parameters:
type
- The connection type for which a listener is to be configured.startInSslMode
- true when the listener to be configured is in legacy SSL mode, otherwise false.- Returns:
- true if configuration allows this listener to be enabled, otherwise false.
-
enable
public void enable(ConnectionType type, boolean startInSslMode, boolean enabled)
Enables or disables a connection listener. Does nothing if the particular listener is already in the requested state. The #startInSslMode parameter is used to distinguish between listeners that expect to receive SSL encrypted data immediately, as opposed to connections that initially accept plain text data (the latter are typically subject to StartTLS for in-band encryption configuration). When for a particular connection type only one of these options is implemented, the parameter value is ignored.- Parameters:
type
- The connection type for which a listener is to be configured.startInSslMode
- true when the listener to be configured is in legacy SSL mode, otherwise false.enabled
- true if the listener is to be enabled, otherwise false.
-
getPort
public int getPort(ConnectionType type, boolean startInSslMode)
Retrieves the configured TCP port on which a listener accepts connections.- Parameters:
type
- The connection type for which a listener is to be configured.startInSslMode
- true when the listener to be configured is in legacy SSL mode, otherwise false.- Returns:
- a port number.
-
setPort
public void setPort(ConnectionType type, boolean startInSslMode, int port)
Sets the TCP port on which a listener accepts connections.- Parameters:
type
- The connection type for which a listener is to be configured.startInSslMode
- true when the listener to be configured is in legacy SSL mode, otherwise false.port
- a port number.
-
getSocketAcceptor
public org.apache.mina.transport.socket.nio.NioSocketAcceptor getSocketAcceptor(ConnectionType type, boolean startInSslMode)
-
storeContentChanged
public void storeContentChanged(CertificateStore store)
Description copied from interface:CertificateEventListener
Event triggered when the content of a certificate store was changed.- Specified by:
storeContentChanged
in interfaceCertificateEventListener
- Parameters:
store
- The store for which the content was changed.
-
propertySet
public void propertySet(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListener
A property was set. The parameter mapparams
will contain the the value of the property under the keyvalue
.- Specified by:
propertySet
in interfacePropertyEventListener
- Parameters:
property
- the name of the property.params
- event parameters.
-
propertyDeleted
public void propertyDeleted(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListener
A property was deleted.- Specified by:
propertyDeleted
in interfacePropertyEventListener
- Parameters:
property
- the name of the property deleted.params
- event parameters.
-
xmlPropertySet
public void xmlPropertySet(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListener
An XML property was set. The parameter mapparams
will contain the the value of the property under the keyvalue
.- Specified by:
xmlPropertySet
in interfacePropertyEventListener
- Parameters:
property
- the name of the property.params
- event parameters.
-
xmlPropertyDeleted
public void xmlPropertyDeleted(String property, Map<String,Object> params)
Description copied from interface:PropertyEventListener
An XML property was deleted.- Specified by:
xmlPropertyDeleted
in interfacePropertyEventListener
- Parameters:
property
- the name of the property.params
- event parameters.
-
initialize
public void initialize(XMPPServer server)
Description copied from class:BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initialize
in interfaceModule
- Overrides:
initialize
in classBasicModule
- Parameters:
server
- the server hosting this module.
-
start
public void start()
Description copied from class:BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
- Specified by:
start
in interfaceModule
- Overrides:
start
in classBasicModule
-
stop
public void stop()
Description copied from class:BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
- Specified by:
stop
in interfaceModule
- Overrides:
stop
in classBasicModule
-
enableClientListener
@Deprecated public void enableClientListener(boolean enabled)
Deprecated.Description copied from interface:ConnectionManager
Sets if the port listener for unsecured clients will be available or not. When disabled there won't be a port listener active. Therefore, new clients won't be able to connect to the server.- Specified by:
enableClientListener
in interfaceConnectionManager
- Parameters:
enabled
- true if new unsecured clients will be able to connect to the server.
-
isClientListenerEnabled
@Deprecated public boolean isClientListenerEnabled()
Deprecated.Description copied from interface:ConnectionManager
Returns true if the port listener for unsecured clients is available. When disabled there won't be a port listener active. Therefore, new clients won't be able to connect to the server.- Specified by:
isClientListenerEnabled
in interfaceConnectionManager
- Returns:
- true if the port listener for unsecured clients is available.
-
getSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getSocketAcceptor()
Deprecated.
-
setClientListenerPort
@Deprecated public void setClientListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for unsecured clients. Default port: 5222.- Specified by:
setClientListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for unsecured clients.
-
getClientListenerPort
@Deprecated public int getClientListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for unsecured clients. Default port: 5222.- Specified by:
getClientListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for unsecured clients.
-
enableClientSSLListener
@Deprecated public void enableClientSSLListener(boolean enabled)
Deprecated.Description copied from interface:ConnectionManager
Sets if the port listener for secured clients will be available or not. When disabled there won't be a port listener active. Therefore, new secured clients won't be able to connect to the server.- Specified by:
enableClientSSLListener
in interfaceConnectionManager
- Parameters:
enabled
- true if new secured clients will be able to connect to the server.
-
isClientSSLListenerEnabled
@Deprecated public boolean isClientSSLListenerEnabled()
Deprecated.Description copied from interface:ConnectionManager
Returns true if the port listener for secured clients is available. When disabled there won't be a port listener active. Therefore, new secured clients won't be able to connect to the server.- Specified by:
isClientSSLListenerEnabled
in interfaceConnectionManager
- Returns:
- true if the port listener for unsecured clients is available.
-
getSSLSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getSSLSocketAcceptor()
Deprecated.
-
setClientSSLListenerPort
@Deprecated public void setClientSSLListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for secured clients. Default port: 5223.- Specified by:
setClientSSLListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for secured clients.
-
getClientSSLListenerPort
@Deprecated public int getClientSSLListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for secured clients. Default port: 5223.- Specified by:
getClientSSLListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for secured clients.
-
enableComponentListener
@Deprecated public void enableComponentListener(boolean enabled)
Deprecated.Description copied from interface:ConnectionManager
Sets if the port listener for external components will be available or not. When disabled there won't be a port listener active. Therefore, new external components won't be able to connect to the server.- Specified by:
enableComponentListener
in interfaceConnectionManager
- Parameters:
enabled
- true if new external components will be able to connect to the server.
-
isComponentListenerEnabled
@Deprecated public boolean isComponentListenerEnabled()
Deprecated.Description copied from interface:ConnectionManager
Returns true if the port listener for external components is available. When disabled there won't be a port listener active. Therefore, new external components won't be able to connect to the server.- Specified by:
isComponentListenerEnabled
in interfaceConnectionManager
- Returns:
- true if the port listener for external components is available.
-
getComponentAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getComponentAcceptor()
Deprecated.
-
setComponentListenerPort
@Deprecated public void setComponentListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for external components.- Specified by:
setComponentListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for external components.
-
getComponentListenerPort
@Deprecated public int getComponentListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for external components.- Specified by:
getComponentListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for external components.
-
enableComponentSslListener
@Deprecated public void enableComponentSslListener(boolean enabled)
Deprecated.
-
isComponentSslListenerEnabled
@Deprecated public boolean isComponentSslListenerEnabled()
Deprecated.
-
getComponentSslAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getComponentSslAcceptor()
Deprecated.
-
setComponentSslListenerPort
@Deprecated public void setComponentSslListenerPort(int port)
Deprecated.
-
getComponentSslListenerPort
@Deprecated public int getComponentSslListenerPort()
Deprecated.
-
enableServerListener
@Deprecated public void enableServerListener(boolean enabled)
Deprecated.Description copied from interface:ConnectionManager
Sets if the port listener for remote servers will be available or not. When disabled there won't be a port listener active. Therefore, new remote servers won't be able to connect to the server.- Specified by:
enableServerListener
in interfaceConnectionManager
- Parameters:
enabled
- true if new remote servers will be able to connect to the server.
-
isServerListenerEnabled
@Deprecated public boolean isServerListenerEnabled()
Deprecated.Description copied from interface:ConnectionManager
Returns true if the port listener for remote servers is available. When disabled there won't be a port listener active. Therefore, new remote servers won't be able to connect to the server.- Specified by:
isServerListenerEnabled
in interfaceConnectionManager
- Returns:
- true if the port listener for remote servers is available.
-
getServerListenerSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getServerListenerSocketAcceptor()
Deprecated.
-
setServerListenerPort
@Deprecated public void setServerListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for remote servers. This port is used for remote servers to connect to this server. Default port: 5269.- Specified by:
setServerListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for remote servers.
-
getServerListenerPort
@Deprecated public int getServerListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for remote servers. This port is used for remote servers to connect to this server. Default port: 5269.- Specified by:
getServerListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for remote servers.
-
enableServerSslListener
@Deprecated public void enableServerSslListener(boolean enabled)
Deprecated.
-
isServerSslListenerEnabled
@Deprecated public boolean isServerSslListenerEnabled()
Deprecated.
-
getServerSslListenerSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getServerSslListenerSocketAcceptor()
Deprecated.
-
setServerSslListenerPort
@Deprecated public void setServerSslListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for remote servers. This port is used for remote servers to connect to this server, using direct TLS. Default port: 5270.- Specified by:
setServerSslListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for remote servers.
-
getServerSslListenerPort
@Deprecated public int getServerSslListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for remote servers. This port is used for remote servers to connect to this server, using direct TLS. Default port: 5270.- Specified by:
getServerSslListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for remote servers.
-
enableConnectionManagerListener
@Deprecated public void enableConnectionManagerListener(boolean enabled)
Deprecated.Description copied from interface:ConnectionManager
Sets if the port listener for connection managers will be available or not. When disabled there won't be a port listener active. Therefore, clients will need to connect directly to the server.- Specified by:
enableConnectionManagerListener
in interfaceConnectionManager
- Parameters:
enabled
- true if new connection managers will be able to connect to the server.
-
isConnectionManagerListenerEnabled
@Deprecated public boolean isConnectionManagerListenerEnabled()
Deprecated.Description copied from interface:ConnectionManager
Returns true if the port listener for connection managers is available. When disabled there won't be a port listener active. Therefore, clients will need to connect directly to the server.- Specified by:
isConnectionManagerListenerEnabled
in interfaceConnectionManager
- Returns:
- true if the port listener for connection managers is available.
-
getMultiplexerSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getMultiplexerSocketAcceptor()
Deprecated.Replaced by #getConnectionManagerSocketAcceptor- Returns:
- the socket acceptor
-
getConnectionManagerSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getConnectionManagerSocketAcceptor()
Deprecated.
-
setConnectionManagerListenerPort
@Deprecated public void setConnectionManagerListenerPort(int port)
Deprecated.Description copied from interface:ConnectionManager
Sets the port to use for connection managers. This port is used for connection managers to connect to this server. Default port: 5262.- Specified by:
setConnectionManagerListenerPort
in interfaceConnectionManager
- Parameters:
port
- the port to use for connection managers.
-
getConnectionManagerListenerPort
@Deprecated public int getConnectionManagerListenerPort()
Deprecated.Description copied from interface:ConnectionManager
Returns the port to use for remote servers. This port is used for connection managers to connect to this server. Default port: 5262.- Specified by:
getConnectionManagerListenerPort
in interfaceConnectionManager
- Returns:
- the port to use for connection managers.
-
enableConnectionManagerSslListener
@Deprecated public void enableConnectionManagerSslListener(boolean enabled)
Deprecated.
-
isConnectionManagerSslListenerEnabled
@Deprecated public boolean isConnectionManagerSslListenerEnabled()
Deprecated.
-
getConnectionManagerSslSocketAcceptor
@Deprecated public org.apache.mina.transport.socket.nio.NioSocketAcceptor getConnectionManagerSslSocketAcceptor()
Deprecated.
-
setConnectionManagerSslListenerPort
@Deprecated public void setConnectionManagerSslListenerPort(int port)
Deprecated.
-
getConnectionManagerSslListenerPort
@Deprecated public int getConnectionManagerSslListenerPort()
Deprecated.
-
getPorts
@Deprecated public Collection<ServerPort> getPorts()
Deprecated.use #getListenersDescription copied from interface:ConnectionManager
Returns an array of the ports managed by this connection manager.- Specified by:
getPorts
in interfaceConnectionManager
- Returns:
- an iterator of the ports managed by this connection manager (can be an empty but never null).
-
-