Interface ConnectionManager

  • All Known Implementing Classes:
    ConnectionManagerImpl

    public interface ConnectionManager
    Coordinates connections (accept, read, termination) on the server.
    Author:
    Iain Shigeoka
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void enable​(ConnectionType type, boolean startInDirectTlsMode, boolean enabled)
      Enables or disables a connection listener.
      ConnectionListener getListener​(ConnectionType type, boolean startInDirectTlsMode)
      Returns a connection listener.
      Set<ConnectionListener> getListeners()
      Returns all connection listeners.
      Set<ConnectionListener> getListeners​(ConnectionType type)
      Returns al connection listeners for the provided type.
      int getPort​(ConnectionType type, boolean startInDirectTlsMode)
      Retrieves the configured TCP port on which a listener accepts connections.
      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).
      void setPort​(ConnectionType type, boolean startInDirectTlsMode, int port)
      Sets the TCP port on which a listener accepts connections.
    • Field Detail

      • DEFAULT_PORT

        static final int DEFAULT_PORT
        The default XMPP port for clients. This port can be used with encrypted and unencrypted connections. Clients will initially connect using an unencrypted connection and may encrypt it by using StartTLS.
        See Also:
        Constant Field Values
      • DEFAULT_SSL_PORT

        static final int DEFAULT_SSL_PORT
        The default Jabber port for Direct TLS traffic. This method uses connections that are encrypted as soon as they are created.
        See Also:
        Constant Field Values
      • DEFAULT_COMPONENT_PORT

        static final int DEFAULT_COMPONENT_PORT
        The default XMPP port for external components.
        See Also:
        Constant Field Values
      • DEFAULT_COMPONENT_SSL_PORT

        static final int DEFAULT_COMPONENT_SSL_PORT
        The XMPP port for external components using SSL traffic.
        See Also:
        Constant Field Values
      • DEFAULT_SERVER_PORT

        static final int DEFAULT_SERVER_PORT
        The default XMPP port for server2server communication, optionally using StartTLS.
        See Also:
        Constant Field Values
      • DEFAULT_SERVER_SSL_PORT

        static final int DEFAULT_SERVER_SSL_PORT
        The default XMPP port for server2server communication using Direct TLS.
        See Also:
        Constant Field Values
      • DEFAULT_MULTIPLEX_PORT

        static final int DEFAULT_MULTIPLEX_PORT
        The default XMPP port for connection multiplex.
        See Also:
        Constant Field Values
      • DEFAULT_MULTIPLEX_SSL_PORT

        static final int DEFAULT_MULTIPLEX_SSL_PORT
        The default XMPP port for connection multiplex.
        See Also:
        Constant Field Values
    • Method Detail

      • isEnabled

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

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

        int getPort​(ConnectionType type,
                    boolean startInDirectTlsMode)
        Retrieves the configured TCP port on which a listener accepts connections.
        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:
        a port number.
      • setPort

        void setPort​(ConnectionType type,
                     boolean startInDirectTlsMode,
                     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.
        startInDirectTlsMode - true when the listener to be configured is in Direct TLS mode, otherwise false.
        port - a port number.
      • getListeners

        Set<ConnectionListener> getListeners()
        Returns all connection listeners.
        Returns:
        All connection listeners (never null).
      • getListeners

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

        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.
        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).