Interface ConnectionManager

All Known Implementing Classes:
ConnectionManagerImpl

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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The default XMPP port for external components.
    static final int
    The XMPP port for external components using SSL traffic.
    static final int
    The default XMPP port for connection multiplex.
    static final int
    The default XMPP port for connection multiplex.
    static final int
    The default XMPP port for clients.
    static final int
    The default XMPP port for server2server communication, optionally using StartTLS.
    static final int
    The default XMPP port for server2server communication using Direct TLS.
    static final int
    The default Jabber port for Direct TLS traffic.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    enable(ConnectionType type, boolean startInDirectTlsMode, boolean enabled)
    Enables or disables a connection listener.
    getListener(ConnectionType type, boolean startInDirectTlsMode)
    Returns a connection listener.
    Returns all connection listeners.
    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 Details

    • 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:
    • 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:
    • DEFAULT_COMPONENT_PORT

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

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

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

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

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

      static final int DEFAULT_MULTIPLEX_SSL_PORT
      The default XMPP port for connection multiplex.
      See Also:
  • Method Details

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