Package com.jsgalactic.axiom.application
Class ManagementOptions
java.lang.Object
com.jsgalactic.axiom.application.ManagementOptions
Opt-in settings for a separate management listener, passed to
Application.management(ManagementOptions). Nothing is bound until the application's first Application.listen(java.net.InetSocketAddress), and an application without these settings keeps
a single listener.
The listener serves only health probes and a metrics scrape. It never runs application routes, middleware or user handlers. The defaults bind the loopback address, refuse a wildcard bind, use plain HTTP and bound both request bodies and response text. HTTPS can reuse the application listener's certificate or use one configured only for management. Instances are immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCollects settings beforeManagementOptions.Builder.build(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringLoopback host used when none is set.static final intLargest request body the management listener accepts.static final intMostHealthinstances a management listener uses.static final intLargest response body the management listener produces.static final StringPath of the metrics scrape. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ManagementOptions.Builderbuilder()Starts a builder with the default host, an ephemeral port and bounded diagnostics.host()intintstatic ManagementOptionsof(int port) Options for a loopback listener on the given port with every other setting at its default.intport()booleantls()Returns an explicit certificate for the management listener, when one was set.Starts a builder holding these options' values.toString()Describes the options without claiming a bound address.
-
Field Details
-
DEFAULT_HOST
Loopback host used when none is set.- See Also:
-
METRICS_PATH
Path of the metrics scrape.- See Also:
-
MAX_BODY_BYTES
public static final int MAX_BODY_BYTESLargest request body the management listener accepts.- See Also:
-
MAX_RESPONSE_BYTES
public static final int MAX_RESPONSE_BYTESLargest response body the management listener produces.- See Also:
-
MAX_HEALTH
public static final int MAX_HEALTHMostHealthinstances a management listener uses.- See Also:
-
-
Method Details
-
of
Options for a loopback listener on the given port with every other setting at its default.- Parameters:
port- port, or zero for an allocated port- Returns:
- the options
- Throws:
IllegalArgumentException- if the port is out of range
-
builder
Starts a builder with the default host, an ephemeral port and bounded diagnostics.- Returns:
- a new builder
-
toBuilder
Starts a builder holding these options' values.- Returns:
- a new builder
-
host
- Returns:
- host name or address to bind, "127.0.0.1" by default
-
port
public int port()- Returns:
- port to bind, or zero for an allocated port
-
tls
public boolean tls()- Returns:
- whether the listener reuses the first application listener's TLS material
-
tlsOptions
Returns an explicit certificate for the management listener, when one was set. It replaces the application listener's material even whentls()is also set.- Returns:
- the management listener's own TLS settings, or empty to reuse the application's
-
allowWildcardBind
public boolean allowWildcardBind()- Returns:
- whether a wildcard bind address is accepted
-
maxRequestBody
public int maxRequestBody()- Returns:
- largest accepted request body in bytes
-
maxResponseBytes
public int maxResponseBytes()- Returns:
- largest produced response body in bytes
-
toString
Describes the options without claiming a bound address.
-