Class HttpServerOptions

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, ExecutorServiceAccessor, MaxConnectionsAccessor, Clearable, EmptyAccessor, PortAccessor, Ontology, Diagnosable, Schemable<DiagnosticOptions>, KeyStoreDescriptorAccessor, Containable, ImmutableTable<String,Object>, ImmutableTable.MutableTable<String,Object>, Keys<String,Object>, Keys.MutableKeys<String,Object>, Keys.MutableValues<String,Object>, BaseLocatorAccessor, HttpServerContext, RealmAccessor, SchemeAccessor

public class HttpServerOptions extends Options implements HttpServerContext, ExecutorServiceAccessor
Typed Options implementation describing the configuration of an HTTP server.

The HttpServerOptions class combines:

  • the semantic contract of HttpServerContext
  • the flexibility of the Options infrastructure
  • type-safe convenience accessors
  • support for environment variables and system properties
  • diagnostic schema generation

Supported configuration properties are declared by the HttpServerOntology.

See Also:
  • Field Details

    • DEFAULT_SCHEME

      public static final Scheme DEFAULT_SCHEME
      The default scheme.
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      The default TCP port.
  • Constructor Details

    • HttpServerOptions

      public HttpServerOptions()
      Constructs an empty HttpServerOptions instance.
  • Method Details

    • getScheme

      public Scheme getScheme()
      Returns the configured Scheme.

      Defaults to DEFAULT_SCHEME.

      Specified by:
      getScheme in interface SchemeAccessor
      Returns:
      The configured scheme.
    • toProtocol

      public String toProtocol()
      Returns the configured protocol.

      When no explicit protocol was configured, the protocol is derived from the configured Scheme.

      Specified by:
      toProtocol in interface SchemeAccessor
      Returns:
      The configured protocol.
    • getPort

      public int getPort()
      Returns the configured TCP port.

      Defaults to DEFAULT_PORT.

      Specified by:
      getPort in interface PortAccessor
      Returns:
      The configured TCP port.
    • getMaxConnections

      public int getMaxConnections()
      Returns the configured maximum number of concurrent open connections.

      A negative value indicates no explicit limit.

      Specified by:
      getMaxConnections in interface MaxConnectionsAccessor
      Returns:
      The maximum number of concurrent open connections.
    • getKeyStoreDescriptor

      public KeyStoreDescriptor getKeyStoreDescriptor()
      Returns the configured TLS/SSL keystore descriptor.
      Specified by:
      getKeyStoreDescriptor in interface KeyStoreDescriptorAccessor
      Returns:
      The configured keystore descriptor or null.
    • getExecutorService

      public ExecutorService getExecutorService()
      Specified by:
      getExecutorService in interface ExecutorServiceAccessor
    • getRealm

      public String getRealm()
      Specified by:
      getRealm in interface RealmAccessor
    • getRealmOr

      public String getRealmOr(String aRealm)
      Retrieves the server's realm if present, else the provided one.
      Parameters:
      aRealm - The realm to use in case none was found.
      Returns:
      The according realm
    • getBaseLocator

      public String getBaseLocator()
      Specified by:
      getBaseLocator in interface BaseLocatorAccessor
    • getBaseLocatorOr

      public String getBaseLocatorOr(String aBaseLocator)
      Retrieves the server's base locator if present, else the provided one.
      Parameters:
      aBaseLocator - The base locator to use in case none was found.
      Returns:
      The according realm
    • builder

      public static HttpServerOptions.Builder builder()
      Returns:
      A new builder instance.