1 #ifndef LS_LICENSE_HANDLER_H
2 #define LS_LICENSE_HANDLER_H
16 class LicenseHandlerImpl;
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(),
141 void removeUserData(
const std::string& key = std::string(),
bool saveLicense =
true );
159 void addDeviceVariable(
const std::string& name,
const std::string& value,
bool saveLicense =
true );
173 const std::wstring& activationRequestFile = std::wstring() );
179 bool updateOffline(
const std::wstring& path = std::wstring(),
bool resetConsumption =
false );
333 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
static LicenseHandler & instance(bool globalInit=false)
Get singleton object of LicenseHandler.
void removeUserData(const std::string &key=std::string(), bool saveLicense=true)
const std::string & getLicenseMetadata() const
bool isLicenseVMAllowed() const
tm getLicenseFloatingEndDateTimeUtc() const
void syncConsumption(int32_t requestOverage=-1)
const std::string & getLicenseStartDate() const
bool updateOffline(const std::wstring &path=std::wstring(), bool resetConsumption=false)
const LicenseFeature & getLicenseFeature(const std::string &featureCode) const
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 getInstallFile(const LicenseID &licenseID=LicenseID(), const std::string &version=std::string(), const InstallFileFilter &filter=InstallFileFilter())
tm gracePeriodEndDateTimeUTC() const
int getDaysRemaining() const
void reconfigure(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
int32_t getLicenseMaxConsumption() const
int32_t getLicenseMaxOverages() const
tm validityWithGracePeriod() const
bool canIgnoreError() const
uint32_t getLicenseMaxActivations() const
int32_t getLicenseTotalConsumption() 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
const std::string & getLicenseKey() const
ProductDetails::ptr_t getProductDetails() const
void activateLicense(const LicenseID &licenseID)
bool changePassword(const std::string &password, const std::string &newPassword, const std::string &user=std::string())
const Customer & getLicenseOwner() const
bool isLicenseValid() const
bool isAutoReleaseSet() const
tm getLicenseLastCheckDateUtc() const
std::vector< LicenseUser::ptr_t > getLicenseUsers(const std::string &customerEmail)
bool isLicenseUnlimitedConsumptionAllowed() const
tm getLicenseMaintenancePeriodUtc() const
void relinkLicense(DeviceIDAlgorithm deviceIdAlgorithm, const std::string &userPassword=std::string())
LicenseUser::ptr_t getLicenseUserPtr() const
const LicenseID & getTrialLicense(const std::string &userEmail) 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
bool isResetLicenseConsumptionEnabled() const
void setLicenseFileName(const std::wstring &name)
void activateAirGapLicense(const std::string &confirmationCode, const std::wstring &activationResponseFile, const std::string &licenseKey, uint32_t policyId)
tm getLicenseExpiryDate() const
void enableExceptions(bool enable)
const std::wstring & createOfflineActivationFile(const LicenseID &licenseID, const std::wstring &activationRequestFile=std::wstring())
const std::vector< CustomField > & getLicenseCustomFields() const
void addUserData(const CustomField &data, bool saveLicense=true)
const std::vector< CustomField > & userData()
uint32_t getLicenseTransferCount() const
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)
const std::wstring & dataLocation() const
bool hasLicenseCustomFields() const
void borrowFloatingLicense(uint32_t hours, uint32_t days=0)
bool isNetworkTimeoutError() const
const std::string & getLastErrorMsg() const
const std::string & deviceVariableValue(const std::string &name) const
bool isLicenseOveragesAllowed() const
void stopLicenseWatchdog()
InstallationFile::ptr_t checkLicense(const InstallFileFilter &filter=InstallFileFilter())
LicenseHandler(const LicenseHandler &)=delete
bool isNoInternetError() const
uint32_t getLicenseFloatingInUseCount() const
int gracePeriodHoursRemaining() const
const std::string & getLicenseUser() const
bool isLicenseAirGapped() const
bool isGeneralError() const
void addDeviceVariables(const std::vector< DeviceVariable > &variables)
const LicenseID & getTrialLicense(Customer::ptr_t user=nullptr, const std::string &licensePolicy=std::string()) 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
const std::string & getLicenseStatusStr() const
DeviceVariable deviceVariable(const std::string &name) const
tm getLicenseMaintenancePeriod() const
void sendDeviceVariables()
const LicenseID & getLicenseID() const
LicenseHandler(Configuration::ptr_t config=nullptr, LicenseStorage::ptr_t storage=nullptr)
Constructor for LicenseHandler.
void resumeLicenseWatchdog()
bool isLicenseExpiredError() const
uint32_t getLicenseMaxFloatingUsers() const
int getMaintenanceDaysRemaining() const
const std::string & getSSOUrl(const std::string &accountCode=std::string(), bool useAuthCode=true)
bool isLicenseNotFoundError() const
LicenseHandler & operator=(const LicenseHandler &)=delete
tm validityWithGracePeriodUtc() const
const std::vector< LicenseFeature > & getLicenseFeatures() const
bool isLicenseFeatureError() const
const std::string & getAirGapActivationCode(const std::string &initializationCode, const std::string &licenseKey)
bool isLicenseOfflineActivated() const
void deactivateAirGapLicense(const std::string &confirmationCode)
void setDataLocation(const std::wstring &path)
tm getLicenseLastCheckDate() const
const std::string & getAirGapDeactivationCode(const std::string &initializationCode)
int getDaysPassedSinceLastCheck() const
uint32_t getLicensePolicyId() const
const std::vector< std::string > & getVersionList(const LicenseID &licenseID=LicenseID(), const InstallFileFilter &filter=InstallFileFilter())
bool isLicenseTrial() const
bool isLicenseMaintenanceExpired() const
tm getLicenseExpiryDateUtc() const
uint32_t getLicenseFloatingTimeout() const
std::vector< LicenseUser::ptr_t > getLicenseUsers(const Customer &customer)
bool isHardwareIDError() const
uint32_t getMaxBorrowTime() const
bool isGracePeriodStarted() const
void updateConsumption(int32_t value=1, bool saveLicense=true)
void addDeviceVariable(const std::string &name, const std::string &value, bool saveLicense=true)
bool isLicenseExists() const
std::vector< DeviceVariable > getDeviceVariables(bool getFromBackend=false)
const std::wstring & deactivateLicenseOffline(const std::wstring &deactivationRequestFile=std::wstring())
bool isSubscriptionGracePeriodStarted() const
bool isLicenseEnabled() const
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.