Class ApiKeyCredential.Builder
java.lang.Object
io.superdurable.dex.ApiKeyCredential.Builder
- Enclosing class:
ApiKeyCredential
Configures the timeout and HTTP transport for an API key credential.
Obtain a builder from ApiKeyCredential.builder(URI, String, String). The enclosing type shows a
complete Client example. Build does not contact the token endpoint. The default timeout is
ten seconds, and a supplied HTTP connection factory remains the caller's property.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the thread-safe credential without contacting the token endpoint.exchangeTimeout(Duration value) Sets the maximum duration for one exchange, including connection and response.Uses a connection factory for token exchanges and proxy configuration.
-
Method Details
-
exchangeTimeout
Sets the maximum duration for one exchange, including connection and response.- Parameters:
value- a positive duration; the default is ten seconds- Returns:
- this builder
- Throws:
IllegalArgumentException- if the duration is null, zero, negative, or too large
-
httpConnectionFactory
Uses a connection factory for token exchanges and proxy configuration.The default opens a connection through Java's standard proxy configuration. See
ApiKeyCredential.HttpConnectionFactoryfor an explicit proxy example.- Parameters:
value- the nonnull factory; the caller retains ownership- Returns:
- this builder
- Throws:
IllegalArgumentException- if the factory is null
-
build
Builds the thread-safe credential without contacting the token endpoint.- Returns:
- a credential owned by the application and shared with its Clients or Workers
-