10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::se::licensing::DefaultLicensingClient Class Reference

#include <DefaultLicensingClient.h>

Detailed Description

Default implementation of tenduke::se::licensing::LicensingClient.

This implementation maintains OIDC-state automatically: If the OIDC state has expired, it first tries to refresh the state and if refresh fails then it re-logins the user. Also, if the request fails because of HTTP 401 Unauthorized, it does the same refresh-if-fails-re-login -routine.

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

Public Member Functions

 DefaultLicensingClient (const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidc, const std::shared_ptr<::tenduke::se::licensing::rest::ScaleLicensingApi > &restApi, const std::shared_ptr<::tenduke::se::licensing::MutableLeases > &leases)
 Constructs new instance.
 
::tenduke::se::licensing::LicenseCheckoutResponse checkoutLicenses (const ::tenduke::se::licensing::LicenseCheckoutParameters &parameters) const override
 Checks out licenses.
 
::tenduke::se::licensing::FluentLicenseCheckout checkoutLicenses () const override
 Starts fluent license checkout.
 
::tenduke::se::licensing::LicenseCheckoutResponse checkoutLicensesWithKey (const std::string &licenseKey, const ::tenduke::se::licensing::LicenseCheckoutParameters &parameters) const override
 Checks out licenses with license key.
 
::tenduke::se::licensing::FluentLicenseCheckout checkoutLicensesWithKey (const std::string &licenseKey) const override
 Starts fluent license checkout with license key.
 
::tenduke::se::licensing::LicenseKeyLicensesStatus describeLicenseKey (const std::string &licenseKey, const ::tenduke::se::Paging &paging, bool withMetadata) const override
 Describe license key.
 
::tenduke::se::licensing::LicenseKeyLicensesStatus describeLicenseKey (const std::string &licenseKey) const override
 Describe license key.
 
::tenduke::se::licensing::LicenseHeartbeatResponse heartbeatLicenses (const ::tenduke::se::licensing::LicenseHeartbeatParameters &parameters) const override
 Heartbeats licenses.
 
::tenduke::se::licensing::FluentLicenseHeartbeat heartbeatLicenses () const override
 Starts fluent license heartbeat.
 
::tenduke::se::licensing::LicenseReleaseResponse releaseLicenses (const ::tenduke::se::licensing::LicenseReleaseParameters &parameters) const override
 Releases licenses.
 
::tenduke::se::licensing::FluentLicenseRelease releaseLicenses () const override
 Starts fluent license release.
 
::tenduke::se::licensing::StartMeteredUseResponse startMeteredLicenseUse (const ::tenduke::se::licensing::StartMeteredUseParameters &parameters) const override
 Starts metered license use.
 
::tenduke::se::licensing::FluentStartMeteredUse startMeteredLicenseUse () const override
 Starts fluently building "start-metered-license-use"-request.
 
::tenduke::se::licensing::StartMeteredUseResponse startMeteredLicenseUseWithKey (const std::string &licenseKey, const ::tenduke::se::licensing::StartMeteredUseParameters &parameters) const override
 Starts metered license use with license key.
 
::tenduke::se::licensing::FluentStartMeteredUse startMeteredLicenseUseWithKey (const std::string &licenseKey) const override
 Starts fluently building "start-metered-license-use-with-license-key"-request.
 

Constructor & Destructor Documentation

◆ DefaultLicensingClient()

tenduke::se::licensing::DefaultLicensingClient::DefaultLicensingClient ( const std::shared_ptr<::tenduke::oidc::OIDCSession > &  oidc,
const std::shared_ptr<::tenduke::se::licensing::rest::ScaleLicensingApi > &  restApi,
const std::shared_ptr<::tenduke::se::licensing::MutableLeases > &  leases 
)

Constructs new instance.

Parameters
oidcOIDC-session service
restApithe low-level API to access the 10Duke Scale licensing REST API
leaseslease-cache

Member Function Documentation

◆ checkoutLicenses() [1/2]

FluentLicenseCheckout tenduke::se::licensing::DefaultLicensingClient::checkoutLicenses ( ) const
overridevirtual

Starts fluent license checkout.

Returns
the fluent license checkout builder

Implements tenduke::se::licensing::LicensingClient.

◆ checkoutLicenses() [2/2]

LicenseCheckoutResponse tenduke::se::licensing::DefaultLicensingClient::checkoutLicenses ( const ::tenduke::se::licensing::LicenseCheckoutParameters parameters) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ checkoutLicensesWithKey() [1/2]

FluentLicenseCheckout tenduke::se::licensing::DefaultLicensingClient::checkoutLicensesWithKey ( const std::string &  licenseKey) const
overridevirtual

Starts fluent license checkout with license key.

Parameters
licenseKeythe license key
Returns
the fluent license checkout builder

Implements tenduke::se::licensing::LicensingClient.

◆ checkoutLicensesWithKey() [2/2]

LicenseCheckoutResponse tenduke::se::licensing::DefaultLicensingClient::checkoutLicensesWithKey ( const std::string &  licenseKey,
const ::tenduke::se::licensing::LicenseCheckoutParameters parameters 
) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ describeLicenseKey() [1/2]

LicenseKeyLicensesStatus tenduke::se::licensing::DefaultLicensingClient::describeLicenseKey ( const std::string &  licenseKey) const
overridevirtual

Describe license key.

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

Parameters
licenseKey-
Returns
license key status

Implements tenduke::se::licensing::LicensingClient.

◆ describeLicenseKey() [2/2]

LicenseKeyLicensesStatus tenduke::se::licensing::DefaultLicensingClient::describeLicenseKey ( const std::string &  licenseKey,
const ::tenduke::se::Paging paging,
bool  withMetadata 
) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ heartbeatLicenses() [1/2]

FluentLicenseHeartbeat tenduke::se::licensing::DefaultLicensingClient::heartbeatLicenses ( ) const
overridevirtual

Starts fluent license heartbeat.

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

Returns
the fluent license heartbeat builder

Implements tenduke::se::licensing::LicensingClient.

◆ heartbeatLicenses() [2/2]

LicenseHeartbeatResponse tenduke::se::licensing::DefaultLicensingClient::heartbeatLicenses ( const ::tenduke::se::licensing::LicenseHeartbeatParameters parameters) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ releaseLicenses() [1/2]

FluentLicenseRelease tenduke::se::licensing::DefaultLicensingClient::releaseLicenses ( ) const
overridevirtual

Starts fluent license release.

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

Returns
the fluent license release builder

Implements tenduke::se::licensing::LicensingClient.

◆ releaseLicenses() [2/2]

LicenseReleaseResponse tenduke::se::licensing::DefaultLicensingClient::releaseLicenses ( const ::tenduke::se::licensing::LicenseReleaseParameters parameters) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ startMeteredLicenseUse() [1/2]

FluentStartMeteredUse tenduke::se::licensing::DefaultLicensingClient::startMeteredLicenseUse ( ) const
overridevirtual

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

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

Implements tenduke::se::licensing::LicensingClient.

◆ startMeteredLicenseUse() [2/2]

StartMeteredUseResponse tenduke::se::licensing::DefaultLicensingClient::startMeteredLicenseUse ( const ::tenduke::se::licensing::StartMeteredUseParameters parameters) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.

◆ startMeteredLicenseUseWithKey() [1/2]

FluentStartMeteredUse tenduke::se::licensing::DefaultLicensingClient::startMeteredLicenseUseWithKey ( const std::string &  licenseKey) const
overridevirtual

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

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

Implements tenduke::se::licensing::LicensingClient.

◆ startMeteredLicenseUseWithKey() [2/2]

StartMeteredUseResponse tenduke::se::licensing::DefaultLicensingClient::startMeteredLicenseUseWithKey ( const std::string &  licenseKey,
const ::tenduke::se::licensing::StartMeteredUseParameters parameters 
) const
overridevirtual

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

Implements tenduke::se::licensing::LicensingClient.


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