10Duke Scale SDK for Java
Loading...
Searching...
No Matches
tenduke.scale.api.config.TendukeScaleConfigWithFallback Class Reference

Detailed Description

A TendukeScaleConfig implementation that provides a stacked approach for supporting a multi-source configuration.

To define a stacked configuration instance that terminates the recursion use: the single arg constructor OR call only the fluent variant withPriorityConfig without a further call to withFallbackConfig.

Inheritance diagram for tenduke.scale.api.config.TendukeScaleConfigWithFallback:
tenduke.scale.api.config.TendukeScaleConfig

Public Member Functions

 TendukeScaleConfigWithFallback (final TendukeScaleConfig config, final TendukeScaleConfig fallback)
 Creates a new TendukeScaleConfig with the given configuration instance taking priority and with the given fallback configuration instance.
 
TendukeScaleConfigWithFallback withConfig (final TendukeScaleConfig config)
 Sets the configuration instance to use as priority in the stack.
 
TendukeScaleConfigWithFallback withFallbackConfig (final TendukeScaleConfig config)
 Sets the configuration instance to use as a fallback in the stack.
 
URI licensingApiUrl ()
 Protocol and host name for the 10Duke API base URL.
 
Optional< String > licensingApiAuthorizationModel ()
 Method of authorization used for API calls.
 
- Public Member Functions inherited from tenduke.scale.api.config.TendukeScaleConfig

Protected Member Functions

TendukeScaleConfig getTendukeScaleConfig ()
 Gets the primary config and makes sure its type is TendukeScaleConfig.
 
TendukeScaleConfig getTendukeScaleFallbackConfig ()
 Gets the fallback config and makes sure its type is TendukeScaleConfig.
 

Additional Inherited Members

- Public Attributes inherited from tenduke.scale.api.config.TendukeScaleConfig
String LICENSING_API_JWKS_URLS_PATH = "/licensing-signing-keys/.well-known/jwks.json"
 URL path to read public key used to verify JWTs received from the API: /licensing-signing-keys/.well-known/jwks.json.
 

Constructor & Destructor Documentation

◆ TendukeScaleConfigWithFallback()

tenduke.scale.api.config.TendukeScaleConfigWithFallback.TendukeScaleConfigWithFallback ( final TendukeScaleConfig config,
final TendukeScaleConfig fallback )

Creates a new TendukeScaleConfig with the given configuration instance taking priority and with the given fallback configuration instance.

Parameters
configThe first level configuration instance.
fallbackThe fallback configuration to use if the first level configuration does not provide a value. If fallback == null then a MinViableTendukeScaleConfig is created as the fallback configuration. For fallback == null the priority configuration instance must be able to provide a value for licensingApiUrl().

Member Function Documentation

◆ getTendukeScaleConfig()

TendukeScaleConfig tenduke.scale.api.config.TendukeScaleConfigWithFallback.getTendukeScaleConfig ( )
protected

Gets the primary config and makes sure its type is TendukeScaleConfig.

Note: this method throws an internal error if the primary config instance is of wrong type.

Returns
The primary config instance.

◆ getTendukeScaleFallbackConfig()

TendukeScaleConfig tenduke.scale.api.config.TendukeScaleConfigWithFallback.getTendukeScaleFallbackConfig ( )
protected

Gets the fallback config and makes sure its type is TendukeScaleConfig.

Returns
The fallback config instance or null if the type is not TendukeScaleConfig.

◆ licensingApiAuthorizationModel()

Optional< String > tenduke.scale.api.config.TendukeScaleConfigWithFallback.licensingApiAuthorizationModel ( )

Method of authorization used for API calls.

Returns
A constant value denoting the API Authorization model. Defaults to: empty, which works for license key based API authorization.

Implements tenduke.scale.api.config.TendukeScaleConfig.

◆ licensingApiUrl()

URI tenduke.scale.api.config.TendukeScaleConfigWithFallback.licensingApiUrl ( )

Protocol and host name for the 10Duke API base URL.

Returns
the licensing API URL.

Implements tenduke.scale.api.config.TendukeScaleConfig.

◆ withConfig()

TendukeScaleConfigWithFallback tenduke.scale.api.config.TendukeScaleConfigWithFallback.withConfig ( final TendukeScaleConfig config)

Sets the configuration instance to use as priority in the stack.

Parameters
configThe priority configuration to use first.
Returns
this instance.

◆ withFallbackConfig()

TendukeScaleConfigWithFallback tenduke.scale.api.config.TendukeScaleConfigWithFallback.withFallbackConfig ( final TendukeScaleConfig config)

Sets the configuration instance to use as a fallback in the stack.

Parameters
configThe fallback configuration to use only if the configuration with priority does not provide a value. Note: a not null value is required.
Returns
this instance.

The documentation for this class was generated from the following file: