Base class for license management.
More...
#include <LicenseSpring/BaseManager.h>
Base class for license management.
Used to manipulate configuration, product details, current license, data location, license file name and path.
Extended to FloatingClient.h and LicenseManager.h.
Definition at line 23 of file BaseManager.h.
Create and intialize license manager with given configuration.
- Parameters
-
config | Configuration object to use |
storage | Storage for local license, by default local license is saved in a file |
- Exceptions
-
LicenseSpring::BaseManager::BaseManager |
( |
const BaseManager & |
| ) |
|
|
delete |
virtual LicenseSpring::BaseManager::~BaseManager |
( |
| ) |
|
|
virtual |
Destroy LicenseManger with current configuration.
Returns current configuration.
- Returns
- Shared pointer to current configuration.
Change current configuration.
- Parameters
-
config | Current configuration object to reconfigure |
- Warning
- This method is not thread safe.
ProductDetails LicenseSpring::BaseManager::getProductDetails |
( |
bool |
includeLatestVersion = false | ) |
|
Get basic information from the backend on product which corresponds to the current configuration.
- Parameters
-
includeLatestVersion | If true, also returns latest_version field |
- Returns
- ProductDetails object of product code given.
- Exceptions
-
const License::ptr_t LicenseSpring::BaseManager::getCurrentLicense |
( |
| ) |
|
Load license from local storage (if not yet loaded).
If license has been already loaded into memory, this method just returns existing pointer to the license.
- Returns
- Shared pointer to license or null if no license exists for current configuration and storage.
- Exceptions
-
Resets current license and loads it again from local storage.
- Returns
- Shared pointer to license or null if no license exists for current configuration and storage.
- Exceptions
-
void LicenseSpring::BaseManager::clearLocalStorage |
( |
| ) |
|
Remove local license, other files and folders created by LicenseSpring, usually should be called at app uninstallation.
This method also removes current license from memory.
const std::wstring& LicenseSpring::BaseManager::dataLocation |
( |
| ) |
const |
Absolute folder path where LicenseSpring data is stored.
Data like: log file, temp offline activation data, local license file in case LicenseFileStorageBase (or derived) is used.
Default SDK data location on Windows is: {SystemDrive}:/Users/{UserName}/AppData/Local/LicenseSpring/{ProductCode}
Default SDK data location on Linux is: HOME/.LicenseSpring/LicenseSpring/{ProductCode}
Default SDK data location on MAC is: ~/Library/Application Support/LicenseSpring/{ProductCode}
- Returns
- Absolute folder path (location) of the SDK data.
void LicenseSpring::BaseManager::setDataLocation |
( |
const std::wstring & |
path | ) |
|
Set absolute or relative path to folder where LicenseSpring data should be stored.
If you want set data location to current directory use ".", empty string results in reset to default location (see dataLocation()). If path provided does not exist, the folders are created to match the path given.
- Parameters
-
path | Absolute or relative folder path |
- Warning
- If there's a license in the new location, it will be set as current license, otherwise the current license will be removed from memory.
std::wstring LicenseSpring::BaseManager::licenseFileName |
( |
| ) |
const |
Return license file name with extension, unless filename was explicitly set to be without extension.
Meaningful only if LicenseFileStorageBase (or derived) is used. Default filename is License.key.
- Returns
- License file name.
void LicenseSpring::BaseManager::setLicenseFileName |
( |
const std::wstring & |
name | ) |
|
Set license file name, it can be with or without extension.
Meaningful only if LicenseFileStorageBase (or derived) is used. Default filename is License.key.
- Parameters
-
- Warning
- This method also removes current license from memory.
std::wstring LicenseSpring::BaseManager::licenseFilePath |
( |
| ) |
const |
void LicenseSpring::BaseManager::reset |
( |
| ) |
|
|
protected |
std::shared_ptr<DataHandler> LicenseSpring::BaseManager::m_dataHandler |
|
protected |
LicenseService* LicenseSpring::BaseManager::m_pLicenseService |
|
protected |
The documentation for this class was generated from the following file: