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 StringCAPACITY_FILTER_NAMEstatic StringCOMPRESSION_FILTER_NAMEstatic StringEXECUTOR_FILTER_NAMEstatic StringSTARTTLS_FILTER_NAMEstatic StringTLS_FILTER_NAMEstatic StringXMPP_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 Modifier and Type Method Description voidenable(ConnectionType type, boolean startInSslMode, boolean enabled)Enables or disables a connection listener.InetAddressgetAdminConsoleListenAddress()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.InetAddressgetListenAddress()Returns the specific network interface on which Openfire is configured to listen, or null when no such preference has been configured.ConnectionListenergetListener(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.intgetPort(ConnectionType type, boolean startInSslMode)Retrieves the configured TCP port on which a listener accepts connections.org.apache.mina.transport.socket.nio.NioSocketAcceptorgetSocketAcceptor(ConnectionType type, boolean startInSslMode)voidinitialize(XMPPServer server)Initializes the basic module.booleanisEnabled(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).voidpropertyDeleted(String property, Map<String,Object> params)A property was deleted.voidpropertySet(String property, Map<String,Object> params)A property was set.voidsetPort(ConnectionType type, boolean startInSslMode, int port)Sets the TCP port on which a listener accepts connections.voidstart()Starts the basic module.voidstop()Stops the basic module.voidstoreContentChanged(CertificateStore store)Event triggered when the content of a certificate store was changed.voidxmlPropertyDeleted(String property, Map<String,Object> params)An XML property was deleted.voidxmlPropertySet(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
-
STARTTLS_FILTER_NAME
public static final String STARTTLS_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 IOExceptionInstantiates 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.- Specified by:
getListenersin interfaceConnectionManager- 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.- Specified by:
getListenerin interfaceConnectionManager- 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.- Specified by:
getListenersin interfaceConnectionManager- 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.- Specified by:
isEnabledin interfaceConnectionManager- 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.- Specified by:
enablein interfaceConnectionManager- 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.- Specified by:
getPortin interfaceConnectionManager- 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.- Specified by:
setPortin interfaceConnectionManager- 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:CertificateEventListenerEvent triggered when the content of a certificate store was changed.- Specified by:
storeContentChangedin 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:PropertyEventListenerA property was set. The parameter mapparamswill contain the the value of the property under the keyvalue.- Specified by:
propertySetin 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:PropertyEventListenerA property was deleted.- Specified by:
propertyDeletedin 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:PropertyEventListenerAn XML property was set. The parameter mapparamswill contain the the value of the property under the keyvalue.- Specified by:
xmlPropertySetin 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:PropertyEventListenerAn XML property was deleted.- Specified by:
xmlPropertyDeletedin interfacePropertyEventListener- Parameters:
property- the name of the property.params- event parameters.
-
initialize
public void initialize(XMPPServer server)
Description copied from class:BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initializein interfaceModule- Overrides:
initializein classBasicModule- Parameters:
server- the server hosting this module.
-
start
public void start()
Description copied from class:BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
- Specified by:
startin interfaceModule- Overrides:
startin classBasicModule
-
stop
public void stop()
Description copied from class:BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
- Specified by:
stopin interfaceModule- Overrides:
stopin classBasicModule
-
-