1#ifndef LS_LICENSE_HANDLER_H
2#define LS_LICENSE_HANDLER_H
17class LicenseHandlerImpl;
73 bool includeLatestVersion,
bool includeCustomFields,
const std::string &env)
const;
76 Customer::ptr_t user =
nullptr,
const std::string &licensePolicy = std::string())
const;
81 const std::string &accountCode = std::string(),
bool useAuthCode =
true);
84 const std::string &initializationCode,
const std::string &licenseKey);
89 const std::wstring &activationResponseFile,
const std::string &licenseKey,
96 std::vector<LicenseUser::ptr_t>
getLicenseUsers(
const std::string &customerEmail);
99 const std::string &username,
const std::string &password);
104 const LicenseID &licenseID,
const std::vector<DeviceVariable> &deviceVariables);
107 const std::string &accountCode = std::string(),
bool useAuthCode =
true);
112 const std::string &user = std::string());
115 DeviceIDAlgorithm deviceIdAlgorithm,
const std::string &userPassword = std::string());
124 const std::string &version = std::string(),
156 const std::string &featureCode, int32_t value = 1,
bool saveLicense =
true);
167 void removeUserData(
const std::string &key = std::string(),
bool saveLicense =
true);
192 const std::string &name,
const std::string &value,
bool saveLicense =
true);
206 const LicenseID &licenseID,
const std::wstring &activationRequestFile = std::wstring());
209 const std::vector<DeviceVariable> &deviceVariables,
210 const std::wstring &activationRequestFile = std::wstring());
215 const std::wstring &deactivationRequestFile = std::wstring());
217 bool updateOffline(
const std::wstring &path = std::wstring(),
bool resetConsumption =
false);
386 LicenseHandlerImpl *m_impl;
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
std::vector< UserLicensesData::ptr_t > getUserLicenses(const std::string &username, const std::string &password)
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)
void setAutoRelease(bool autoRelease)
bool isInitialized() const
bool isExceptionsEnabled() const
ProductDetails::ptr_t getProductDetails(bool includeLatestVersion, bool includeCustomFields, const std::string &env) 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
const std::wstring & licenseFilePath() 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()
bool isLicenseNegativeConsumptionAllowed() const
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
const std::wstring & createOfflineActivationFile(const LicenseID &licenseID, const std::vector< DeviceVariable > &deviceVariables, const std::wstring &activationRequestFile=std::wstring())
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::wstring & licenseFileName() const
const uint64_t getLicenseServerId() const
const std::string & getLicenseUser() const
tm getLicenseMaintenancePeriod() const
void sendDeviceVariables()
void activateLicense(const LicenseID &licenseID, const std::vector< DeviceVariable > &deviceVariables)
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 std::string & getOrderStoreId() const
const LicenseFeature & getLicenseFeature(const std::string &featureCode) const
int getMaintenanceDaysRemaining() const
bool isLicenseNotFoundError() const
tm validityWithGracePeriodUtc() const
void checkLicenseLocal(bool verifySignature=false)
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
bool isLicenseFileCorrupted()
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
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.