10Duke Scale SDK for Java
|
License checkout API implementation without any caching or persistence features.
In other words, this implementation provides API call wrappers for the license checkout API as direct request - response implementation.
Public Member Functions | |
List< JwtToken > | checkoutLicense (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Checkout a license using Open ID Connect API authorization (OIDC, identity based licensing). | |
List< JwtToken > | checkoutLicenseByKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Checkout a license using a license key. | |
List< JwtToken > | startMeteredUseOfLicense (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Starts metered use of a license using Open ID Connect API authorization (OIDC, identity based licensing). | |
List< JwtToken > | startMeteredUseByLicenseKey (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
Starts metered use of a license using a license key. | |
List< JwtToken > | heartbeatLicense (final Map< String, String > claims, final List< LicenseHeartbeatArguments > heartbeatArguments) |
List< JwtToken > | heartbeatMeteredLicense (final Map< String, String > claims, final List< LicenseHeartbeatArguments > heartbeatArguments) |
List< JwtToken > | heartbeatLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments) |
List< JwtToken > | heartbeatMeteredLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > heartbeatArguments) |
List< LicenseReleaseResult > | releaseLicense (final Map< String, String > claims, final List< LicenseReleaseArguments > releaseArguments) |
List< LicenseReleaseResult > | releaseLicense (final Map< String, String > claims, final String licenseKey, final List< LicenseReleaseArguments > releaseArguments) |
List< LicenseReleaseResult > | endMeteredLicenseUse (final Map< String, String > claims, final List< LicenseReleaseArguments > releaseArguments) |
List< LicenseReleaseResult > | endMeteredLicenseUse (final Map< String, String > claims, final String licenseKey, final List< LicenseReleaseArguments > releaseArguments) |
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 license status to determine likely outcome if trying to use 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 to. | |
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) |
Finds a specific license consumption client binding. | |
LicenseConsumerClientBindingStatus | findLicenseClientBinding (final UUID licenseeId, final long clientBindingId, final boolean withMetadata) |
Finds a specific license consumption client binding. | |
AuthorizationProvider | switchAuthzJwtProviders (final AuthorizationProvider toProvider) |
Changes the current authorization header JWT provider to a new one. | |
Protected Member Functions | |
List< String > | checkoutLicenseNoParse (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
List< String > | checkoutLicenseByKeyNoParse (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
List< String > | startMeteredUseOfLicenseNoParse (final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
List< String > | startMeteredUseByLicenseKeyNoParse (final String licenseKey, final Map< String, String > claims, final List< LicenseCheckoutArguments > consumptionArguments) |
List< String > | heartbeatLicenseNoParse (final Map< String, String > claims, final List< LicenseHeartbeatArguments > consumptionArguments) |
List< String > | heartbeatMeteredLicenseNoParse (final Map< String, String > claims, final List< LicenseHeartbeatArguments > consumptionArguments) |
List< String > | heartbeatLicenseNoParse (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > consumptionArguments) |
List< String > | heartbeatMeteredLicenseNoParse (final Map< String, String > claims, final String licenseKey, final List< LicenseHeartbeatArguments > consumptionArguments) |
List< JwtToken > | parseJwtArrayResponse (final List< String > jwtStringArray) |
Parses a list of Strings as a List of JWT's. | |
JwtToken | parseJwtString (final String jwtString) |
Parses a String as a JWT. | |
Map< String, String > | buildRequestHeaders (final Map< String, String > initialHeaders, final RequestHeadersSettings settings) |
Builds general header(s) to include in an API HTTP request, including authorization related header(s). | |
void | buildAuthorizationHeader (final Map< String, String > headers, final RequestHeadersSettings settings) |
Builds authorization related header(s) to include in an API HTTP request. | |
Protected Member Functions inherited from tenduke.scale.client.AbstractRestApiClient | |
AbstractRestApiClient (final AuthorizationProvider authzBearerProvider, final TendukeScaleConfig config) | |
Initializes a new instance of this class with a null tenduke.sdk.core.service.JwtSignatureVerifierKeyProvider and a new OkHttpClient with internal default configuration options (15 sec. | |
AbstractRestApiClient (final AuthorizationProvider authzBearerProvider, final TendukeScaleConfig config, final OkHttpClient okHttpClient) | |
Initializes a new instance of this class. | |
void | logErrorResponse (final Response response, final String entityType, final String action, final Logger logger) throws IOException |
Logs an error response. | |
void | logErrorResponse (final ApiException apiException, final String entityType, final String action, final Logger logger) |
Logs an error response. | |
String | extractBaseUrl () |
Validates and extracts the 10Duke Scale base URL from previously provided TendukeScaleConfig . | |
Package Functions | |
LicenseCheckoutHttpClient (final AuthorizationProvider authzBearerProvider, final JwtServiceProvider jwtServiceProvider, final TendukeScaleConfig config, final OkHttpClient okHttpClient, final ObjectMapper mapper) | |
Initializes a new instance of this class. | |
private< R > R | executeOrApiException (final RestApiCallExecArgs< R > callArgs) |
Makes a REST API call according to the call arguments object. | |
private< T > T | validateResponseReturnApiObject (final okhttp3.Response rsp, final JavaType apiObjectClass, final String apiObjectType, final String apiOperation, final String apiExceptionMessageTemplate) throws IOException |
Validates the response status to match success. | |
|
package |
Initializes a new instance of this class.
authzBearerProvider | AuthorizationProvider is called when a new value for HTTP Authorization header is needed. May be null if only license key based API interaction is used. |
jwtServiceProvider | Service provider used when handling JWT parsing and verification. |
config | The configuration to use for the 10Duke Scale base URL and settings for HTTP client. |
okHttpClient | An instance of OkHttpClient to use for making HTTP requests. If a null value is provided then a new OkHttpClient with internal default configuration options (15 sec. timeout for connect, call, read and write). |
mapper | A Jackson ObjectMapper that is used to serialize objects into a request body and to deserialize objects from response payload. |
|
protected |
Builds authorization related header(s) to include in an API HTTP request.
headers | Map with all headers, the authorization header(s) will be added into this map. |
settings | Authorization header options. |
|
protected |
Builds general header(s) to include in an API HTTP request, including authorization related header(s).
initialHeaders | Map with headers that have been predefined, The contents of this map will be added to the return value including the authorization header(s) built as part of this method. |
settings | Authorization header options. |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.checkoutLicense | ( | final Map< String, String > | claims, |
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Checkout a license using Open ID Connect API authorization (OIDC, identity based licensing).
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. |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.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. |
|
protected |
|
protected |
LicenseConsumerClientBindingStatus tenduke.scale.client.LicenseCheckoutHttpClient.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 ) |
Finds a specific license consumption client binding.
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 a 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. |
LicenseConsumerClientBindingStatus tenduke.scale.client.LicenseCheckoutHttpClient.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. |
List< Licensee > tenduke.scale.client.LicenseCheckoutHttpClient.describeLicenseConsumerLicensees | ( | final UUID | licenseConsumerId, |
final int | offset, | ||
final int | maxCount, | ||
final String | orderBy, | ||
final boolean | asc ) |
Analyzes what licensees a license consumer is associated to.
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 who's licensee associations are returned. 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. |
LicenseConsumerLicensesStatus tenduke.scale.client.LicenseCheckoutHttpClient.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 license status to determine likely outcome if trying to use licenses.
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. Paging detail: the offset and limit values apply to license data. The maximum number or client binding information included in the response is 5. Paging all client bindings can be done by using describeLicenseConsumerClientBindings(...) or describeLicenseClientBindings(...) depending on aspect license consumer aspect vs. license aspect. NOTE: paging parameters apply to licenses (the main level of data in the response). In other words, paging does not effect 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 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. 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. |
LicenseKeyLicensesStatus tenduke.scale.client.LicenseCheckoutHttpClient.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.
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. Defaults to false. |
FeatureFlagsResponse tenduke.scale.client.LicenseCheckoutHttpClient.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 |
String tenduke.scale.client.LicenseCheckoutHttpClient.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 |
List< LicenseReleaseResult > tenduke.scale.client.LicenseCheckoutHttpClient.endMeteredLicenseUse | ( | final Map< String, String > | claims, |
final List< LicenseReleaseArguments > | releaseArguments ) |
List< LicenseReleaseResult > tenduke.scale.client.LicenseCheckoutHttpClient.endMeteredLicenseUse | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseReleaseArguments > | releaseArguments ) |
|
package |
Makes a REST API call according to the call arguments object.
<R> | Type of return value from the call. |
callArgs | The specification of the call to make. |
LicenseConsumerClientBindingStatus tenduke.scale.client.LicenseCheckoutHttpClient.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. |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.heartbeatLicense | ( | final Map< String, String > | claims, |
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.heartbeatLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
|
protected |
|
protected |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.heartbeatMeteredLicense | ( | final Map< String, String > | claims, |
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.heartbeatMeteredLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseHeartbeatArguments > | heartbeatArguments ) |
|
protected |
|
protected |
|
protected |
Parses a list of Strings as a List of JWT's.
NOTE: does not perform verification of the JWT's.
jwtStringArray | The list of String to parse. |
|
protected |
Parses a String as a JWT.
NOTE: does not perform verification of the JWT.
jwtString | The String to parse as a JWT. |
List< LicenseReleaseResult > tenduke.scale.client.LicenseCheckoutHttpClient.releaseLicense | ( | final Map< String, String > | claims, |
final List< LicenseReleaseArguments > | releaseArguments ) |
List< LicenseReleaseResult > tenduke.scale.client.LicenseCheckoutHttpClient.releaseLicense | ( | final Map< String, String > | claims, |
final String | licenseKey, | ||
final List< LicenseReleaseArguments > | releaseArguments ) |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.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. |
|
protected |
List< JwtToken > tenduke.scale.client.LicenseCheckoutHttpClient.startMeteredUseOfLicense | ( | final Map< String, String > | claims, |
final List< LicenseCheckoutArguments > | consumptionArguments ) |
Starts metered use of a license using Open ID Connect API authorization (OIDC, identity based licensing).
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. |
|
protected |
AuthorizationProvider tenduke.scale.client.LicenseCheckoutHttpClient.switchAuthzJwtProviders | ( | final AuthorizationProvider | toProvider | ) |
Changes the current authorization header JWT provider to a new one.
toProvider | New provider. |
|
package |
Validates the response status to match success.
If response does not match success a call to log info and to throw an ApiException is made. The API response object(s) are returned for successful responses.
<T> | Type of response API object. |
rsp | The API response. |
apiObjectClass | The Java type to map the response body to. |
apiObjectType | Name of the API object expected as response, used for logging and exception info purpose. |
apiOperation | Name of the operation being called, used for logging and exception info purpose. |
apiExceptionMessageTemplate | A message that is appended with the HTTP response status code (template + "status: " + response code). |
IOException | For IO errors while handling response. |