10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::se::licensing::BaseRequest< R > Class Template Reference

#include <BaseRequest.h>

Detailed Description

template<class R>
class tenduke::se::licensing::BaseRequest< R >

High-level licensing client request.

Used internally to share functionality.

This request contains delegate to actual request, lease-cache, and optional OIDCSession.

On execution the request:

  1. maintains OIDC-session, if any
  2. executes the delegate request
  3. updates the lease cache with the response from the delegate request (subclasses must implement this)
  4. returns the response from the delegate request
Template Parameters
Rtype of the result
Inheritance diagram for tenduke::se::licensing::BaseRequest< R >:
tenduke::se::licensing::CheckoutRequest< R > tenduke::se::licensing::HeartbeatRequest< R > tenduke::se::licensing::ReleaseRequest< R >

Public Member Functions

 BaseRequest (const std::shared_ptr<::tenduke::se::APIRequest< R > > &request, const std::shared_ptr<::tenduke::se::licensing::MutableLeases > &leases, const std::shared_ptr<::tenduke::oidc::OIDCSession > &oidc=nullptr)
 Constructs new instance.
 
virtual R execute ()
 Executes the request.
 

Protected Member Functions

virtual R executeRequest ()
 Executes the request.
 
virtual void maintainLeases (const R &response)
 Performs lease-cache maintenance.
 

Protected Attributes

const std::shared_ptr<::tenduke::se::licensing::MutableLeasesleases
 The lease cache.
 

Constructor & Destructor Documentation

◆ BaseRequest()

template<class R >
tenduke::se::licensing::BaseRequest< R >::BaseRequest ( const std::shared_ptr<::tenduke::se::APIRequest< R > > &  request,
const std::shared_ptr<::tenduke::se::licensing::MutableLeases > &  leases,
const std::shared_ptr<::tenduke::oidc::OIDCSession > &  oidc = nullptr 
)
inline

Constructs new instance.

Parameters
requestthe wrapped request, which performs the actual API call
leaseslease cache
oidcOIDC-session

Member Function Documentation

◆ execute()

template<class R >
virtual R tenduke::se::licensing::BaseRequest< R >::execute ( )
inlinevirtual

Executes the request.

Returns
-

◆ executeRequest()

template<class R >
virtual R tenduke::se::licensing::BaseRequest< R >::executeRequest ( )
inlineprotectedvirtual

Executes the request.

Returns
-

◆ maintainLeases()

template<class R >
virtual void tenduke::se::licensing::BaseRequest< R >::maintainLeases ( const R response)
inlineprotectedvirtual

Performs lease-cache maintenance.

This is empty method for subclasses to implement.

Parameters
response-

Reimplemented in tenduke::se::licensing::CheckoutRequest< R >, tenduke::se::licensing::HeartbeatRequest< R >, and tenduke::se::licensing::ReleaseRequest< R >.


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