Class ServerConfig

  • Direct Known Subclasses:
    ServiceConfigProperties

    public class ServerConfig
    extends AbstractConfig
    Configuration of properties that are common for components accepting requests/connections on a network socket.
    • Constructor Detail

      • ServerConfig

        public ServerConfig()
    • Method Detail

      • getBindAddress

        public final String getBindAddress()
        Gets the host name or literal IP address of the network interface that this server's secure port is configured to be bound to.
        Returns:
        The host name.
      • setBindAddress

        public final void setBindAddress​(String address)
        Sets the host name or literal IP address of the network interface that this server's secure port should be bound to.

        The default value of this property is Constants.LOOPBACK_DEVICE_ADDRESS on IPv4 stacks.

        Parameters:
        address - The host name or IP address.
        Throws:
        NullPointerException - if host is null.
      • getPort

        public final int getPort()
        Gets the secure port this server is configured to listen on.
        Returns:
        The port number.
      • getPort

        public final int getPort​(int defaultPort)
        Gets the secure port this server is configured to listen on.
        Parameters:
        defaultPort - The port to use if this property has not been set explicitly.
        Returns:
        The configured port number or the defaultPort if port is not set.
        See Also:
        for more information.
      • setPort

        public final void setPort​(int port)
        Sets the secure port that this server should listen on.

        If the port is set to 0 (the default value), then this server will bind to an arbitrary free port chosen by the operating system during startup.

        Parameters:
        port - The port number.
        Throws:
        IllegalArgumentException - if port < 0 or port > 65535.
      • isSecurePortEnabled

        public boolean isSecurePortEnabled()
        Checks if this service has been configured to bind to the secure port during startup.

        Subclasses may override this method in order to do more sophisticated checks.

        Returns:
        true if config contains a valid key and certificate.
      • isNativeTlsRequired

        public final boolean isNativeTlsRequired()
        Checks if this server requires the usage of a native TLS implementation. Native TLS implementations offer in general a better performance but may not be available on all platforms. If true, the server will require the usage of a native TLS implementation. Server will not start if native implementation is not available on the current system. If false, the adapter will try to use a native TLS implementation. If no native implementation is available the default Java platform independent TLS implementation will be used.

        The default value of this property is false.

        Returns:
        true if the server requires native TLS implementation.
      • setNativeTlsRequired

        public final void setNativeTlsRequired​(boolean nativeTlsRequired)
        Sets if this server should require the usage of a native TLS implementation. Native TLS implementations offer in general a better performance but may not be available on all platforms. If true, the server will require the usage of a native TLS implementation. Server will not start if native implementation is not available on the current system. If false, the adapter will try to use a native TLS implementation. If no native implementation is available the default Java platform independent TLS implementation will be used.

        The default value of this property is false.

        Parameters:
        nativeTlsRequired - true if the server requires the usage of a native TLS implementation.
      • isInsecurePortEnabled

        public final boolean isInsecurePortEnabled()
        Checks if this server is configured to listen on an insecure port (i.e. without TLS) at all. If false, it is guaranteed by the server that no opened port is insecure. If true, it enables the definition of an insecure port (as the only port or additionally to the secure port).
        Returns:
        false if the server guarantees that no opened port is insecure.
      • setInsecurePortEnabled

        public final void setInsecurePortEnabled​(boolean insecurePortEnabled)
        Sets if this server should support insecure AMQP 1.0 ports (i.e. without TLS) at all. If false, it is guaranteed by the server that no opened port is insecure. If true, it enables the definition of an insecure port (as the only port or additionally to the secure port).
        Parameters:
        insecurePortEnabled - false if the server shall guarantee that no opened port is insecure.
      • getInsecurePortBindAddress

        public final String getInsecurePortBindAddress()
        Gets the host name or literal IP address of the network interface that this server's insecure port is configured to be bound to.
        Returns:
        The host name.
      • setInsecurePortBindAddress

        public final void setInsecurePortBindAddress​(String address)
        Sets the host name or literal IP address of the network interface that this server's insecure port should be bound to.

        The default value of this property is Constants.LOOPBACK_DEVICE_ADDRESS on IPv4 stacks.

        Parameters:
        address - The host name or IP address.
        Throws:
        NullPointerException - if address is null.
      • getInsecurePort

        public final int getInsecurePort()
        Gets the insecure port this server is configured to listen on.
        Returns:
        The port number.
      • getInsecurePort

        public final int getInsecurePort​(int defaultPort)
        Gets the insecure port this server is configured to listen on.
        Parameters:
        defaultPort - The port to use if this property has not been set explicitly.
        Returns:
        The configured port number or the defaultPort if insecurePort is not set.
        See Also:
        for more information.
      • setInsecurePort

        public final void setInsecurePort​(int port)
        Sets the insecure port that this server should listen on.

        If the port is set to 0 (the default value), then this server will bind to an arbitrary free port chosen by the operating system during startup.

        Setting this property also sets the insecurePortEnabled property to true.

        Parameters:
        port - The port number.
        Throws:
        IllegalArgumentException - if port < 0 or port > 65535.
      • setSni

        public final void setSni​(boolean sni)
        Sets whether the server should support Server Name Indication for TLS connections.
        Parameters:
        sni - true if the server should support SNI.
      • isSni

        public final boolean isSni()
        Checks if the server supports Server Name Indication for TLS connections.
        Returns:
        true if the server supports SNI.