10Duke Scale C++ Client
|
#include <LicensingClient.h>
Client for licensing operations.
This service performs licensing operations. Most operations have two different signatures: One with parameters and another which starts a fluent operation i.e. building the request parameters fluently.
The methods report "request-level" errors with exceptions. Some examples of "request-level" errors are missing/invalid credentials or rate limiting. All methods (including the execute()
-methods from fluent calls) may throw exceptions. NOTE: For catch-all you may want to catch tenduke::TendukeException
, from which all the thrown exceptions inherit.
For checkout/heartbeat/release -operations failure for individual argument is reported as an error in errors
-vector in the response. For example, if you try to checkout a seat from a license that has already all seats checked out, no exception would be thrown: The request would succeed and the LicenseCheckoutResponse.errors
- vector would have an error describing the issue. This means that an operation can partially succeed and fail at the same time: Some of the licenses might be successfully checked out and some might have failed. The developer should always check the result of the operation to verify that the request was succesful, for example using method hasErrors()
.
The client maintains a local cache of acquired leases. The cache is private within this service, but can be accessed via tenduke::se::TendukeClient.leases
.
IMPORTANT NOTE: Any leases acquired, regardless of how they are obtained (checkoutLicenses
or startMeteredLicenseUse
with or without license key), are universally heartbeat or released using same API (methods heartbeatLicenses
or releaseLicenses
). The leases MUST be present in the local cache or std::out_of_range
exception is thrown. If you must heartbeat or release leases not present in the local cache, use the lower-level tenduke::se::licensing::rest::ScaleLicensingApi
.
If you want to release all leases of licenses you have checked out, you could do for example:
IMPORTANT NOTE: Heartbeat will change the lease-id. The lease returned from heartbeat-operation stores the original lease id in field tenduke::se::licensing::Lease.oldLeaseId
.
|
pure virtual |
Starts fluent license checkout.
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Checks out licenses.
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts fluent license checkout with license key.
licenseKey | the license key |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Checks out licenses with license key.
licenseKey | the license key |
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Describe license key.
Overload, which provides default values for parameters paging
and withMetadata
.
licenseKey | - |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Describe license key.
Describes licenses that a license key grants usage rights to. This endpoint can be called using only a license key. Current use of licenses checked out using a license key (client bindings) can be requested at: /actions/describe-license-key-client-bindings. Paging detail: The common case is having one or only a few licenses per license key. That means paging is likely not needed and requests to this endpoint can omit using offset and limit in that case.
licenseKey | - |
paging | - |
withMetadata | - |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts fluent license heartbeat.
This method is used also to heartbeat metered leases (created from startMeteredLicenseUse*()
)
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Heartbeats licenses.
This method is used also to heartbeat metered leases (created from startMeteredLicenseUse*()
)
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts fluent license release.
This method is used also to release metered leases (created from startMeteredLicenseUse*()
)
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Releases licenses.
This method is used also to release metered leases (created from startMeteredLicenseUse*()
)
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts fluently building "start-metered-license-use"-request.
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts metered license use.
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts fluently building "start-metered-license-use-with-license-key"-request.
licenseKey | the license key |
Implemented in tenduke::se::licensing::DefaultLicensingClient.
|
pure virtual |
Starts metered license use with license key.
licenseKey | the license key |
parameters | - |
tenduke::net::NetworkingException | (and subclasses) on networking issues (no network, host not found etc) |
tenduke::jwt::JWTValidationException | when any returned license token fails to validate |
tenduke::se::http::APIException | (and subclasses) when the request failed |
Implemented in tenduke::se::licensing::DefaultLicensingClient.