Interface AltSvcConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<AltSvc>
All Known Implementing Classes:
AltSvcConfig.BuilderBase.AltSvcConfigImpl

public interface AltSvcConfig extends Prototype.Api
Configuration of a single advertised alternative service.
See Also:
  • Method Details

    • builder

      static AltSvcConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static AltSvcConfig.Builder builder(AltSvcConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static AltSvcConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static AltSvcConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • enabled

      boolean enabled()
      Whether the alternative service should be advertised.
      Returns:
      whether advertisement is enabled
    • protocol

      String protocol()
      Advertised protocol name. Each Java character in the range U+0000 through U+00FF maps one-to-one to an opaque protocol identifier byte. When advertisement is enabled, the identifier must contain between 1 and 255 bytes, inclusive. Whitespace-only identifiers are valid.
      Returns:
      advertised protocol
    • port

      Optional<Integer> port()
      Advertised port. The port must be between 1 and 65535, inclusive, when advertisement is enabled. If not configured, the local port of a port-capable binding is used. A binding without a valid port, such as a Unix domain socket binding, does not emit the configured advertisement unless an explicit port is configured.
      Returns:
      advertised port
    • maxAge

      Optional<Duration> maxAge()
      Advertised maximum age. The maximum age must be non-negative when advertisement is enabled.
      Returns:
      maximum age
    • persist

      boolean persist()
      Whether to emit the persist=1 parameter.
      Returns:
      whether to emit persist