Class ConnectionManagerImpl

    • 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.
      • getListener

        public ConnectionListener getListener​(ConnectionType type,
                                              boolean startInDirectTlsMode)
        Returns a connection listener. The #startInSslMode parameter is used to distinguish between listeners that expect to receive TLS 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:
        getListener in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        startInDirectTlsMode - true when the listener to be configured is in Direct TLS 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:
        getListeners in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        Returns:
        The connection listener (never null).
      • getConnectionAcceptor

        public ConnectionAcceptor getConnectionAcceptor​(ConnectionType type,
                                                        boolean directTLS)
        Returns the connection acceptor for a particular connection type and configuration.
        Parameters:
        type - The connection type for which to return the acceptor
        directTLS - DirectTLS or StartTLS selector
        Returns:
        The connection acceptor for the provided arguments.
      • isEnabled

        public boolean isEnabled​(ConnectionType type,
                                 boolean startInDirectTlsMode)
        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 TLS 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:
        isEnabled in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        startInDirectTlsMode - true when the listener to be configured is in Direct TLS mode, otherwise false.
        Returns:
        true if configuration allows this listener to be enabled, otherwise false.
      • enable

        public void enable​(ConnectionType type,
                           boolean startInDirectTlsMode,
                           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 TLS 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:
        enable in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        startInDirectTlsMode - true when the listener to be configured is in Direct TLS mode, otherwise false.
        enabled - true if the listener is to be enabled, otherwise false.
      • getPort

        public int getPort​(ConnectionType type,
                           boolean startInDirectTlsMode)
        Retrieves the configured TCP port on which a listener accepts connections.
        Specified by:
        getPort in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        startInDirectTlsMode - true when the listener to be configured is in DirectTLS mode, otherwise false.
        Returns:
        a port number.
      • setPort

        public void setPort​(ConnectionType type,
                            boolean startInDirectTlsMode,
                            int port)
        Sets the TCP port on which a listener accepts connections.
        Specified by:
        setPort in interface ConnectionManager
        Parameters:
        type - The connection type for which a listener is to be configured.
        startInDirectTlsMode - true when the listener to be configured is in Direct TLS mode, otherwise false.
        port - a port number.
      • propertySet

        public void propertySet​(String property,
                                Map<String,​Object> params)
        Description copied from interface: PropertyEventListener
        A property was set. The parameter map params will contain the the value of the property under the key value.
        Specified by:
        propertySet in interface PropertyEventListener
        Parameters:
        property - the name of the property.
        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 map params will contain the the value of the property under the key value.
        Specified by:
        xmlPropertySet in interface PropertyEventListener
        Parameters:
        property - the name of the property.
        params - event parameters.
      • 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 interface Module
        Overrides:
        start in class BasicModule
      • 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 interface Module
        Overrides:
        stop in class BasicModule