10Duke Scale SDK for Java
Loading...
Searching...
No Matches
tenduke.scale.client.DefaultLicenseCheckoutClient Class Reference

Detailed Description

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.

Inheritance diagram for tenduke.scale.client.DefaultLicenseCheckoutClient:
tenduke.scale.api.LicenseCheckoutClient

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< LicenseTokencheckoutLicense (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< LicenseTokencheckoutLicenseByKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments)
 Checkout a license using a license key.
 
List< LicenseTokenstartMeteredUseOfLicense (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< LicenseTokenstartMeteredUseByLicenseKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments)
 Starts metered use of a license using a license key.
 
List< LicenseTokenheartbeatLicense (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< LicenseTokenheartbeatMeteredLicense (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< LicenseTokenheartbeatLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments)
 Heartbeat a license using a license key.
 
List< LicenseTokenheartbeatMeteredLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments)
 Heartbeat a metered license using a license key.
 
List< LicenseReleaseResultreleaseLicense (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< LicenseReleaseResultreleaseLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseReleaseArguments > releaseArguments)
 Release a license using a license key.
 
List< LicenseReleaseResultendMeteredLicenseUse (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< LicenseReleaseResultendMeteredLicenseUse (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< LicenseedescribeLicenseConsumerLicensees (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.
 

Constructor & Destructor Documentation

◆ DefaultLicenseCheckoutClient()

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.

Parameters
modedefines what type of licensing is enabled for this instance.

Member Function Documentation

◆ assertModeEnablesIdentityBasedLicensing()

void tenduke.scale.client.DefaultLicenseCheckoutClient.assertModeEnablesIdentityBasedLicensing ( )
protected

Asserts that current checkout mode allows identity based licensing.

◆ checkoutLicense()

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
consumptionArgumentsList of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument.
Returns
License checkout result as LicenseToken's. Note: checkout failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ checkoutLicenseByKey()

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
consumptionArgumentsList of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument.
Returns
License checkout result LicenseToken's. Note: checkout failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicenseClientBindings()

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.

Parameters
licenseeIdAn identifier to scope the find within licenses of a specific licensee.
licenseIdThe identifier of the license, which client bindings are requested.
licenseConsumerIdOptional identifier of the license consumer, which client bindings are requested.
filterFieldName of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values.
filterValueFilter value to apply on licenses. Defaults to null (no filtering).
withMetadataFlag 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.
offsetOffset for paging results.
maxCountLimit for controlling result size.
orderByField name to order results by. Defaults to the LicenseConsumptionClientBinding.validFrom field. See the API docs for allowed values.
ascFlag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order.
Returns
A LicenseConsumerClientBindingStatus with information about the license consumption client binding. Throws an ApiException if the client binding is not found.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicenseConsumerClientBindings()

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.

Parameters
licenseeIdIdentifier of the licensee that the license belongs to.
licenseConsumerIdIdentifier 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.
filterFieldName of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values.
filterValueFilter value to apply on licenses. Defaults to null (no filtering).
withMetadataFlag 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.
offsetOffset for paging results. Defaults to 0.
maxCountLimit for controlling result size. Defaults to 5.
orderByField name to order results by. Defaults to the LicenseConsumptionClientBinding.validFrom field. See the API docs for allowed values.
ascFlag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order.
Returns
Information about a license consumer's current license consumption client binding.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicenseConsumerLicensees()

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.

Parameters
licenseConsumerIdIdentifier 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.
offsetOffset for paging results. Defaults to 0.
maxCountLimit for controlling result size. Defaults to 5.
orderByField name to order results by. Defaults to the Licensee.naturalId field. See the API docs for allowed values.
ascFlag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order.
Returns
A list of licensees who's licenses the license consumer is entitled to use.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicenseConsumerLicenses()

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.

Parameters
licenseeIdIdentifier of the licensee that the license belongs to.
licenseConsumerIdIdentifier 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.
filterFieldName of field to apply filter value on. Defaults to null (no filtering). See the API docs for allowed values.
filterValueFilter value to apply on licenses. Defaults to null (no filtering).
withMetadataFlag 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.
offsetOffset for paging results. Defaults to 0. Applies to licenses, not the additional information included when parameter withMetadata == true.
maxCountLimit for controlling result size. Defaults to 5. Applies to licenses, not the additional information included when parameter withMetadata == true.
orderByField name to order results by. Defaults to the License.validFrom field. See the API docs for allowed values.
ascFlag that controls ordering in ascending vs. descending order. Defaults to false, meaning descending order.
Returns
Information about a licensee's licenses that a license consumer is entitled to use.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicenseKeyLicenses()

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.

Parameters
licenseKeyThe license key used to query license information.
withMetadataFlag 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.
Returns
Information about the license(s) that the license key entitles to use.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicensesAsFeatureFlags()

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.

Parameters
licenseeIdIdentifier of the licensee that the licenses belongs to.
licenseConsumerIdIdentifier 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.
filterValueProduct name to match in result. Defaults to null (no filtering). The match is full name, case insensitive
Returns
A list of feature flags structured with a per product breakdown describing what is enabled for the license consumer.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ describeLicensesAsFeatureFlagsJwt()

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.

Parameters
licenseeIdIdentifier of the licensee that the licenses belongs to.
licenseConsumerIdIdentifier 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.
filterValueProduct name to match in result. Defaults to null (no filtering). The match is full name, case insensitive
Returns
A JWT with information about feature flags enabled for a license consumer.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ endMeteredLicenseUse() [1/2]

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
releaseArgumentsList of argument objects specific for each license to release. The list must contain at least 1 release argument.
Returns
License release result 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.

◆ endMeteredLicenseUse() [2/2]

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
releaseArgumentsList of argument objects specific for each license to release. The list must contain at least 1 release argument.
Returns
License release result 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.

◆ ensureJwtService()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureJwtService ( )
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.

◆ ensureKeyProvider()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureKeyProvider ( )
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.

◆ ensureLicenseCheckoutHttpClient()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureLicenseCheckoutHttpClient ( )
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.

◆ ensureObjectMapper()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureObjectMapper ( )
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.

◆ ensureTokenManager()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureTokenManager ( )
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.

◆ ensureTokenStore()

void tenduke.scale.client.DefaultLicenseCheckoutClient.ensureTokenStore ( )
protected

Ensures that TokenStore is set.

If tokenStore has not been set, it will be set to a new instance of InMemoryTokenStore.

◆ extractOkHttpClient()

OkHttpClient tenduke.scale.client.DefaultLicenseCheckoutClient.extractOkHttpClient ( final OkHttpProvider httpProvider)
protected

Provides okhttp3.OkHttpClient safely from okhttp3.OkHttpClient.

Parameters
httpProviderto provide the client.
Returns
okhttp3.OkHttpClient if okhttp3.OkHttpClient is found. Otherwise null.

◆ findLicenseClientBinding()

LicenseConsumerClientBindingStatus tenduke.scale.client.DefaultLicenseCheckoutClient.findLicenseClientBinding ( final UUID licenseeId,
final long clientBindingId,
final boolean withMetadata )

Finds a specific license consumption client binding.

Parameters
licenseeIdThe identifier to scope the find within licenses of a specific licensee.
clientBindingIdIdentifier of the license consumption client binding to find.
withMetadataFlag to control if additional metadata is included in the response. A false value will yield better performance.
Returns
A LicenseConsumerClientBindingStatus with information about the license consumption client binding. Throws an ApiException if the client binding is not found.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ heartbeatLicense() [1/2]

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
heartbeatArgumentsList of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument.
Returns
License heartbeat result LicenseToken's. Note: heartbeat failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ heartbeatLicense() [2/2]

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
heartbeatArgumentsList of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument.
Returns
License heartbeat result LicenseToken's. Note: heartbeat failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ heartbeatMeteredLicense() [1/2]

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
heartbeatArgumentsList of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument.
Returns
License heartbeat result LicenseToken's. Note: heartbeat failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ heartbeatMeteredLicense() [2/2]

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
heartbeatArgumentsList of argument objects specific for each license to heartbeat. The list must contain at least 1 heartbeat argument.
Returns
License heartbeat result LicenseToken's. Note: heartbeat failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ init()

void tenduke.scale.client.DefaultLicenseCheckoutClient.init ( )

◆ releaseLicense() [1/2]

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
releaseArgumentsList of argument objects specific for each license to release. The list must contain at least 1 release argument.
Returns
License release result 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.

◆ releaseLicense() [2/2]

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
releaseArgumentsList of argument objects specific for each license to release. The list must contain at least 1 release argument.
Returns
License release result 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.

◆ startMeteredUseByLicenseKey()

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.

Parameters
licenseKeyThe license key, must not be blank.
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
consumptionArgumentsList of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument.
Returns
License checkout result LicenseToken's. Note: checkout failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ startMeteredUseOfLicense()

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.

Parameters
claimsClient application claims like hardware id, etc. Use model class ClientClaims as utility to assemble the claims.
consumptionArgumentsList of argument objects specific for each license to checkout. The list must contain at least 1 consumption argument.
Returns
License checkout result LicenseToken's. Note: checkout failure is also communicated as a LicenseToken.

Implements tenduke.scale.api.LicenseCheckoutClient.

◆ supportsIdentityBasedLicensing()

boolean tenduke.scale.client.DefaultLicenseCheckoutClient.supportsIdentityBasedLicensing ( )
protected

Checks if set #mode supports identity based licensing.

Returns
true if identity based licensing is supported, otherwise false.

◆ validateAuthorizationProvider()

void tenduke.scale.client.DefaultLicenseCheckoutClient.validateAuthorizationProvider ( )
protected

Validates that this instance has an authorization (header) provider.

Throws an IllegalStateException for invalid state.

◆ validateConfig()

void tenduke.scale.client.DefaultLicenseCheckoutClient.validateConfig ( )
protected

Validates that this instance has a minimum viable configuration.

Throws an IllegalStateException for invalid state.

◆ validateHttpClient()

void tenduke.scale.client.DefaultLicenseCheckoutClient.validateHttpClient ( )
protected

Validates that this instance has an Licensing API HTTP client.

◆ validateKeyProvider()

void tenduke.scale.client.DefaultLicenseCheckoutClient.validateKeyProvider ( )
protected

Validates that this instance has an Licensing API HTTP client.

◆ validateObjectMapper()

void tenduke.scale.client.DefaultLicenseCheckoutClient.validateObjectMapper ( )
protected

Validates that this instance has a Jackson ObjectMapper instance.

◆ withAuthorizationProvider()

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.

Parameters
authorizationProviderThe authorization provider to set.
Returns
this instance.

◆ withConfig()

DefaultLicenseCheckoutClient tenduke.scale.client.DefaultLicenseCheckoutClient.withConfig ( final TendukeScaleConfig config)

Sets a configuration instance to use in this client.

Note: setting the configuration is required.

Parameters
configThe configuration to set.
Returns
this instance.

◆ withJwtServiceProvider()

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.

Parameters
jwtServiceProviderThe provider to set.
Returns
this instance.

◆ withKeyProvider()

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.

Parameters
keyProviderThe key provider to set.
Returns
this instance.

◆ withMapper()

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.

Parameters
mapperThe JSON mapper to set.
Returns
this instance.

◆ withOkHttpProvider()

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.

Parameters
okHttpProviderThe OkHttp client provider to set.
Returns
this instance.

◆ withTokenManager()

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.

Parameters
tokenManagerThe token manager to set.
Returns
this instance.

◆ withTokenStore()

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.

Parameters
tokenStoreThe token store to set.
Returns
this instance.

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