10Duke Scale C++ Client
|
#include <SimpleLeases.h>
Base implementation of tenduke::se::licensing::MutableLeases
.
Public Member Functions | |
std::vector<::tenduke::se::licensing::Lease > | getAllLeases () override |
Returns all leases in the cache. | |
::tenduke::se::licensing::Lease | getLease (const std::string &leaseId) override |
Returns a lease by id. | |
std::vector<::tenduke::se::licensing::Lease > | getLeasesForProduct (const std::string &productName) override |
Returns all leases for given product. | |
void | addLease (const ::tenduke::se::licensing::Lease &lease) override |
Adds a lease to the cache. | |
void | mergeLeases (const std::vector<::tenduke::se::licensing::Lease > &leases) override |
Merges given leases to the cache. | |
void | removeAll () override |
Removes all leases from the cache. | |
void | removeLease (const ::tenduke::se::licensing::Lease &lease) override |
Removes given lease from the cache. | |
void | removeLease (const std::string &leaseId) override |
Removes lease from the cache by lease id. | |
Protected Attributes | |
std::map< std::string, ::tenduke::se::licensing::Lease > | leases |
The leases. | |
std::recursive_mutex | concurrencyLock |
Serializes the access to the methods. | |
|
overridevirtual |
|
overridevirtual |
Returns a lease by id.
leaseId |
std::out_of_range | If no such lease in the cache |
Implements tenduke::se::licensing::Leases.
|
overridevirtual |
Returns all leases for given product.
productName | - |
Implements tenduke::se::licensing::Leases.
|
overridevirtual |
Merges given leases to the cache.
The merge honors tenduke::se::licensing::Lease.oldLeaseId
, if present.
leases |
Implements tenduke::se::licensing::MutableLeases.
|
overridevirtual |
Removes all leases from the cache.
Implements tenduke::se::licensing::MutableLeases.
|
overridevirtual |
Removes given lease from the cache.
IMPORTANT: Uses tenduke::se::licensing::Lease.oldLeaseId
if present falling back to tenduke::se::licensing::Lease.leaseId
. This is to work transparently with heartbeats.
lease | - |
Implements tenduke::se::licensing::MutableLeases.
|
overridevirtual |
Removes lease from the cache by lease id.
leaseId | - |
Implements tenduke::se::licensing::MutableLeases.