| LicenseSpring C++ SDK 7.32.0 Easily add Software Licensing to your application

Loading...
Searching...
No Matches
LicenseManager.h
Go to the documentation of this file.
1#ifndef LS_LICENSE_MANAGER_H
2#define LS_LICENSE_MANAGER_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning( push )
7#pragma warning( disable : 4251 )
8#endif
9
10#include "BaseManager.h"
11
12 namespace LicenseSpring
13{
17 class LS_API LicenseManager : public BaseManager
18 {
19 public:
20 using ptr_t = std::shared_ptr<LicenseManager>;
21
27 static LicenseManager::ptr_t create( Configuration::ptr_t config, LicenseStorage::ptr_t storage = nullptr );
28
31 LicenseManager( Configuration::ptr_t config, LicenseStorage::ptr_t storage = nullptr );
32
34 ~LicenseManager() override;
35
53 LicenseID getTrialLicense( Customer::ptr_t user = nullptr, const std::string& licensePolicy = std::string() );
54
67 LicenseID getTrialLicense( const std::string& userEmail );
68
80 std::string getSSOUrl( const std::string& accountCode = std::string(), bool useAuthCode = true );
81
86 std::string getAirGapActivationCode( const std::string& initializationCode, const std::string& licenseKey );
87
97 const License::ptr_t activateAirGapLicense( const std::string& confirmationCode, const std::wstring& policyPath, const std::string& licenseKey, uint32_t policyId );
98
115 const License::ptr_t activateLicense( const LicenseID& licenseID );
116
136 const License::ptr_t activateLicense( const std::string& authData, const std::string& accountCode = std::string(),
137 bool useAuthCode = true );
138
147 const License::ptr_t activateLicenseOffline( const std::wstring& activationResponseFile = std::wstring() );
148
157 const License::ptr_t relinkLicense( DeviceIDAlgorithm deviceIdAlgorithm, const std::string& userPassword = "" );
158
170 bool changePassword( const std::string& user, const std::string& password, const std::string& newPassword );
171
183 std::vector<std::string> getVersionList( const LicenseID& licenseID,
184 const InstallFileFilter& filter = InstallFileFilter() );
185
199 InstallationFile::ptr_t getInstallationFile( const LicenseID& licenseID,
200 const std::string& version = std::string(),
201 const InstallFileFilter& filter = InstallFileFilter() );
202
207 std::wstring createOfflineActivationFile( const LicenseID& licenseID,
208 const std::wstring& activationRequestFile = std::wstring() );
209
217 bool isOnline( bool throwExceptions = false ) const;
218
229 std::vector<LicenseUser::ptr_t> getLicenseUsers( const Customer& customer );
230
235 std::vector<LicenseUser::ptr_t> getLicenseUsers( const std::string& customerEmail );
236
237 };
238}
239
240#ifdef _MSC_VER
241#pragma warning( pop )
242#endif
243
244#endif // LS_LICENSE_MANAGER_H
LS_API
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition APIDef.h:22
BaseManager.h
DeviceIDAlgorithm
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition PODTypes.h:104
LicenseSpring::BaseManager
Base class for license management.
Definition BaseManager.h:24
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition Configuration.h:20
LicenseSpring::Customer
Class that encapsulates information about a customer.
Definition Customer.h:18
LicenseSpring::Customer::ptr_t
std::shared_ptr< Customer > ptr_t
Definition Customer.h:20
LicenseSpring::InstallationFile::ptr_t
std::shared_ptr< InstallationFile > ptr_t
Definition InstallationFile.h:54
LicenseSpring::License::ptr_t
std::shared_ptr< License > ptr_t
Definition License.h:36
LicenseSpring::LicenseID
Class that represents License identifier.
Definition LicenseID.h:19
LicenseSpring::LicenseManager
Class for performing basic requests to LicenseSpring backend and managing licenses.
Definition LicenseManager.h:18
LicenseSpring::LicenseManager::ptr_t
std::shared_ptr< LicenseManager > ptr_t
Definition LicenseManager.h:20
LicenseSpring::LicenseManager::getSSOUrl
std::string getSSOUrl(const std::string &accountCode=std::string(), bool useAuthCode=true)
Get URL for Single sign-on license activation.
LicenseSpring::LicenseManager::getAirGapActivationCode
std::string getAirGapActivationCode(const std::string &initializationCode, const std::string &licenseKey)
Get air gap Activation code.
LicenseSpring::LicenseManager::getLicenseUsers
std::vector< LicenseUser::ptr_t > getLicenseUsers(const std::string &customerEmail)
Overloaded method. See notes above. Get license users list by given customer email.
LicenseSpring::LicenseManager::getVersionList
std::vector< std::string > getVersionList(const LicenseID &licenseID, const InstallFileFilter &filter=InstallFileFilter())
Get app version list available for given license.
LicenseSpring::LicenseManager::activateLicenseOffline
const License::ptr_t activateLicenseOffline(const std::wstring &activationResponseFile=std::wstring())
Activate license offline with provided activation file.
LicenseSpring::LicenseManager::isOnline
bool isOnline(bool throwExceptions=false) const
Helper method, it checks connection to the LicenseSpring backend.
LicenseSpring::LicenseManager::create
static LicenseManager::ptr_t create(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
Creates LicenseManager object and initialize it with given configuration.
LicenseSpring::LicenseManager::relinkLicense
const License::ptr_t relinkLicense(DeviceIDAlgorithm deviceIdAlgorithm, const std::string &userPassword="")
This method helps upgrade to new device id algorithm. It deactivates current license with old device ...
LicenseSpring::LicenseManager::LicenseManager
LicenseManager(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
Construct LicenseManager object and initialize it with given configuration.
LicenseSpring::LicenseManager::getTrialLicense
LicenseID getTrialLicense(Customer::ptr_t user=nullptr, const std::string &licensePolicy=std::string())
Request trial license from LicenseSpring backend.
LicenseSpring::LicenseManager::changePassword
bool changePassword(const std::string &user, const std::string &password, const std::string &newPassword)
Change user password, meaningful only for user-based products.
LicenseSpring::LicenseManager::activateLicense
const License::ptr_t activateLicense(const LicenseID &licenseID)
Activate license with given LicenseID.
LicenseSpring::LicenseManager::getTrialLicense
LicenseID getTrialLicense(const std::string &userEmail)
Request trial license from LicenseSpring backend.
LicenseSpring::LicenseManager::~LicenseManager
~LicenseManager() override
Destroy license manager and its configuration if there is no more references to the configuration.
LicenseSpring::LicenseManager::createOfflineActivationFile
std::wstring createOfflineActivationFile(const LicenseID &licenseID, const std::wstring &activationRequestFile=std::wstring())
Creates offline activation file request.
LicenseSpring::LicenseManager::getLicenseUsers
std::vector< LicenseUser::ptr_t > getLicenseUsers(const Customer &customer)
Get license users list by given customer (license owner).
LicenseSpring::LicenseManager::getInstallationFile
InstallationFile::ptr_t getInstallationFile(const LicenseID &licenseID, const std::string &version=std::string(), const InstallFileFilter &filter=InstallFileFilter())
Get InstallationFile information for given license.
LicenseSpring::LicenseManager::activateLicense
const License::ptr_t activateLicense(const std::string &authData, const std::string &accountCode=std::string(), bool useAuthCode=true)
Activate license using SSO.
LicenseSpring::LicenseManager::activateAirGapLicense
const License::ptr_t activateAirGapLicense(const std::string &confirmationCode, const std::wstring &policyPath, const std::string &licenseKey, uint32_t policyId)
Verify Confirmation code and activate air gap license using given license policy or policies.
LicenseSpring::LicenseStorage::ptr_t
std::shared_ptr< LicenseStorage > ptr_t
Definition LicenseStorage.h:19
LicenseSpring
Definition BaseManager.h:16
LicenseSpring::InstallFileFilter
Helper struct for filtering installation files by environment and channel.
Definition InstallationFile.h:19