1#ifndef LS_LICENSE_HANDLER_H
2#define LS_LICENSE_HANDLER_H
71 const std::string& licensePolicy = std::string() )
const;
75 const std::string&
getSSOUrl(
const std::string& accountCode = std::string(),
bool useAuthCode =
true );
81 void activateAirGapLicense(
const std::string& confirmationCode,
const std::wstring& activationResponseFile,
const std::string& licenseKey, uint32_t policyId );
87 std::vector<LicenseUser::ptr_t>
getLicenseUsers(
const std::string& customerEmail );
91 void activateLicense(
const std::string& authData,
const std::string& accountCode = std::string(),
bool useAuthCode =
true );
95 bool changePassword(
const std::string& password,
const std::string& newPassword,
96 const std::string& user = std::string() );
106 const std::string& version = std::string(),
146 void removeUserData(
const std::string& key = std::string(),
bool saveLicense =
true );
170 void addDeviceVariable(
const std::string& name,
const std::string& value,
bool saveLicense =
true );
184 const std::wstring& activationRequestFile = std::wstring() );
190 bool updateOffline(
const std::wstring& path = std::wstring(),
bool resetConsumption =
false );
352 LicenseHandlerImpl* m_impl;
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
LSErrorCode
LicenseSpring Error codes enum.
std::shared_ptr< Configuration > ptr_t
Class used for encapsulating LSConsumptionPeriod and converting cosumption period to/from string.
Class for storing key-value data field.
Class that encapsulates information about a customer.
std::shared_ptr< Customer > ptr_t
Class for storing key-value device variable.
std::shared_ptr< InstallationFile > ptr_t
Class that encapsulates information about license feature.
This class encapsulates functionality of the both LicenseManager and the License. .
tm gracePeriodEndDateTime() const
bool isInternalServerError() const
void removeUserData(const std::string &key=std::string(), bool saveLicense=true)
const std::string & getAirGapDeactivationCode(const std::string &initializationCode)
bool isLicenseVMAllowed() const
tm getLicenseFloatingEndDateTimeUtc() const
const std::string & getLastErrorMsg() const
int32_t getLicenseTransferLimit() const
void syncConsumption(int32_t requestOverage=-1)
bool updateOffline(const std::wstring &path=std::wstring(), bool resetConsumption=false)
bool isInitializationError() const
void registerFloatingLicense()
void releaseFloatingLicense()
void syncFeatureConsumption(const std::string &featureCode=std::string())
bool isLicenseStateError() const
~LicenseHandler()
Destructor for LicenseHandler.
InstallationFile::ptr_t checkLicense(const InstallFileFilter &filter=InstallFileFilter(), bool includeExpiredFeatures=false)
InstallationFile::ptr_t getInstallFile(const LicenseID &licenseID=LicenseID(), const std::string &version=std::string(), const InstallFileFilter &filter=InstallFileFilter())
tm gracePeriodEndDateTimeUTC() const
const std::vector< CustomField > & userData()
std::vector< DeviceVariable > getDeviceVariables(bool getFromBackend=false)
int getDaysRemaining() const
void reconfigure(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
int32_t getLicenseMaxConsumption() const
const std::string & getLicenseMetadata() const
int32_t getLicenseMaxOverages() const
tm validityWithGracePeriod() const
const std::string & getLicenseStartDate() const
bool canIgnoreError() const
const std::string & getSSOUrl(const std::string &accountCode=std::string(), bool useAuthCode=true)
uint32_t getLicenseMaxActivations() const
static LicenseHandler & instance(bool globalInit=false)
Get singleton object of LicenseHandler.
int32_t getLicenseTotalConsumption() const
bool isDeviceTransferLimited() const
std::string userData(const std::string &key)
std::wstring licenseFileName() const
std::wstring licenseFilePath() const
void setAutoRelease(bool autoRelease)
bool isInitialized() const
bool isExceptionsEnabled() const
void releaseFloatingFeature(const std::string &featureCode)
void activateLicense(const LicenseID &licenseID)
bool changePassword(const std::string &password, const std::string &newPassword, const std::string &user=std::string())
const LicenseID & getTrialLicense(const std::string &userEmail) const
bool isLicenseValid() const
bool isAutoReleaseSet() const
tm getLicenseLastCheckDateUtc() const
const std::wstring & deactivateLicenseOffline(const std::wstring &deactivationRequestFile=std::wstring())
bool isLicenseUnlimitedConsumptionAllowed() const
tm getLicenseMaintenancePeriodUtc() const
void relinkLicense(DeviceIDAlgorithm deviceIdAlgorithm, const std::string &userPassword=std::string())
LicenseUser::ptr_t getLicenseUserPtr() const
tm getLicenseFloatingEndDateTime() const
LSErrorCode getLastError() const
void updateFeatureConsumption(const std::string &featureCode, int32_t value=1, bool saveLicense=true)
bool hasLicenseFeatures() const
uint32_t getLicenseTimesActivated() const
bool isLicenseActive() const
bool isLicenseExpired() const
std::vector< LicenseUser::ptr_t > getLicenseUsers(const Customer &customer)
void setupFeatureWatchdog(LicenseWatchdogCallback callback, uint32_t timeout=0)
bool isResetLicenseConsumptionEnabled() const
void setLicenseFileName(const std::wstring &name)
const std::vector< std::string > & getVersionList(const LicenseID &licenseID=LicenseID(), const InstallFileFilter &filter=InstallFileFilter())
void activateAirGapLicense(const std::string &confirmationCode, const std::wstring &activationResponseFile, const std::string &licenseKey, uint32_t policyId)
tm getLicenseExpiryDate() const
const std::string & getLicenseStatusStr() const
void enableExceptions(bool enable)
void addUserData(const CustomField &data, bool saveLicense=true)
uint32_t getLicenseTransferCount() const
void registerFloatingFeature(const std::string &featureCode, bool addToWatchdog=true)
uint32_t getSubscriptionLicenseGracePeriod() const
bool isLicenseBorrowed() const
void setupLicenseWatchdog(LicenseWatchdogCallback callback, uint32_t timeout=0)
void activateLicense(const std::string &authData, const std::string &accountCode=std::string(), bool useAuthCode=true)
bool hasLicenseCustomFields() const
void borrowFloatingLicense(uint32_t hours, uint32_t days=0)
bool isDeviceTransferAllowed() const
bool isNetworkTimeoutError() const
void resumeFeatureWatchdog()
ProductDetails::ptr_t getProductDetails(bool includeLatestVersion=false) const
bool isLicenseOveragesAllowed() const
void stopLicenseWatchdog()
const std::string & getAirGapActivationCode(const std::string &initializationCode, const std::string &licenseKey)
LicenseHandler(const LicenseHandler &)=delete
bool isNoInternetError() const
uint32_t getLicenseFloatingInUseCount() const
int gracePeriodHoursRemaining() const
bool isLicenseAirGapped() const
bool isGeneralError() const
void addDeviceVariables(const std::vector< DeviceVariable > &variables)
const std::string & deviceVariableValue(const std::string &name) const
const Customer & getLicenseOwner() const
const std::vector< LicenseFeature > & getLicenseFeatures() const
LicenseType getLicenseType() const
Configuration::ptr_t currentConfig() const
void activateLicenseOffline(const std::wstring &activationResponseFile=std::wstring())
ConsumptionPeriod getLicenseConsumptionPeriod() const
bool isLicenseFloating() const
bool isActivationFailed() const
DeviceVariable deviceVariable(const std::string &name) const
const std::string & getLicenseUser() const
tm getLicenseMaintenancePeriod() const
void sendDeviceVariables()
const LicenseID & getTrialLicense(Customer::ptr_t user=nullptr, const std::string &licensePolicy=std::string()) const
LicenseHandler(Configuration::ptr_t config=nullptr, LicenseStorage::ptr_t storage=nullptr)
Constructor for LicenseHandler.
void resumeLicenseWatchdog()
bool isLicenseExpiredError() const
uint32_t getLicenseMaxFloatingUsers() const
const LicenseFeature & getLicenseFeature(const std::string &featureCode) const
int getMaintenanceDaysRemaining() const
bool isLicenseNotFoundError() const
tm validityWithGracePeriodUtc() const
bool isLicenseFeatureError() const
const std::wstring & createOfflineActivationFile(const LicenseID &licenseID, const std::wstring &activationRequestFile=std::wstring())
bool isLicenseOfflineActivated() const
const std::string & getLicenseKey() const
const std::wstring & dataLocation() const
void deactivateAirGapLicense(const std::string &confirmationCode)
LicenseHandler & operator=(const LicenseHandler &)=delete
void setDataLocation(const std::wstring &path)
tm getLicenseLastCheckDate() const
int getDaysPassedSinceLastCheck() const
uint32_t getLicensePolicyId() const
bool isLicenseTrial() const
bool isLicenseMaintenanceExpired() const
tm getLicenseExpiryDateUtc() const
uint32_t getLicenseFloatingTimeout() const
bool isHardwareIDError() const
uint32_t getMaxBorrowTime() const
bool isGracePeriodStarted() const
uint32_t getLicenseTrialPeriod() const
void updateConsumption(int32_t value=1, bool saveLicense=true)
std::vector< LicenseUser::ptr_t > getLicenseUsers(const std::string &customerEmail)
void addDeviceVariable(const std::string &name, const std::string &value, bool saveLicense=true)
bool isLicenseExists() const
const std::vector< CustomField > & getLicenseCustomFields() const
bool isSubscriptionGracePeriodStarted() const
const LicenseID & getLicenseID() const
bool isLicenseEnabled() const
void stopFeatureWatchdog()
void addDeviceVariable(const DeviceVariable &variable, bool saveLicense=true)
void borrowFloatingLicense(const std::string &borrowEndDateTime=std::string())
Class that represents License identifier.
std::shared_ptr< LicenseStorage > ptr_t
Class used for encapsulating the type of license, comparing types of licenses, and converting them to...
std::shared_ptr< LicenseUser > ptr_t
std::shared_ptr< ProductDetails > ptr_t
constexpr Char encrypt_character(const Char character, int index)
std::function< void(const LicenseSpringException &ex)> LicenseWatchdogCallback
Callback function which being called in case of error in background thread (watchdog thread).
Helper struct for filtering installation files by environment and channel.