@Override
    public ConnectionListener getListener( ConnectionType type, boolean startInDirectTlsMode )
    {
        switch ( type )
        {
            case SOCKET_C2S:
                if (startInDirectTlsMode) {
                    return clientSslListener;
                } else {
                    return clientListener;
                }

            case BOSH_C2S:
                if (startInDirectTlsMode) {
                    return boshSslListener;
                } else {
                    return boshListener;
                }
            case SOCKET_S2S:
                if (startInDirectTlsMode) {
                    return serverSslListener;
                } else {
                    return serverListener;
                }

            case COMPONENT:
                if (startInDirectTlsMode) {
                    return componentSslListener;
                } else {
                    return componentListener;
                }

            case CONNECTION_MANAGER:
                if (startInDirectTlsMode) {
                    return connectionManagerSslListener;
                } else {
                    return connectionManagerListener;
                }

            case WEBADMIN:
                if (startInDirectTlsMode) {
                    return webAdminSslListener;
                } else {
                    return webAdminListener;
                }
            default:
                throw new IllegalStateException( "Unknown connection type: "+ type );
        }
    }
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.

@param type The connection type for which a listener is to be configured.
@param startInDirectTlsMode true when the listener to be configured is in Direct TLS mode, otherwise false.
@return The connection listener (never null).
xmppserver/src/main/java/org/jivesoftware/openfire/spi/ConnectionManagerImpl.java