Class HttpServerOptions
java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
org.refcodes.ontology.Taxonomy
org.refcodes.runtime.Settings
org.refcodes.runtime.Options
org.refcodes.rest.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
Optionsinfrastructure - type-safe convenience accessors
- support for environment variables and system properties
- diagnostic schema generation
Supported configuration properties are declared by the
HttpServerOntology.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Settings
Settings.Node, Settings.Properties, Settings.RootNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface BaseLocatorAccessor
BaseLocatorAccessor.BaseLocatorBuilder<B>, BaseLocatorAccessor.BaseLocatorMutator, BaseLocatorAccessor.BaseLocatorPropertyNested classes/interfaces inherited from interface EmptyAccessor
EmptyAccessor.EmptyBuilder<B>, EmptyAccessor.EmptyMutator, EmptyAccessor.EmptyPropertyNested classes/interfaces inherited from interface ExecutorServiceAccessor
ExecutorServiceAccessor.ExecutorServiceBuilder<B>, ExecutorServiceAccessor.ExecutorServiceMutator, ExecutorServiceAccessor.ExecutorServicePropertyNested classes/interfaces inherited from interface ImmutableTable
ImmutableTable.MutableTable<K,V> Nested classes/interfaces inherited from interface Keys
Keys.MutableKeys<K,V>, Keys.MutableValues<K, V> Nested classes/interfaces inherited from interface KeyStoreDescriptorAccessor
KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<B>, KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator, KeyStoreDescriptorAccessor.KeyStoreDescriptorPropertyNested classes/interfaces inherited from interface MaxConnectionsAccessor
MaxConnectionsAccessor.MaxConnectionsBuilder<B>, MaxConnectionsAccessor.MaxConnectionsMutator, MaxConnectionsAccessor.MaxConnectionsPropertyNested classes/interfaces inherited from interface PortAccessor
PortAccessor.PortBuilder<B>, PortAccessor.PortMutator, PortAccessor.PortPropertyNested classes/interfaces inherited from interface RealmAccessor
RealmAccessor.RealmBuilder<B>, RealmAccessor.RealmMutator, RealmAccessor.RealmPropertyNested classes/interfaces inherited from interface SchemeAccessor
SchemeAccessor.SchemeBuilder<B>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemeProperty -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default TCP port.static final SchemeThe default scheme.Fields inherited from class Taxonomy
NAMESPACE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpServerOptions.Builderbuilder()Creates a newHttpServerOptions.Builder.getBaseLocatorOr(String aBaseLocator) Retrieves the server's base locator if present, else the provided one.Returns the configured TLS/SSL keystore descriptor.intReturns the configured maximum number of concurrent open connections.intgetPort()Returns the configured TCP port.getRealm()getRealmOr(String aRealm) Retrieves the server's realm if present, else the provided one.Returns the configuredScheme.Returns the configured protocol.Methods inherited from class Settings
createResult, fromNamespace, merge, ofNamespace, removeNamespace, toSchema, toSchema, transformKeys, transformValuesMethods inherited from class Taxonomy
contains, containsNamespace, get, get, get, get, getOr, namespaces, put, put, remove, toKey, toNormalizedMethods inherited from class HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Containable
sizeMethods inherited from interface EmptyAccessor
isEmptyMethods inherited from interface ImmutableTable.MutableTable
delete, putMethods inherited from interface Keys
containsKey, containsValue, getOr, keySet, valuesMethods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
DEFAULT_SCHEME
The default scheme. -
DEFAULT_PORT
public static final int DEFAULT_PORTThe default TCP port.
-
-
Constructor Details
-
HttpServerOptions
public HttpServerOptions()Constructs an emptyHttpServerOptionsinstance.
-
-
Method Details
-
getScheme
Returns the configuredScheme.Defaults to
DEFAULT_SCHEME.- Specified by:
getSchemein interfaceSchemeAccessor- Returns:
- The configured scheme.
-
toProtocol
Returns the configured protocol.When no explicit protocol was configured, the protocol is derived from the configured
Scheme.- Specified by:
toProtocolin interfaceSchemeAccessor- Returns:
- The configured protocol.
-
getPort
public int getPort()Returns the configured TCP port.Defaults to
DEFAULT_PORT.- Specified by:
getPortin interfacePortAccessor- 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:
getMaxConnectionsin interfaceMaxConnectionsAccessor- Returns:
- The maximum number of concurrent open connections.
-
getKeyStoreDescriptor
Returns the configured TLS/SSL keystore descriptor.- Specified by:
getKeyStoreDescriptorin interfaceKeyStoreDescriptorAccessor- Returns:
- The configured keystore descriptor or
null.
-
getExecutorService
- Specified by:
getExecutorServicein interfaceExecutorServiceAccessor
-
getRealm
- Specified by:
getRealmin interfaceRealmAccessor
-
getRealmOr
-
getBaseLocator
- Specified by:
getBaseLocatorin interfaceBaseLocatorAccessor
-
getBaseLocatorOr
-
builder
Creates a newHttpServerOptions.Builder.- Returns:
- A new builder instance.
-