10Duke Scale C++ Client
All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
tenduke::se::licensing::LicensingClient Class Referenceabstract

#include <LicensingClient.h>

Detailed Description

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:

std_shared_ptr<::tenduke::se::TendukeClient> client = ...;
auto result = client->licensing->release()
.leases(client->leases->getAllLeases())
.execute();

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.

Inheritance diagram for tenduke::se::licensing::LicensingClient:
tenduke::se::licensing::DefaultLicensingClient

Public Member Functions

virtual::tenduke::se::licensing::LicenseCheckoutResponse checkoutLicenses (const ::tenduke::se::licensing::LicenseCheckoutParameters &parameters) const =0
 Checks out licenses.
 
virtual::tenduke::se::licensing::LicenseCheckoutResponse checkoutLicensesWithKey (const std::string &licenseKey, const ::tenduke::se::licensing::LicenseCheckoutParameters &parameters) const =0
 Checks out licenses with license key.
 
virtual::tenduke::se::licensing::FluentLicenseCheckout checkoutLicenses () const =0
 Starts fluent license checkout.
 
virtual::tenduke::se::licensing::FluentLicenseCheckout checkoutLicensesWithKey (const std::string &licenseKey) const =0
 Starts fluent license checkout with license key.
 
virtual::tenduke::se::licensing::LicenseKeyLicensesStatus describeLicenseKey (const std::string &licenseKey, const ::tenduke::se::Paging &paging, bool withMetadata) const =0
 Describe license key.
 
virtual::tenduke::se::licensing::LicenseKeyLicensesStatus describeLicenseKey (const std::string &licenseKey) const =0
 Describe license key.
 
virtual::tenduke::se::licensing::LicenseHeartbeatResponse heartbeatLicenses (const ::tenduke::se::licensing::LicenseHeartbeatParameters &parameters) const =0
 Heartbeats licenses.
 
virtual::tenduke::se::licensing::FluentLicenseHeartbeat heartbeatLicenses () const =0
 Starts fluent license heartbeat.
 
virtual::tenduke::se::licensing::LicenseReleaseResponse releaseLicenses (const ::tenduke::se::licensing::LicenseReleaseParameters &parameters) const =0
 Releases licenses.
 
virtual::tenduke::se::licensing::FluentLicenseRelease releaseLicenses () const =0
 Starts fluent license release.
 
virtual::tenduke::se::licensing::StartMeteredUseResponse startMeteredLicenseUse (const ::tenduke::se::licensing::StartMeteredUseParameters &parameters) const =0
 Starts metered license use.
 
virtual::tenduke::se::licensing::StartMeteredUseResponse startMeteredLicenseUseWithKey (const std::string &licenseKey, const ::tenduke::se::licensing::StartMeteredUseParameters &parameters) const =0
 Starts metered license use with license key.
 
virtual::tenduke::se::licensing::FluentStartMeteredUse startMeteredLicenseUse () const =0
 Starts fluently building "start-metered-license-use"-request.
 
virtual::tenduke::se::licensing::FluentStartMeteredUse startMeteredLicenseUseWithKey (const std::string &licenseKey) const =0
 Starts fluently building "start-metered-license-use-with-license-key"-request.
 

Member Function Documentation

◆ checkoutLicenses() [1/2]

virtual::tenduke::se::licensing::FluentLicenseCheckout tenduke::se::licensing::LicensingClient::checkoutLicenses ( ) const
pure virtual

Starts fluent license checkout.

Returns
the fluent license checkout builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ checkoutLicenses() [2/2]

virtual::tenduke::se::licensing::LicenseCheckoutResponse tenduke::se::licensing::LicensingClient::checkoutLicenses ( const ::tenduke::se::licensing::LicenseCheckoutParameters & parameters) const
pure virtual

Checks out licenses.

Parameters
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ checkoutLicensesWithKey() [1/2]

virtual::tenduke::se::licensing::FluentLicenseCheckout tenduke::se::licensing::LicensingClient::checkoutLicensesWithKey ( const std::string & licenseKey) const
pure virtual

Starts fluent license checkout with license key.

Parameters
licenseKeythe license key
Returns
the fluent license checkout builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ checkoutLicensesWithKey() [2/2]

virtual::tenduke::se::licensing::LicenseCheckoutResponse tenduke::se::licensing::LicensingClient::checkoutLicensesWithKey ( const std::string & licenseKey,
const ::tenduke::se::licensing::LicenseCheckoutParameters & parameters ) const
pure virtual

Checks out licenses with license key.

Parameters
licenseKeythe license key
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ describeLicenseKey() [1/2]

virtual::tenduke::se::licensing::LicenseKeyLicensesStatus tenduke::se::licensing::LicensingClient::describeLicenseKey ( const std::string & licenseKey) const
pure virtual

Describe license key.

Overload, which provides default values for parameters paging and withMetadata.

Parameters
licenseKey-
Returns
license key status

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ describeLicenseKey() [2/2]

virtual::tenduke::se::licensing::LicenseKeyLicensesStatus tenduke::se::licensing::LicensingClient::describeLicenseKey ( const std::string & licenseKey,
const ::tenduke::se::Paging & paging,
bool withMetadata ) const
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.

Parameters
licenseKey-
paging-
withMetadata-
Returns
license key status

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ heartbeatLicenses() [1/2]

virtual::tenduke::se::licensing::FluentLicenseHeartbeat tenduke::se::licensing::LicensingClient::heartbeatLicenses ( ) const
pure virtual

Starts fluent license heartbeat.

This method is used also to heartbeat metered leases (created from startMeteredLicenseUse*())

Returns
the fluent license heartbeat builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ heartbeatLicenses() [2/2]

virtual::tenduke::se::licensing::LicenseHeartbeatResponse tenduke::se::licensing::LicensingClient::heartbeatLicenses ( const ::tenduke::se::licensing::LicenseHeartbeatParameters & parameters) const
pure virtual

Heartbeats licenses.

This method is used also to heartbeat metered leases (created from startMeteredLicenseUse*())

Parameters
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ releaseLicenses() [1/2]

virtual::tenduke::se::licensing::FluentLicenseRelease tenduke::se::licensing::LicensingClient::releaseLicenses ( ) const
pure virtual

Starts fluent license release.

This method is used also to release metered leases (created from startMeteredLicenseUse*())

Returns
the fluent license release builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ releaseLicenses() [2/2]

virtual::tenduke::se::licensing::LicenseReleaseResponse tenduke::se::licensing::LicensingClient::releaseLicenses ( const ::tenduke::se::licensing::LicenseReleaseParameters & parameters) const
pure virtual

Releases licenses.

This method is used also to release metered leases (created from startMeteredLicenseUse*())

Parameters
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ startMeteredLicenseUse() [1/2]

virtual::tenduke::se::licensing::FluentStartMeteredUse tenduke::se::licensing::LicensingClient::startMeteredLicenseUse ( ) const
pure virtual

Starts fluently building "start-metered-license-use"-request.

Returns
the fluent "start-metered-license-use"-builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ startMeteredLicenseUse() [2/2]

virtual::tenduke::se::licensing::StartMeteredUseResponse tenduke::se::licensing::LicensingClient::startMeteredLicenseUse ( const ::tenduke::se::licensing::StartMeteredUseParameters & parameters) const
pure virtual

Starts metered license use.

Parameters
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ startMeteredLicenseUseWithKey() [1/2]

virtual::tenduke::se::licensing::FluentStartMeteredUse tenduke::se::licensing::LicensingClient::startMeteredLicenseUseWithKey ( const std::string & licenseKey) const
pure virtual

Starts fluently building "start-metered-license-use-with-license-key"-request.

Parameters
licenseKeythe license key
Returns
the fluent "start-metered-license-use"-builder

Implemented in tenduke::se::licensing::DefaultLicensingClient.

◆ startMeteredLicenseUseWithKey() [2/2]

virtual::tenduke::se::licensing::StartMeteredUseResponse tenduke::se::licensing::LicensingClient::startMeteredLicenseUseWithKey ( const std::string & licenseKey,
const ::tenduke::se::licensing::StartMeteredUseParameters & parameters ) const
pure virtual

Starts metered license use with license key.

Parameters
licenseKeythe license key
parameters-
Returns
-
Exceptions
tenduke::net::NetworkingException(and subclasses) on networking issues (no network, host not found etc)
tenduke::jwt::JWTValidationExceptionwhen any returned license token fails to validate
tenduke::se::http::APIException(and subclasses) when the request failed

Implemented in tenduke::se::licensing::DefaultLicensingClient.


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