10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::ee::licensing::impl::StatefulLicensingClient Class Reference

#include <StatefulLicensingClient.h>

Detailed Description

A tenduke::ee::licensing::LicensingClient, which automatically maintains OIDC-login session.

Before each request, the client checks that the OIDC-login state is valid. If not, the client refreshes the session or re-logins the user. In case the licensing request failed because of invalid credentials (most typically because the local OIDC-login state is out of sync with the backend), the client re-establishes the OIDC-login state and re-executes the licensing request automatically.

This means that the application developer does not need to manually activate login or refresh the session: All this happens automatically.

If you want to be notified of when session events (e.g. when login is starting), register a tenduke::oidc::OIDCSessionEventListener. For details, see function createClientUsingAutodiscovery(const std::string &,const std::string &,const std::string &,const ::tenduke::oidc::osbrowser::BrowserAuthenticationConfig &,const std::string &,const ::tenduke::ServiceConfiguration &). Full example is available in identity_based_client.cpp.

If you don't want automatic user session management, you may want to use tenduke::ee::licensing::authzapi::DefaultAuthzLicensingClient.

Inheritance diagram for tenduke::ee::licensing::impl::StatefulLicensingClient:
tenduke::ee::licensing::LicensingClient

Public Member Functions

 StatefulLicensingClient (const std::shared_ptr< const tenduke::ee::licensing::LicensingConfiguration > &configuration, const std::shared_ptr< const tenduke::ee::licensing::authzapi::AuthzLicensingClient > &authzApi, const std::shared_ptr< tenduke::oidc::OIDCSession > &oidcSession)
 Constructs new instance.
 
tenduke::ee::licensing::LicenseCheckoutResponse checkoutLicenses (const tenduke::ee::licensing::LicenseCheckoutParameters &parameters) const override
 Checks out license(s).
 
tenduke::ee::licensing::FluentLicenseCheckout checkoutLicenses () const override
 Checks out license(s) fluently.
 
tenduke::ee::licensing::LicenseReleaseResponse releaseLicenses (const tenduke::ee::licensing::LicenseReleaseParameters &parameters) const override
 Releases checked out license(s).
 
tenduke::ee::licensing::FluentLicenseRelease releaseLicenses () const override
 Releases checked out license(s) fluently.
 
::tenduke::ee::licensing::LicenseRenewResponse renewLeases (const ::tenduke::ee::licensing::LicenseRenewParameters &parameters) const override
 Renews leases.
 
::tenduke::ee::licensing::FluentLicenseRenew renewLeases () const override
 Renews leases fluently.
 

Constructor & Destructor Documentation

◆ StatefulLicensingClient()

tenduke::ee::licensing::impl::StatefulLicensingClient::StatefulLicensingClient ( const std::shared_ptr< const tenduke::ee::licensing::LicensingConfiguration > &  configuration,
const std::shared_ptr< const tenduke::ee::licensing::authzapi::AuthzLicensingClient > &  authzApi,
const std::shared_ptr< tenduke::oidc::OIDCSession > &  oidcSession 
)

Constructs new instance.

Parameters
configuration-
authzApi-
oidcSession-

Member Function Documentation

◆ checkoutLicenses() [1/2]

FluentLicenseCheckout tenduke::ee::licensing::impl::StatefulLicensingClient::checkoutLicenses ( ) const
overridevirtual

Checks out license(s) fluently.

See the tenduke::ee::licensing::FluentLicenseCheckout (and its superclass) for complete set of parameters.

Returns
checkoutLicenses builder

Implements tenduke::ee::licensing::LicensingClient.

◆ checkoutLicenses() [2/2]

tenduke::ee::licensing::LicenseCheckoutResponse tenduke::ee::licensing::impl::StatefulLicensingClient::checkoutLicenses ( const tenduke::ee::licensing::LicenseCheckoutParameters parameters) const
overridevirtual

Checks out license(s).

Parameters
parametersthe request parameters
Returns
the result
Exceptions
tenduke::TendukeExceptionand subclasses. See class documentation.

Implements tenduke::ee::licensing::LicensingClient.

◆ releaseLicenses() [1/2]

FluentLicenseRelease tenduke::ee::licensing::impl::StatefulLicensingClient::releaseLicenses ( ) const
overridevirtual

Releases checked out license(s) fluently.

See the tenduke::ee::licensing::FluentLicenseRelease (and its superclass) for complete set of parameters.

Returns
release builder

Implements tenduke::ee::licensing::LicensingClient.

◆ releaseLicenses() [2/2]

tenduke::ee::licensing::LicenseReleaseResponse tenduke::ee::licensing::impl::StatefulLicensingClient::releaseLicenses ( const tenduke::ee::licensing::LicenseReleaseParameters parameters) const
overridevirtual

Releases checked out license(s).

Parameters
parametersthe request parameters
Returns
the result
Exceptions
tenduke::TendukeExceptionand subclasses. See class documentation.

Implements tenduke::ee::licensing::LicensingClient.

◆ renewLeases() [1/2]

FluentLicenseRenew tenduke::ee::licensing::impl::StatefulLicensingClient::renewLeases ( ) const
overridevirtual

Renews leases fluently.

See tenduke::ee::licensing::LicensingClient::renewLeases(const tenduke::ee::licensing::LicenseRenewParameters &) const for details.

Returns
renew-leases builder

Implements tenduke::ee::licensing::LicensingClient.

◆ renewLeases() [2/2]

LicenseRenewResponse tenduke::ee::licensing::impl::StatefulLicensingClient::renewLeases ( const ::tenduke::ee::licensing::LicenseRenewParameters parameters) const
overridevirtual

Renews leases.

NOTE: Renewal returns new leases (i.e. leases with new lease ID), these leases replace the original leases.

Parameters
parametersthe request parameters
Returns
the result
Exceptions
tenduke::TendukeExceptionand subclasses. See class documentation.

Implements tenduke::ee::licensing::LicensingClient.


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