OvokConfig

Settings for an Ovok client; build one with builder().

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public final class OvokConfig

Settings for an Ovok client; build one with builder().

OvokConfig config = OvokConfig.builder()
        .baseUrl("https://api.sandbox.ovok.com")
        .tenantCode("my-tenant")
        .clientId("my-client-id")
        .build();
Ovok ovok = new Ovok(config);

Set clientSecret too for a machine client; without it the client signs in users.

Methods

builder

public static OvokConfig.Builder builder()

Starts a new configuration.

Returns: a builder with the defaults

OvokConfig.Builder

public static final class Builder

Builds an OvokConfig. baseUrl and tenantCode are required.

Builder.baseUrl

public OvokConfig.Builder baseUrl(String value)

Sets the API base URL.

Parameters:

  • value: an absolute http(s) URL

Returns: this builder

Throws:

public OvokConfig.Builder baseUrl(URI value)

Sets the API base URL.

Parameters:

  • value: an absolute http(s) URL

Returns: this builder

Builder.tenantCode

public OvokConfig.Builder tenantCode(String value)

Sets the tenant (project) code.

Parameters:

  • value: the tenant code

Returns: this builder

Builder.fhirPath

public OvokConfig.Builder fhirPath(String value)

Sets the path of the FHIR API under the base URL; the default is fhir.

Parameters:

  • value: the path, such as fhir/R4

Returns: this builder

Builder.storage

public OvokConfig.Builder storage(OvokStorage value)

Sets where the user session is stored; the default keeps it in memory.

Parameters:

  • value: the storage

Returns: this builder

Builder.clientId

public OvokConfig.Builder clientId(String value)

Sets the OAuth client id.

Parameters:

  • value: the client id

Returns: this builder

Builder.clientSecret

public OvokConfig.Builder clientSecret(String value)

Sets the OAuth client secret, which makes this a machine client using client credentials.

Parameters:

  • value: the client secret; requires a client id

Returns: this builder

Builder.transport

public OvokConfig.Builder transport(HttpClient value)

Sets the HTTP client used for every request; the default is HttpClient.newHttpClient().

Parameters:

  • value: the HTTP client

Returns: this builder

Builder.timeout

public OvokConfig.Builder timeout(Duration value)

Sets the default request timeout; the default is 30 seconds.

Parameters:

  • value: a positive duration

Returns: this builder

Builder.maxNetworkRetries

public OvokConfig.Builder maxNetworkRetries(int value)

Sets how often a failed request is retried; the default is 2.

Parameters:

  • value: the retry count, at least 0

Returns: this builder

Builder.onUnauthenticated

public OvokConfig.Builder onUnauthenticated(Consumer<UnauthenticatedReason> value)

Sets the callback run when the user session ends and the user must sign in again.

Parameters:

  • value: the callback

Returns: this builder

Builder.build

public OvokConfig build()

Validates the settings and builds the configuration.

Returns: the configuration

Throws:

Last updated on

On this page