Class HttpServerOptionsUtils

java.lang.Object
io.quarkus.vertx.http.runtime.options.HttpServerOptionsUtils

public class HttpServerOptionsUtils extends Object
  • Field Details

    • RANDOM_PORT_MAIN_HTTP

      public static final int RANDOM_PORT_MAIN_HTTP
      When the http port is set to 0, replace it by this value to let Vert.x choose a random port
      See Also:
    • RANDOM_PORT_MAIN_TLS

      public static final int RANDOM_PORT_MAIN_TLS
      When the https port is set to 0, replace it by this value to let Vert.x choose a random port
      See Also:
    • RANDOM_PORT_MANAGEMENT

      public static final int RANDOM_PORT_MANAGEMENT
      When the management port is set to 0, replace it by this value to let Vert.x choose a random port
      See Also:
  • Constructor Details

    • HttpServerOptionsUtils

      public HttpServerOptionsUtils()
  • Method Details

    • createSslServerConfig

      public static HttpServerOptionsUtils.ServerConfig createSslServerConfig(VertxHttpBuildTimeConfig httpBuildTimeConfig, VertxHttpConfig httpConfig, io.quarkus.runtime.LaunchMode launchMode, List<String> websocketSubProtocols, io.quarkus.tls.TlsConfigurationRegistry registry) throws IOException
      Create an HttpServerConfig and ServerSSLOptions for the HTTPS server, or null if SSL should not be enabled.
      Throws:
      IOException
    • createSslServerConfigForManagementInterface

      public static HttpServerOptionsUtils.ServerConfig createSslServerConfigForManagementInterface(ManagementInterfaceBuildTimeConfig managementBuildTimeConfig, ManagementConfig managementConfig, io.quarkus.runtime.LaunchMode launchMode, List<String> websocketSubProtocols, io.quarkus.tls.TlsConfigurationRegistry registry) throws IOException
      Create an HttpServerConfig and ServerSSLOptions for the management HTTPS server, or null if SSL should not be enabled.
      Throws:
      IOException
    • createServerSslOptions

      public static io.vertx.core.net.ServerSSLOptions createServerSslOptions(io.quarkus.tls.TlsConfiguration bucket, io.vertx.core.http.ClientAuth clientAuth)
      Create ServerSSLOptions for a server from a TLS registry configuration and client authentication setting.
    • createHttpServerConfig

      public static io.vertx.core.http.HttpServerConfig createHttpServerConfig(VertxHttpBuildTimeConfig buildTimeConfig, VertxHttpConfig httpConfig, io.quarkus.runtime.LaunchMode launchMode, List<String> websocketSubProtocols)
      Create an HttpServerConfig for the plain HTTP server.
    • createHttpServerConfigForManagementInterface

      public static io.vertx.core.http.HttpServerConfig createHttpServerConfigForManagementInterface(ManagementInterfaceBuildTimeConfig buildTimeConfig, ManagementConfig httpConfig, io.quarkus.runtime.LaunchMode launchMode, List<String> websocketSubProtocols)
      Create an HttpServerConfig for the management plain HTTP server.
    • createDomainSocketConfig

      public static io.vertx.core.http.HttpServerConfig createDomainSocketConfig(VertxHttpBuildTimeConfig buildTimeConfig, VertxHttpConfig httpConfig, List<String> websocketSubProtocols)
      Create an HttpServerConfig for a domain socket server, or null if not enabled.
    • createDomainSocketConfigForManagementInterface

      public static io.vertx.core.http.HttpServerConfig createDomainSocketConfigForManagementInterface(ManagementInterfaceBuildTimeConfig buildTimeConfig, ManagementConfig managementConfig, List<String> websocketSubProtocols)
      Create an HttpServerConfig for a management domain socket server, or null if not enabled.
    • applyCommonOptions

      public static void applyCommonOptions(io.vertx.core.http.HttpServerConfig config, VertxHttpBuildTimeConfig httpBuildTimeConfig, VertxHttpConfig httpConfig, List<String> websocketSubProtocols, String host, ProxyConfig.ProxyProtocolListener listener)
      Apply common HTTP server options to an HttpServerConfig.
      Parameters:
      listener - the listener the config is for; the PROXY protocol is enabled on it only when quarkus.http.proxy.proxy-protocol-listeners contains it
    • warnIfProxyProtocolIsNotUsed

      public static void warnIfProxyProtocolIsNotUsed(String configRoot, ProxyConfig proxyConfig, Set<ProxyConfig.ProxyProtocolListener> startedListeners)
      Warn when the PROXY protocol is enabled but none of the listeners it is expected on is started.
      Parameters:
      configRoot - quarkus.http or quarkus.management
    • applyCommonOptionsForManagementInterface

      public static void applyCommonOptionsForManagementInterface(io.vertx.core.http.HttpServerConfig config, ManagementInterfaceBuildTimeConfig managementBuildTimeConfig, ManagementConfig managementConfig, List<String> websocketSubProtocols, ProxyConfig.ProxyProtocolListener listener)
      Apply common management interface options to an HttpServerConfig.
    • getCredential

      public static Optional<String> getCredential(Optional<String> password, Map<String,String> credentials, Optional<String> passwordKey)
    • getInsecureRequestStrategy

      public static VertxHttpConfig.InsecureRequests getInsecureRequestStrategy(VertxHttpConfig httpConfig, VertxHttpBuildTimeConfig httpBuildConfig, io.quarkus.runtime.LaunchMode launchMode)
    • getFileContent

      static byte[] getFileContent(Path path) throws IOException
      Throws:
      IOException
    • or

      static <T> Optional<T> or(Optional<T> a, Optional<T> b)