10Duke Scale C++ Client
Loading...
Searching...
No Matches
Lease.h
1#ifndef TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
2#define TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
3
4#include <cstdint>
5#include <map>
6#include <string>
7#include <vector>
8
9namespace tenduke { namespace se { namespace licensing {
10
16class Lease
17{
18public:
22 Lease();
23
56 Lease(std::string id
57 , std::int64_t expiresEpochS
58 , std::int64_t issuedAtEpochS
59 , std::int64_t timeOfEventEpochS
60 , std::string status
61 , std::string leaseId
62 , std::string oldLeaseId
63 , std::int64_t heartbeatNotBeforeEpochS
64 , std::string productName
65 , std::string productConfigurationName
66 , std::string licenseId
67 , std::int64_t licenseValidFromEpochS
68 , std::string allowedVersionLowerBound
69 , std::string allowedVersionUpperBound
70 , std::string type
71 , int64_t preallocatedQuantity
72 , int64_t verifiedQuantity
73 , std::string quantityDimension
74 , const std::vector<std::string> &features
75 , std::string licenseConsumerId
76 , std::string licenseConsumerEmail
79 , const std::map<std::string, std::string> &clientClaims
80 , std::string clientVersion
81 , std::string token
82 , std::string licenseKey
83 , bool metered
84 , std::string keyId
85 );
86
87public:
92 bool neverExpires() const;
93
98 bool hasClientVersion() const;
99
101 static const std::int64_t NEVER_EXPIRES_EPOCH_S_MAGIC = INT64_MIN;
102
103public:
104 // Standard + additional JWT claims
105
107 const std::string id;
109 const std::int64_t expiresEpochS;
111 const std::int64_t issuedAtEpochS;
113 const std::int64_t timeOfEventEpochS;
114
115 // 10Duke specific JWT claims
117 const std::string status;
119 const std::string leaseId;
121 const std::string oldLeaseId;
123 const std::int64_t heartbeatNotBeforeEpochS;
125 const std::string productName;
127 const std::string productConfigurationName;
129 const std::string licenseId;
131 const std::int64_t licenseValidFromEpochS;
133 const std::string allowedVersionLowerBound;
135 const std::string allowedVersionUpperBound;
137 const std::string type;
139 const std::int64_t preallocatedQuantity;
141 const std::int64_t verifiedQuantity;
143 const std::string quantityDimension;
145 const std::vector<std::string> features;
147 const std::string licenseConsumerId;
149 const std::string licenseConsumerEmail;
155 const std::map<std::string, std::string> clientClaims;
157 const std::string clientVersion;
158
159 // Additional fields describing the lease
160
162 const std::string token;
164 const std::string licenseKey;
166 const bool metered;
168 const std::string keyId;
169
170};
171
172}}}
173
174#endif //TENDUKE_SE_LICENSING_LICENSECHECKOUTRESPONSEITEM_H
Lease()
No-arg constructs new instance.
Definition Lease.cpp:19
const std::string licenseConsumerId
“licenseConsumerId” Identifier of the license consumer that checked out the licenses.
Definition Lease.h:147
const std::map< std::string, std::string > clientClaims
“clientClaims” A map echoing back the claims used by the client application to checkout the license.
Definition Lease.h:155
const std::string leaseId
"leaseId" Unique identifier of the current license checkout.
Definition Lease.h:119
const std::string licenseConsumerExternalReference
“licenseConsumerExternalReference” External reference identifier of the license consumer that checked...
Definition Lease.h:151
const std::string licenseConsumerEmail
“licenseConsumerEmail” Email of the license consumer that checked out the licenses.
Definition Lease.h:149
const std::string status
"status" Status flag: “success” or “error” indicating if the checkout succeeded or failed
Definition Lease.h:117
const std::string oldLeaseId
"oldLeaseId" Heartbeats generate new lease id.
Definition Lease.h:121
const std::int64_t issuedAtEpochS
“iat” Issued At: marks the time the License Token was issued.
Definition Lease.h:111
const std::string productConfigurationName
"productConfigurationName" Name of the product configuration used to create the license.
Definition Lease.h:127
const std::string clientVersion
"clientVersion" The version of the client application.
Definition Lease.h:157
const std::string keyId
JWT validation key id (claim "jki" from the JWT header).
Definition Lease.h:168
const std::string quantityDimension
“qtyDimension” Describes the quantity dimension of the licenses.
Definition Lease.h:143
const std::int64_t verifiedQuantity
“qtyVerified” Quantity that has been verified to be used.
Definition Lease.h:141
const std::string licenseConsumerConnectedIdentityId
“licenseConsumerConnectedIdentityId” Connected identity id of the license consumer that checked out t...
Definition Lease.h:153
const std::vector< std::string > features
“features” An array specifying what features the license enables.
Definition Lease.h:145
const std::int64_t timeOfEventEpochS
"toe” Time of Event: the checkout / last heartbeat timestamp recorded for the license checkout
Definition Lease.h:113
const std::string allowedVersionUpperBound
"allowedVersionUpperBound": Upper bound of allowed client application version.
Definition Lease.h:135
const std::string licenseId
Id of the license.
Definition Lease.h:129
const std::string token
Full token text from which this lease was parsed.
Definition Lease.h:162
const std::int64_t preallocatedQuantity
“qtyPrealloc” Quantity that was preallocated at time of checkout, applicable for use count and use ti...
Definition Lease.h:139
const std::int64_t licenseValidFromEpochS
"licenseValidFrom": Defines the date-time when license validity starts.
Definition Lease.h:131
const std::int64_t heartbeatNotBeforeEpochS
"hbnbf" Heartbeat not before: the earliest allowed time when a checkout can be heartbeat.
Definition Lease.h:123
const std::string licenseKey
License key used to checkout this lease.
Definition Lease.h:164
const std::string type
"type" License type: DYNAMIC_PRODUCT or PRECONFIGURED_PRODUCT.
Definition Lease.h:137
const std::int64_t expiresEpochS
“exp” Expiration Time: marks the expiration time of the License and License Token as epoch seconds
Definition Lease.h:109
const std::string allowedVersionLowerBound
"allowedVersionLowerBound": Lower bound of allowed client application version.
Definition Lease.h:133
const std::string productName
"productName" Name of the product that the license allows to use.
Definition Lease.h:125
const bool metered
Was this lease checked out as metered?
Definition Lease.h:166
Lease()
No-arg constructs new instance.
Definition Lease.cpp:19
bool neverExpires() const
Returns true if the lease never expires.
Definition Lease.cpp:7
const std::string licenseConsumerId
“licenseConsumerId” Identifier of the license consumer that checked out the licenses.
Definition Lease.h:147
const std::map< std::string, std::string > clientClaims
“clientClaims” A map echoing back the claims used by the client application to checkout the license.
Definition Lease.h:155
const std::string leaseId
"leaseId" Unique identifier of the current license checkout.
Definition Lease.h:119
const std::string licenseConsumerExternalReference
“licenseConsumerExternalReference” External reference identifier of the license consumer that checked...
Definition Lease.h:151
const std::string licenseConsumerEmail
“licenseConsumerEmail” Email of the license consumer that checked out the licenses.
Definition Lease.h:149
const std::string status
"status" Status flag: “success” or “error” indicating if the checkout succeeded or failed
Definition Lease.h:117
const std::string oldLeaseId
"oldLeaseId" Heartbeats generate new lease id.
Definition Lease.h:121
const std::int64_t issuedAtEpochS
“iat” Issued At: marks the time the License Token was issued.
Definition Lease.h:111
const std::string productConfigurationName
"productConfigurationName" Name of the product configuration used to create the license.
Definition Lease.h:127
const std::string clientVersion
"clientVersion" The version of the client application.
Definition Lease.h:157
const std::string keyId
JWT validation key id (claim "jki" from the JWT header).
Definition Lease.h:168
const std::string quantityDimension
“qtyDimension” Describes the quantity dimension of the licenses.
Definition Lease.h:143
const std::int64_t verifiedQuantity
“qtyVerified” Quantity that has been verified to be used.
Definition Lease.h:141
const std::string id
"jti" JWT ID: unique id of the license token, you may use this in the client application to prevent t...
Definition Lease.h:107
const std::string licenseConsumerConnectedIdentityId
“licenseConsumerConnectedIdentityId” Connected identity id of the license consumer that checked out t...
Definition Lease.h:153
const std::vector< std::string > features
“features” An array specifying what features the license enables.
Definition Lease.h:145
const std::int64_t timeOfEventEpochS
"toe” Time of Event: the checkout / last heartbeat timestamp recorded for the license checkout
Definition Lease.h:113
const std::string allowedVersionUpperBound
"allowedVersionUpperBound": Upper bound of allowed client application version.
Definition Lease.h:135
const std::string licenseId
Id of the license.
Definition Lease.h:129
const std::string token
Full token text from which this lease was parsed.
Definition Lease.h:162
const std::int64_t preallocatedQuantity
“qtyPrealloc” Quantity that was preallocated at time of checkout, applicable for use count and use ti...
Definition Lease.h:139
const std::int64_t licenseValidFromEpochS
"licenseValidFrom": Defines the date-time when license validity starts.
Definition Lease.h:131
const std::int64_t heartbeatNotBeforeEpochS
"hbnbf" Heartbeat not before: the earliest allowed time when a checkout can be heartbeat.
Definition Lease.h:123
const std::string licenseKey
License key used to checkout this lease.
Definition Lease.h:164
static const std::int64_t NEVER_EXPIRES_EPOCH_S_MAGIC
Magic value for "expiresEpochS" which indicates that the lease never expires.
Definition Lease.h:101
const std::string type
"type" License type: DYNAMIC_PRODUCT or PRECONFIGURED_PRODUCT.
Definition Lease.h:137
const std::int64_t expiresEpochS
“exp” Expiration Time: marks the expiration time of the License and License Token as epoch seconds
Definition Lease.h:109
const std::string allowedVersionLowerBound
"allowedVersionLowerBound": Lower bound of allowed client application version.
Definition Lease.h:133
bool hasClientVersion() const
Returns true if the lease has information about client version.
Definition Lease.cpp:13
const std::string productName
"productName" Name of the product that the license allows to use.
Definition Lease.h:125
const bool metered
Was this lease checked out as metered?
Definition Lease.h:166
Licensing operations for 10Duke Scale.
Definition LicenseConsumerClientBindingStatus.h:8
Classes, functions and globals of 10Duke Scale C++ Client.
Definition AbstractClientFactory.h:16
Root for classes, functions and globals of 10Duke C++ Client.
Definition AbstractClientFactory.h:16