10Duke Scale C++ Client
Loading...
Searching...
No Matches
Lease Class Reference

#include <Lease.h>

Detailed Description

Lease of a license.

Lease is a result of successful license checkout operation.

Public Member Functions

 Lease ()
 No-arg constructs new instance.
 
 Lease (std::string id, std::int64_t expiresEpochS, std::int64_t issuedAtEpochS, std::int64_t timeOfEventEpochS, std::string status, std::string leaseId, std::string oldLeaseId, std::int64_t heartbeatNotBeforeEpochS, std::string productName, std::string productConfigurationName, std::string licenseId, std::int64_t licenseValidFromEpochS, std::string allowedVersionLowerBound, std::string allowedVersionUpperBound, std::string type, int64_t preallocatedQuantity, int64_t verifiedQuantity, std::string quantityDimension, const std::vector< std::string > &features, std::string licenseConsumerId, std::string licenseConsumerEmail, std::string licenseConsumerExternalReference, std::string licenseConsumerConnectedIdentityId, const std::map< std::string, std::string > &clientClaims, std::string clientVersion, std::string token, std::string licenseKey, bool metered, std::string keyId)
 Constructs new nstance.
 
bool neverExpires () const
 Returns true if the lease never expires.
 
bool hasClientVersion () const
 Returns true if the lease has information about client version.
 

Public Attributes

const std::string id
 "jti" JWT ID: unique id of the license token, you may use this in the client application to prevent token replay
 
const std::int64_t expiresEpochS
 “exp” Expiration Time: marks the expiration time of the License and License Token as epoch seconds
 
const std::int64_t issuedAtEpochS
 “iat” Issued At: marks the time the License Token was issued.
 
const std::int64_t timeOfEventEpochS
 "toe” Time of Event: the checkout / last heartbeat timestamp recorded for the license checkout
 
const std::string status
 "status" Status flag: “success” or “error” indicating if the checkout succeeded or failed
 
const std::string leaseId
 "leaseId" Unique identifier of the current license checkout.
 
const std::string oldLeaseId
 "oldLeaseId" Heartbeats generate new lease id.
 
const std::int64_t heartbeatNotBeforeEpochS
 "hbnbf" Heartbeat not before: the earliest allowed time when a checkout can be heartbeat.
 
const std::string productName
 "productName" Name of the product that the license allows to use.
 
const std::string productConfigurationName
 "productConfigurationName" Name of the product configuration used to create the license.
 
const std::string licenseId
 Id of the license.
 
const std::int64_t licenseValidFromEpochS
 "licenseValidFrom": Defines the date-time when license validity starts.
 
const std::string allowedVersionLowerBound
 "allowedVersionLowerBound": Lower bound of allowed client application version.
 
const std::string allowedVersionUpperBound
 "allowedVersionUpperBound": Upper bound of allowed client application version.
 
const std::string type
 "type" License type: DYNAMIC_PRODUCT or PRECONFIGURED_PRODUCT.
 
const std::int64_t preallocatedQuantity
 “qtyPrealloc” Quantity that was preallocated at time of checkout, applicable for use count and use time based licenses.
 
const std::int64_t verifiedQuantity
 “qtyVerified” Quantity that has been verified to be used.
 
const std::string quantityDimension
 “qtyDimension” Describes the quantity dimension of the licenses.
 
const std::vector< std::string > features
 “features” An array specifying what features the license enables.
 
const std::string licenseConsumerId
 “licenseConsumerId” Identifier of the license consumer that checked out the licenses.
 
const std::string licenseConsumerEmail
 “licenseConsumerEmail” Email of the license consumer that checked out the licenses.
 
const std::string licenseConsumerExternalReference
 “licenseConsumerExternalReference” External reference identifier of the license consumer that checked out the licenses.
 
const std::string licenseConsumerConnectedIdentityId
 “licenseConsumerConnectedIdentityId” Connected identity id of the license consumer that checked out the licenses.
 
const std::map< std::string, std::string > clientClaims
 “clientClaims” A map echoing back the claims used by the client application to checkout the license.
 
const std::string clientVersion
 "clientVersion" The version of the client application.
 
const std::string token
 Full token text from which this lease was parsed.
 
const std::string licenseKey
 License key used to checkout this lease.
 
const bool metered
 Was this lease checked out as metered?
 
const std::string keyId
 JWT validation key id (claim "jki" from the JWT header).
 

Static Public Attributes

static const std::int64_t NEVER_EXPIRES_EPOCH_S_MAGIC = INT64_MIN
 Magic value for "expiresEpochS" which indicates that the lease never expires.
 

Constructor & Destructor Documentation

◆ Lease()

tenduke::se::licensing::Lease::Lease ( std::string id,
std::int64_t expiresEpochS,
std::int64_t issuedAtEpochS,
std::int64_t timeOfEventEpochS,
std::string status,
std::string leaseId,
std::string oldLeaseId,
std::int64_t heartbeatNotBeforeEpochS,
std::string productName,
std::string productConfigurationName,
std::string licenseId,
std::int64_t licenseValidFromEpochS,
std::string allowedVersionLowerBound,
std::string allowedVersionUpperBound,
std::string type,
int64_t preallocatedQuantity,
int64_t verifiedQuantity,
std::string quantityDimension,
const std::vector< std::string > & features,
std::string licenseConsumerId,
std::string licenseConsumerEmail,
std::string licenseConsumerExternalReference,
std::string licenseConsumerConnectedIdentityId,
const std::map< std::string, std::string > & clientClaims,
std::string clientVersion,
std::string token,
std::string licenseKey,
bool metered,
std::string keyId )

Constructs new nstance.

Parameters
id-
expiresEpochS-
issuedAtEpochS-
timeOfEventEpochS-
status-
leaseId-
oldLeaseId-
heartbeatNotBeforeEpochS-
productName-
productConfigurationName-
licenseId-
licenseValidFromEpochS
allowedVersionLowerBound
allowedVersionUpperBound
type-
preallocatedQuantity-
verifiedQuantity-
quantityDimension-
features-
licenseConsumerId-
licenseConsumerEmail-
licenseConsumerExternalReference-
licenseConsumerConnectedIdentityId-
clientClaims-
token-
licenseKey-
metered-
keyId-
clientVersion-

Member Function Documentation

◆ hasClientVersion()

bool tenduke::se::licensing::Lease::hasClientVersion ( ) const

Returns true if the lease has information about client version.

Returns
-

◆ neverExpires()

bool tenduke::se::licensing::Lease::neverExpires ( ) const

Returns true if the lease never expires.

Returns
-

Member Data Documentation

◆ allowedVersionLowerBound

const std::string tenduke::se::licensing::Lease::allowedVersionLowerBound

"allowedVersionLowerBound": Lower bound of allowed client application version.

An empty value is interpreted as version = undefined (any version allowed).

◆ allowedVersionUpperBound

const std::string tenduke::se::licensing::Lease::allowedVersionUpperBound

"allowedVersionUpperBound": Upper bound of allowed client application version.

An empty value is interpreted as version = undefined (any version allowed).

◆ clientVersion

const std::string tenduke::se::licensing::Lease::clientVersion

"clientVersion" The version of the client application.

This claim is required when consuming licenses that have an allowed version range specified. We recommend that client applications always send their version.

◆ heartbeatNotBeforeEpochS

const std::int64_t tenduke::se::licensing::Lease::heartbeatNotBeforeEpochS

"hbnbf" Heartbeat not before: the earliest allowed time when a checkout can be heartbeat.

The value is in epoch seconds.

◆ leaseId

const std::string tenduke::se::licensing::Lease::leaseId

"leaseId" Unique identifier of the current license checkout.

This id will be unique to each checkout and heartbeat.

◆ licenseConsumerConnectedIdentityId

const std::string tenduke::se::licensing::Lease::licenseConsumerConnectedIdentityId

“licenseConsumerConnectedIdentityId” Connected identity id of the license consumer that checked out the licenses.

This claim is present only if such a value has been stored for the license consumer. Connected identity id = OpenID Connect user id.

◆ licenseConsumerEmail

const std::string tenduke::se::licensing::Lease::licenseConsumerEmail

“licenseConsumerEmail” Email of the license consumer that checked out the licenses.

This claim is present only if an email has been stored for the license consumer.

◆ licenseConsumerExternalReference

const std::string tenduke::se::licensing::Lease::licenseConsumerExternalReference

“licenseConsumerExternalReference” External reference identifier of the license consumer that checked out the licenses.

This claim is present only if such a value has been stored for the license consumer.

◆ licenseKey

const std::string tenduke::se::licensing::Lease::licenseKey

License key used to checkout this lease.

Empty if not checked with license key.

◆ metered

const bool tenduke::se::licensing::Lease::metered

Was this lease checked out as metered?

◆ oldLeaseId

const std::string tenduke::se::licensing::Lease::oldLeaseId

"oldLeaseId" Heartbeats generate new lease id.

On heartbeat-requests this tracks the original lease id.

◆ preallocatedQuantity

const std::int64_t tenduke::se::licensing::Lease::preallocatedQuantity

“qtyPrealloc” Quantity that was preallocated at time of checkout, applicable for use count and use time based licenses.

Value is always 0 for seat based licenses.

◆ productConfigurationName

const std::string tenduke::se::licensing::Lease::productConfigurationName

"productConfigurationName" Name of the product configuration used to create the license.

This claim is not present if the license is based on a dynamic feature licenses (in other words, license was not issued using a product configuration).

◆ productName

const std::string tenduke::se::licensing::Lease::productName

"productName" Name of the product that the license allows to use.

Value matches the name by which the license was checked out.

◆ quantityDimension

const std::string tenduke::se::licensing::Lease::quantityDimension

“qtyDimension” Describes the quantity dimension of the licenses.

Value is one of: SEATS, USE_COUNT, USE_TIME

◆ type

const std::string tenduke::se::licensing::Lease::type

"type" License type: DYNAMIC_PRODUCT or PRECONFIGURED_PRODUCT.

Value specifies if the license is based on a product configuration or if it was created by dynamically specifying product name and features on the fly.

◆ verifiedQuantity

const std::int64_t tenduke::se::licensing::Lease::verifiedQuantity

“qtyVerified” Quantity that has been verified to be used.

Value is always 1 for seat based licenses.


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