10Duke Scale SDK for Java
|
Default implementation of a license checkout client.
The client has basic functionality for checking out, heartbeating and releasing licenses.
Note: the second phase construction method init()
must be called prior to using this instance.
Public Member Functions | |
DefaultLicenseCheckoutClient (final LicenseCheckoutMode mode) | |
Class constructor. | |
void | init () |
DefaultLicenseCheckoutClient | withConfig (final TendukeScaleConfig config) |
Sets a configuration instance to use in this client. | |
DefaultLicenseCheckoutClient | withAuthorizationProvider (final AuthorizationProvider authorizationProvider) |
Sets an authorization provider instance to use in this client. | |
DefaultLicenseCheckoutClient | withKeyProvider (final JwtSignatureVerifierKeyProvider keyProvider) |
Sets a key provider instance to use in this client. | |
DefaultLicenseCheckoutClient | withOkHttpProvider (final OkHttpProvider okHttpProvider) |
Sets an OkHttp client provider instance to use in this client. | |
DefaultLicenseCheckoutClient | withTokenManager (final TokenManager tokenManager) |
Sets a token manager to use in this client. | |
DefaultLicenseCheckoutClient | withTokenStore (final TokenStore tokenStore) |
Sets a token store to use in this client. | |
DefaultLicenseCheckoutClient | withJwtServiceProvider (final JwtServiceProvider jwtServiceProvider) |
Sets a JWT service provider instance to use in this client. | |
DefaultLicenseCheckoutClient | withMapper (final ObjectMapper mapper) |
Sets a Jackson ObjectMapper instance to use in this client. | |
List< LicenseToken > | checkoutLicense (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Checkout a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseToken > | checkoutLicenseByKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Checkout a license using a license key. | |
List< LicenseToken > | startMeteredUseOfLicense (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Starts metered use of a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseToken > | startMeteredUseByLicenseKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Starts metered use of a license using a license key. | |
List< LicenseToken > | heartbeatLicense (final Map< String, String > claims, final List< LicenseHeartbeatArguments > heartbeatArguments) |
Heartbeat a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseToken > | heartbeatMeteredLicense (final Map< String, String > claims, final List< LicenseHeartbeatArguments > heartbeatArguments) |
Heartbeat a metered license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseToken > | heartbeatLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments) |
Heartbeat a license using a license key. | |
List< LicenseToken > | heartbeatMeteredLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments) |
Heartbeat a metered license using a license key. | |
List< LicenseReleaseResult > | releaseLicense (final Map< String, String > claims, final List< LicenseReleaseArguments > releaseArguments) |
Release a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseReleaseResult > | releaseLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseReleaseArguments > releaseArguments) |
Release a license using a license key. | |
List< LicenseReleaseResult > | endMeteredLicenseUse (final Map< String, String > claims, final List< LicenseReleaseArguments > releaseArguments) |
End a metered license usage by using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization. | |
List< LicenseReleaseResult > | endMeteredLicenseUse (final Map< String, String > claims, final String licenseKey, final List< LicenseReleaseArguments > releaseArguments) |
End a metered license usage by using a license key. | |
FeatureFlagsResponse | describeLicensesAsFeatureFlags (final UUID licenseeId, final UUID licenseConsumerId, final String filterValue) |
Analyzes licenses that a license consumer has access to and describes those licenses as feature flags. | |
String | describeLicensesAsFeatureFlagsJwt (final UUID licenseeId, final UUID licenseConsumerId, final String filterValue) |
Analyzes licenses that a license consumer has access to and describes those licenses as feature flags. | |
LicenseConsumerLicensesStatus | describeLicenseConsumerLicenses (final UUID licenseeId, final UUID licenseConsumerId, final String filterField, final String filterValue, final boolean withMetadata, final int offset, final int maxCount, final String orderBy, final boolean asc) |
Analyzes licenses that a license consumer has access to and describes the license status to determine the likely outcome if trying to use the licenses. | |
LicenseKeyLicensesStatus | describeLicenseKeyLicenses (final String licenseKey, final boolean withMetadata) |
Analyzes the license(s) that a license key entitles access to and describes the license status to determine the likely outcome if trying to use the license(s). | |
List< Licensee > | describeLicenseConsumerLicensees (final UUID licenseConsumerId, final int offset, final int maxCount, final String orderBy, final boolean asc) |
Analyzes what licensees a license consumer is associated with. | |
LicenseConsumerClientBindingStatus | describeLicenseConsumerClientBindings (final UUID licenseeId, final UUID licenseConsumerId, final String filterField, final String filterValue, final boolean withMetadata, final int offset, final int maxCount, final String orderBy, final boolean asc) |
Analyzes licenses that a license consumer is known to have a checkout for currently. | |
LicenseConsumerClientBindingStatus | describeLicenseClientBindings (final UUID licenseeId, final UUID licenseId, final UUID licenseConsumerId, final String filterField, final String filterValue, final boolean withMetadata, final int offset, final int maxCount, final String orderBy, final boolean asc) |
Analyzes currently known checkouts for a specific license. | |
LicenseConsumerClientBindingStatus | findLicenseClientBinding (final UUID licenseeId, final long clientBindingId, final boolean withMetadata) |
Finds a specific license consumption client binding. | |
Public Member Functions inherited from tenduke.scale.api.LicenseCheckoutClient |
Protected Member Functions | |
void | validateConfig () |
Validates that this instance has a minimum viable configuration. | |
void | validateAuthorizationProvider () |
Validates that this instance has an authorization (header) provider. | |
void | validateHttpClient () |
Validates that this instance has an Licensing API HTTP client. | |
void | validateKeyProvider () |
Validates that this instance has an Licensing API HTTP client. | |
void | validateObjectMapper () |
Validates that this instance has a Jackson ObjectMapper instance. | |
void | ensureLicenseCheckoutHttpClient () |
Ensures that LicenseCheckoutHttpClient and the services it needs are set. | |
void | ensureKeyProvider () |
Ensures that tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider is set. | |
void | ensureJwtService () |
Ensures that tenduke.sdk.core.service.JwtService and the services it needs are set. | |
void | ensureTokenStore () |
Ensures that TokenStore is set. | |
void | ensureTokenManager () |
Ensures that TokenManager and the services it needs are set. | |
void | ensureObjectMapper () |
Ensures that com.fasterxml.jackson.databind.ObjectMapper is set. | |
OkHttpClient | extractOkHttpClient (final OkHttpProvider httpProvider) |
Provides okhttp3.OkHttpClient safely from okhttp3.OkHttpClient . | |
boolean | supportsIdentityBasedLicensing () |
Checks if set #mode supports identity based licensing. | |
void | assertModeEnablesIdentityBasedLicensing () |
Asserts that current checkout mode allows identity based licensing. | |
tenduke.scale.client.DefaultLicenseCheckoutClient.DefaultLicenseCheckoutClient | ( | final LicenseCheckoutMode | mode | ) |
Class constructor.
Note: the second phase construction method init()
must be called prior to using this instance.
mode | defines what type of licensing is enabled for this instance. |
|
protected |
Asserts that current checkout mode allows identity based licensing.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.checkoutLicense | ( | final Map< String, String > | claims, |
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Checkout a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
consumptionArguments | List of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument. |
LicenseToken
's. Note: checkout failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.checkoutLicenseByKey | ( | final String | licenseKey, |
final Map< String, String > | claims, | ||
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Checkout a license using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
consumptionArguments | List of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument. |
LicenseToken
's. Note: checkout failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
LicenseConsumerClientBindingStatus tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicenseClientBindings | ( | final UUID | licenseeId, |
final UUID | licenseId, | ||
final UUID | licenseConsumerId, | ||
final String | filterField, | ||
final String | filterValue, | ||
final boolean | withMetadata, | ||
final int | offset, | ||
final int | maxCount, | ||
final String | orderBy, | ||
final boolean | asc ) |
Analyzes currently known checkouts for a specific license.
This endpoint can be called using Scale JWT authorization. When using the Scale JWT authorization option the minimum permission grant definition is: Licensing.action.
licenseeId | An identifier to scope the find within licenses of a specific licensee. |
licenseId | The identifier of the license, which client bindings are requested. |
licenseConsumerId | Optional identifier of the license consumer, which client bindings are requested. |
filterField | Name of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values. |
filterValue | Filter value to apply on licenses. Defaults to null (no filtering). |
withMetadata | Flag to control including verbose information about the licenses and client bindings. Setting this option to true will fetch contract, order, subscription and external reference information at time of original license grant, the license container, a possible license key and related product information. For client bindings the additional information is related to license consumption objects and license consumers. Defaults to false. |
offset | Offset for paging results. |
maxCount | Limit for controlling result size. |
orderBy | Field name to order results by. Defaults to the LicenseConsumptionClientBinding.validFrom field. See the API docs for allowed values. |
asc | Flag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order. |
Implements tenduke.scale.api.LicenseCheckoutClient.
LicenseConsumerClientBindingStatus tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicenseConsumerClientBindings | ( | final UUID | licenseeId, |
final UUID | licenseConsumerId, | ||
final String | filterField, | ||
final String | filterValue, | ||
final boolean | withMetadata, | ||
final int | offset, | ||
final int | maxCount, | ||
final String | orderBy, | ||
final boolean | asc ) |
Analyzes licenses that a license consumer is known to have a checkout for currently.
This endpoint can be called using either Scale JWT authorization or by using an OIDC Id Token. When using the Scale JWT authorization option the minimum permission grant definition is: Licensing.action.
licenseeId | Identifier of the licensee that the license belongs to. |
licenseConsumerId | Identifier of the license consumer that the the information is scoped to. NOTE: This parameter is required when using Scale JWT API authorization. Ignore this request parameter when using an OIDC Id Token as the API authorization model. |
filterField | Name of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values. |
filterValue | Filter value to apply on licenses. Defaults to null (no filtering). |
withMetadata | Flag to control including verbose information about the licenses and client bindings. Setting this option to true will fetch contract, order, subscription and external reference information at time of original license grant, the license container, a possible license key and related product information. For client bindings the additional information is related to license consumption objects and license consumers. Defaults to false. |
offset | Offset for paging results. Defaults to 0. |
maxCount | Limit for controlling result size. Defaults to 5. |
orderBy | Field name to order results by. Defaults to the LicenseConsumptionClientBinding.validFrom field. See the API docs for allowed values. |
asc | Flag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order. |
Implements tenduke.scale.api.LicenseCheckoutClient.
List< Licensee > tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicenseConsumerLicensees | ( | final UUID | licenseConsumerId, |
final int | offset, | ||
final int | maxCount, | ||
final String | orderBy, | ||
final boolean | asc ) |
Analyzes what licensees a license consumer is associated with.
The association is defined as a relation between a license consumer and one or more license containers that belong to licensees. This API method can be called using either Scale JWT authorization or by using an OIDC Id Token. When using the Scale JWT authorization option the minimum permission grant definition is: Licensing.action.
licenseConsumerId | Identifier of the license consumer to query licensees for. NOTE: This parameter is required when using Scale JWT API authorization. Ignore this request parameter when using an OIDC Id Token as the API authorization model. |
offset | Offset for paging results. Defaults to 0. |
maxCount | Limit for controlling result size. Defaults to 5. |
orderBy | Field name to order results by. Defaults to the Licensee.naturalId field. See the API docs for allowed values. |
asc | Flag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order. |
Implements tenduke.scale.api.LicenseCheckoutClient.
LicenseConsumerLicensesStatus tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicenseConsumerLicenses | ( | final UUID | licenseeId, |
final UUID | licenseConsumerId, | ||
final String | filterField, | ||
final String | filterValue, | ||
final boolean | withMetadata, | ||
final int | offset, | ||
final int | maxCount, | ||
final String | orderBy, | ||
final boolean | asc ) |
Analyzes licenses that a license consumer has access to and describes the license status to determine the likely outcome if trying to use the licenses.
This endpoint can be called using either Scale JWT authorization or an OIDC ID Token. When using Scale JWT authorization, the minimum permission grant definition is Licensing.action. NOTE: Paging parameters apply to licenses (the main level of data in the response). In other words, paging does not affect the additional information that is included in the response when parameter withMetadata == true.
licenseeId | Identifier of the licensee that the license belongs to. |
licenseConsumerId | Identifier of the license consumer that the the information is scoped to. NOTE: This parameter is required when using Scale JWT API authorization. Ignore this request parameter when using an OIDC Id Token as the API authorization model. |
filterField | Name of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values. |
filterValue | Filter value to apply on licenses. Defaults to null (no filtering). |
withMetadata | Flag to control including verbose information about the licenses. Setting this option to true will fetch contract, order, subscription and external reference information at time of original license grant, the license container, a possible license key and related product information. Defaults to false. |
offset | Offset for paging results. Defaults to 0. Applies to licenses, not the additional information included when parameter withMetadata == true. |
maxCount | Limit for controlling result size. Defaults to 5. Applies to licenses, not the additional information included when parameter withMetadata == true. |
orderBy | Field name to order results by. Defaults to the License.validFrom field. See the API docs for allowed values. |
asc | Flag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order. |
Implements tenduke.scale.api.LicenseCheckoutClient.
LicenseKeyLicensesStatus tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicenseKeyLicenses | ( | final String | licenseKey, |
final boolean | withMetadata ) |
Analyzes the license(s) that a license key entitles access to and describes the license status to determine the likely outcome if trying to use the license(s).
This endpoint authorizes access based on the validity of the license key alone.
licenseKey | The license key used to query license information. |
withMetadata | Flag to control including verbose information about the licenses. Setting this option to true will fetch contract, order, subscription and external reference information at time of original license grant, the license container, a possible license key and related product information. |
Implements tenduke.scale.api.LicenseCheckoutClient.
FeatureFlagsResponse tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicensesAsFeatureFlags | ( | final UUID | licenseeId, |
final UUID | licenseConsumerId, | ||
final String | filterValue ) |
Analyzes licenses that a license consumer has access to and describes those licenses as feature flags.
This endpoint can be called using either Scale JWT authorization or by using an OIDC Id Token. When using the Scale JWT authorization option the minimum permission grant definition is: Licensing.action.
licenseeId | Identifier of the licensee that the licenses belongs to. |
licenseConsumerId | Identifier of the license consumer that the the information is scoped to. NOTE: This parameter is required when using Scale JWT API authorization. Ignore this request parameter when using an OIDC Id Token as the API authorization model. |
filterValue | Product name to match in result. Defaults to null (no filtering). The match is full name, case insensitive |
Implements tenduke.scale.api.LicenseCheckoutClient.
String tenduke.scale.client.DefaultLicenseCheckoutClient.describeLicensesAsFeatureFlagsJwt | ( | final UUID | licenseeId, |
final UUID | licenseConsumerId, | ||
final String | filterValue ) |
Analyzes licenses that a license consumer has access to and describes those licenses as feature flags.
This endpoint can be called using either Scale JWT authorization or by using an OIDC Id Token. When using the Scale JWT authorization option the minimum permission grant definition is: Licensing.action.
licenseeId | Identifier of the licensee that the licenses belongs to. |
licenseConsumerId | Identifier of the license consumer that the the information is scoped to. NOTE: This parameter is required when using Scale JWT API authorization. Ignore this request parameter when using an OIDC Id Token as the API authorization model. |
filterValue | Product name to match in result. Defaults to null (no filtering). The match is full name, case insensitive |
Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseReleaseResult > tenduke.scale.client.DefaultLicenseCheckoutClient.endMeteredLicenseUse | ( | final Map< String, String > | claims, |
final List< LicenseReleaseArguments > | releaseArguments ) |
End a metered license usage by using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
releaseArguments | List of argument objects specific for each license to release. The list must contain at least 1 release argument. |
tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
's. Note: release failure is also communicated as a tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseReleaseResult > tenduke.scale.client.DefaultLicenseCheckoutClient.endMeteredLicenseUse | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseReleaseArguments > | releaseArguments ) |
End a metered license usage by using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
releaseArguments | List of argument objects specific for each license to release. The list must contain at least 1 release argument. |
tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
's. Note: release failure is also communicated as a tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
. Implements tenduke.scale.api.LicenseCheckoutClient.
|
protected |
Ensures that tenduke.sdk.core.service.JwtService
and the services it needs are set.
This will also ensure that keyProvider
is set by using ensureKeyProvider()
.
If jwtServiceProvider
has not been set, it will be set to a new instance of tenduke.sdk.core.service.impl.DefaultJwtServiceProvider
.
|
protected |
Ensures that tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider
is set.
If keyProvider
has not been set, it will be set to a new instance of tenduke.sdk.core.service.impl.DefaultJwtSignatureVerifierKeyProvider
.
|
protected |
Ensures that LicenseCheckoutHttpClient
and the services it needs are set.
If LicenseCheckoutHttpClient
was not provided before initialization, one will be created. Creating a new instance requires a valid TendukeScaleConfig
by minimum.
Additionally an authorizationProvider
is required if the configured mode
specifies identity based licensing.
|
protected |
Ensures that com.fasterxml.jackson.databind.ObjectMapper
is set.
If mapper
has not been set, it will be set to a new instance of com.fasterxml.jackson.databind.ObjectMapper
with default settings.
|
protected |
Ensures that TokenManager
and the services it needs are set.
This will also ensure that jwtServiceProvider
and tokenStore
are set by using corresponding methods.
If tokenManager
has not been set, it will be set to a new instance of DefaultTokenManager
.
|
protected |
Ensures that TokenStore
is set.
If tokenStore
has not been set, it will be set to a new instance of InMemoryTokenStore
.
|
protected |
Provides okhttp3.OkHttpClient
safely from okhttp3.OkHttpClient
.
httpProvider | to provide the client. |
okhttp3.OkHttpClient
if okhttp3.OkHttpClient
is found. Otherwise null. LicenseConsumerClientBindingStatus tenduke.scale.client.DefaultLicenseCheckoutClient.findLicenseClientBinding | ( | final UUID | licenseeId, |
final long | clientBindingId, | ||
final boolean | withMetadata ) |
Finds a specific license consumption client binding.
licenseeId | The identifier to scope the find within licenses of a specific licensee. |
clientBindingId | Identifier of the license consumption client binding to find. |
withMetadata | Flag to control if additional metadata is included in the response. A false value will yield better performance. |
Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.heartbeatLicense | ( | final Map< String, String > | claims, |
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
Heartbeat a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
heartbeatArguments | List of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument. |
LicenseToken
's. Note: heartbeat failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.heartbeatLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
Heartbeat a license using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
heartbeatArguments | List of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument. |
LicenseToken
's. Note: heartbeat failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.heartbeatMeteredLicense | ( | final Map< String, String > | claims, |
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
Heartbeat a metered license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
heartbeatArguments | List of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument. |
LicenseToken
's. Note: heartbeat failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.heartbeatMeteredLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
Heartbeat a metered license using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
heartbeatArguments | List of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument. |
LicenseToken
's. Note: heartbeat failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
void tenduke.scale.client.DefaultLicenseCheckoutClient.init | ( | ) |
List< LicenseReleaseResult > tenduke.scale.client.DefaultLicenseCheckoutClient.releaseLicense | ( | final Map< String, String > | claims, |
final List< LicenseReleaseArguments > | releaseArguments ) |
Release a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
releaseArguments | List of argument objects specific for each license to release. The list must contain at least 1 release argument. |
tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
's. Note: release failure is also communicated as a tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseReleaseResult > tenduke.scale.client.DefaultLicenseCheckoutClient.releaseLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseReleaseArguments > | releaseArguments ) |
Release a license using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
releaseArguments | List of argument objects specific for each license to release. The list must contain at least 1 release argument. |
tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
's. Note: release failure is also communicated as a tenduke.scale.api.model.licensecheckout.LicenseReleaseResult
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.startMeteredUseByLicenseKey | ( | final String | licenseKey, |
final Map< String, String > | claims, | ||
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Starts metered use of a license using a license key.
licenseKey | The license key, must not be blank. |
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
consumptionArguments | List of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument. |
LicenseToken
's. Note: checkout failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
List< LicenseToken > tenduke.scale.client.DefaultLicenseCheckoutClient.startMeteredUseOfLicense | ( | final Map< String, String > | claims, |
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Starts metered use of a license using either Open ID Connect API authorization (OIDC, identity based licensing) or using the Scale JWT API authorization.
claims | Client application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims. |
consumptionArguments | List of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument. |
LicenseToken
's. Note: checkout failure is also communicated as a LicenseToken
. Implements tenduke.scale.api.LicenseCheckoutClient.
|
protected |
Checks if set #mode
supports identity based licensing.
|
protected |
Validates that this instance has an authorization (header) provider.
Throws an IllegalStateException for invalid state.
|
protected |
Validates that this instance has a minimum viable configuration.
Throws an IllegalStateException for invalid state.
|
protected |
Validates that this instance has an Licensing API HTTP client.
|
protected |
Validates that this instance has an Licensing API HTTP client.
|
protected |
Validates that this instance has a Jackson ObjectMapper instance.
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withAuthorizationProvider | ( | final AuthorizationProvider | authorizationProvider | ) |
Sets an authorization provider instance to use in this client.
Note: An authorization provider is required when implementing user identity based licensing or 10Duke Scale JWT based API authorization (it is not required when using license keys). Supported modes are controlled with constructor parameter.
authorizationProvider | The authorization provider to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withConfig | ( | final TendukeScaleConfig | config | ) |
Sets a configuration instance to use in this client.
Note: setting the configuration is required.
config | The configuration to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withJwtServiceProvider | ( | final JwtServiceProvider | jwtServiceProvider | ) |
Sets a JWT service provider instance to use in this client.
Note: setting the provider is optional as it will be created if not provided.
jwtServiceProvider | The provider to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withKeyProvider | ( | final JwtSignatureVerifierKeyProvider | keyProvider | ) |
Sets a key provider instance to use in this client.
Note: a default key provider will be created if one is not provided.
keyProvider | The key provider to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withMapper | ( | final ObjectMapper | mapper | ) |
Sets a Jackson ObjectMapper instance to use in this client.
Note: setting the JSON mapper is optional as it will be created if not provided.
mapper | The JSON mapper to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withOkHttpProvider | ( | final OkHttpProvider | okHttpProvider | ) |
Sets an OkHttp client provider instance to use in this client.
Note: an okhttp3.OkHttpClient
will be created by LicenseCheckoutHttpClient
using TendukeScaleConfig
if an okhttp3.OkHttpClient
is not provided.
okHttpProvider | The OkHttp client provider to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withTokenManager | ( | final TokenManager | tokenManager | ) |
Sets a token manager to use in this client.
Note: setting the token manager is optional as it will be created if not provided.
tokenManager | The token manager to set. |
DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withTokenStore | ( | final TokenStore | tokenStore | ) |
Sets a token store to use in this client.
Note: setting the tenduke.scale.api.TokenStore
is optional as it will be created if not provided. It is however recommended to provide as the tenduke.scale.api.TokenStore
affects the way tokens are stored. Created tenduke.scale.api.TokenStore
by default will only hold tokens in memory by using tenduke.scale.api.InMemoryTokenStore
.
tokenStore | The token store to set. |