Package com.okta.sdk.impl.client
Class DefaultClientBuilder
java.lang.Object
com.okta.sdk.impl.client.DefaultClientBuilder
- All Implemented Interfaces:
ClientBuilder
The default ClientBuilder implementation. This looks for configuration files
in the following locations and order of precedence (last one wins).
- classpath:com/okta/sdk/config/okta.properties
- classpath:com/okta/sdk/config/okta.yaml
- classpath:okta.properties
- classpath:okta.yaml
- ~/.okta/okta.yaml
- Environment Variables (with dot notation converted to uppercase + underscores)
- System Properties
- Programmatically
- Since:
- 0.5.0
-
Field Summary
Fields inherited from interface com.okta.sdk.client.ClientBuilder
DEFAULT_CLIENT_API_TOKEN_PROPERTY_NAME, DEFAULT_CLIENT_AUTHENTICATION_SCHEME_PROPERTY_NAME, DEFAULT_CLIENT_AUTHORIZATION_MODE_PROPERTY_NAME, DEFAULT_CLIENT_CACHE_CACHES_PROPERTY_NAME, DEFAULT_CLIENT_CACHE_ENABLED_PROPERTY_NAME, DEFAULT_CLIENT_CACHE_TTI_PROPERTY_NAME, DEFAULT_CLIENT_CACHE_TTL_PROPERTY_NAME, DEFAULT_CLIENT_CONNECTION_TIMEOUT_PROPERTY_NAME, DEFAULT_CLIENT_ID_PROPERTY_NAME, DEFAULT_CLIENT_KID_PROPERTY_NAME, DEFAULT_CLIENT_OAUTH2_ACCESS_TOKEN_PROPERTY_NAME, DEFAULT_CLIENT_ORG_URL_PROPERTY_NAME, DEFAULT_CLIENT_PRIVATE_KEY_PROPERTY_NAME, DEFAULT_CLIENT_PROXY_HOST_PROPERTY_NAME, DEFAULT_CLIENT_PROXY_PASSWORD_PROPERTY_NAME, DEFAULT_CLIENT_PROXY_PORT_PROPERTY_NAME, DEFAULT_CLIENT_PROXY_USERNAME_PROPERTY_NAME, DEFAULT_CLIENT_REQUEST_TIMEOUT_PROPERTY_NAME, DEFAULT_CLIENT_RETRY_MAX_ATTEMPTS_PROPERTY_NAME, DEFAULT_CLIENT_SCOPES_PROPERTY_NAME, DEFAULT_CLIENT_TESTING_DISABLE_HTTPS_CHECK_PROPERTY_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()protected org.apache.hc.client5.http.impl.classic.HttpClientBuildercreateHttpClientBuilder(ClientConfiguration clientConfig) Override to customize the client, allowing one to add additional interceptors.protected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuildercreateHttpClientConnectionManagerBuilder(ClientConfiguration clientConfig) Override to customize the connection manager, allowing the increase of max connectionsprotected org.apache.hc.client5.http.config.RequestConfig.BuildercreateHttpRequestConfigBuilder(ClientConfiguration clientConfig) Override to customize the request configsetAuthorizationMode(AuthorizationMode authorizationMode) setCacheManager(CacheManager cacheManager) setClientCredentials(ClientCredentials clientCredentials) setClientId(String clientId) setConnectionTimeout(int timeout) setCustomJwtSigner(UnaryOperator<byte[]> jwtSigner, String algorithm) setOAuth2AccessToken(String oAuth2AccessToken) setPrivateKey(InputStream privateKeyStream) setPrivateKey(String privateKey) setPrivateKey(Path privateKeyPath) setPrivateKey(PrivateKey privateKey) setProxy(com.okta.commons.http.config.Proxy proxy) setRetryMaxAttempts(int maxAttempts) setRetryMaxElapsed(int maxElapsed)
-
Constructor Details
-
DefaultClientBuilder
public DefaultClientBuilder()
-
-
Method Details
-
setProxy
- Specified by:
setProxyin interfaceClientBuilder
-
setCacheManager
- Specified by:
setCacheManagerin interfaceClientBuilder
-
setConnectionTimeout
- Specified by:
setConnectionTimeoutin interfaceClientBuilder
-
setClientCredentials
- Specified by:
setClientCredentialsin interfaceClientBuilder
-
setRetryMaxElapsed
- Specified by:
setRetryMaxElapsedin interfaceClientBuilder
-
setRetryMaxAttempts
- Specified by:
setRetryMaxAttemptsin interfaceClientBuilder
-
build
- Specified by:
buildin interfaceClientBuilder
-
createHttpClientBuilder
protected org.apache.hc.client5.http.impl.classic.HttpClientBuilder createHttpClientBuilder(ClientConfiguration clientConfig) Override to customize the client, allowing one to add additional interceptors.- Parameters:
clientConfig- the current ClientConfiguration- Returns:
- an
HttpClientBuilderinitialized with default configuration
-
createHttpRequestConfigBuilder
protected org.apache.hc.client5.http.config.RequestConfig.Builder createHttpRequestConfigBuilder(ClientConfiguration clientConfig) Override to customize the request config- Parameters:
clientConfig- the current clientConfig- Returns:
- a
RequestConfig.Builderinitialized with default configuration
-
createHttpClientConnectionManagerBuilder
protected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder createHttpClientConnectionManagerBuilder(ClientConfiguration clientConfig) Override to customize the connection manager, allowing the increase of max connections- Parameters:
clientConfig- the current clientConfig- Returns:
- a
PoolingHttpClientConnectionManagerBuilderinitialized with default configuration
-
setOrgUrl
- Specified by:
setOrgUrlin interfaceClientBuilder
-
setAuthorizationMode
- Specified by:
setAuthorizationModein interfaceClientBuilder
-
setScopes
- Specified by:
setScopesin interfaceClientBuilder
-
setPrivateKey
- Specified by:
setPrivateKeyin interfaceClientBuilder
-
setPrivateKey
- Specified by:
setPrivateKeyin interfaceClientBuilder
-
setPrivateKey
- Specified by:
setPrivateKeyin interfaceClientBuilder
-
setPrivateKey
- Specified by:
setPrivateKeyin interfaceClientBuilder
-
setCustomJwtSigner
- Specified by:
setCustomJwtSignerin interfaceClientBuilder
-
setClientId
- Specified by:
setClientIdin interfaceClientBuilder
-
setOAuth2AccessToken
- Specified by:
setOAuth2AccessTokenin interfaceClientBuilder
-
setKid
- Specified by:
setKidin interfaceClientBuilder
-
getClientConfiguration
-