SystemOneEndpoint

@ApiStatus.Experimental
class SystemOneEndpoint constructor(val provider: String, val baseUri: URI, val connectTimeout: Duration = DEFAULT_TIMEOUT, val readTimeout: Duration = DEFAULT_TIMEOUT, val maxResponseBytes: Int = DEFAULT_MAX_RESPONSE_BYTES, val requestIdHeader: String? = null, val binding: SystemOneBinding = SystemOneBinding.STANDARD)

Where a System One endpoint lives and how to talk to it.

The address must be absolute http or https and must not carry user info, a query or a fragment, because those can hold credentials and would end up in logs. A host name that Java can't parse as one, such as a docker compose service called typesafe_gateway, is accepted. A base path is kept, so http://proxy.example/systemone sends decisions to http://proxy.example/systemone/v1/systemone. The timeouts and the response limit apply when the factory builds its own HTTP client. An application client keeps its own timeouts, and the response limit still applies.

Constructors

Link copied to clipboard
constructor(provider: String, baseUri: URI, connectTimeout: Duration = DEFAULT_TIMEOUT, readTimeout: Duration = DEFAULT_TIMEOUT, maxResponseBytes: Int = DEFAULT_MAX_RESPONSE_BYTES, requestIdHeader: String? = null, binding: SystemOneBinding = SystemOneBinding.STANDARD)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the endpoint address, without the protocol paths

Link copied to clipboard

how the endpoint lays out the protocol over HTTP

Link copied to clipboard

how long to wait for a connection

Link copied to clipboard

the largest response body that will be read

Link copied to clipboard

the provider name reported in provenance, logs and observations

Link copied to clipboard

how long to wait for data once connected

Link copied to clipboard
val requestIdHeader: String? = null

the response header that carries the provider's request id, if it sends one

Functions

Link copied to clipboard
fun resolve(path: String): URI

Returns the address of a protocol path under the base address.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Returns a copy of this endpoint that lays out the protocol with another binding. Every other value is kept, so a Java caller can set a binding without passing every timeout and limit.