|
Licme
|
Manages license loading/activation/deactivation processes. More...
#include <license_manager.h>
Public Member Functions | |
| LicenseManager (manager::Configuration configuration) | |
| Construct a new License Manager. | |
| LicenseManager (const LicenseManager &)=delete | |
| LicenseManager (LicenseManager &&)=delete | |
| ~LicenseManager () | |
| Destroy the License Manager. | |
| void | Validate (std::string_view strFeature, bool bTryRenew=true) |
| validates a licensed feature | |
| std::string | GetProperty (std::string_view strFeature, std::string_view strProperty) const |
| returns properties of a feature | |
| void | ReleaseAll () |
| deactivates all licensed features | |
| void | Renew () |
| renews the current volume | |
Static Public Member Functions | |
| static void | ValidateProductFeature (const std::string &strProductName, const std::string &strFeature, bool bTryRenew=true) |
| tries to validate the given feature for the given product | |
Manages license loading/activation/deactivation processes.
This is an implementation of the license management flow as it is expected by ADTF. So this could be used as top level API to the license management, or you could also ignore this class and develop your own processes using class License directly.
| licme::manager::LicenseManager::LicenseManager | ( | manager::Configuration | configuration | ) |
Construct a new License Manager.
Creates an instance that will try to load a license file. If loading fails because the file is invalid (maybe even manipulated), it tries to read the license key from it. If the license key could be read successfully, it is attempted to contact the server and deactivate that license so it could be activated in the next steps. If license key cannot be read from file, deactivation is omitted and activation will be tried right after. If this activation succeeds, a new license file is saved. If activation fails... well, I guess you won't get a license then ;-)
| std::string licme::manager::LicenseManager::GetProperty | ( | std::string_view | strFeature, |
| std::string_view | strProperty ) const |
returns properties of a feature
| strFeature | feature's name |
| strProperty | property name |
| void licme::manager::LicenseManager::Validate | ( | std::string_view | strFeature, |
| bool | bTryRenew = true ) |
validates a licensed feature
The feature is looked up in the read license file and checked for valid activation due date. Returns without if this date is valid. It will throw a ValidationException in case the file has been fiddled with or the due date has already expired.
| strFeature | name of the feature to check |
| bTryRenew | enable automated renewal if feature is missing or invalid |
| ValidationException | in case license for this feature is invalid |
|
static |
tries to validate the given feature for the given product
This function also captures all log messages and attaches them to an exception.
| strProductName | the Product's Name. |
| strFeature | the feature's name |
| bTryRenew | enable automated renewal if feature is missing or invalid |