SDKs
...
Licensing Scenarios
License Type Options
License Data
15min
whether you are a developer seeking to integrate licensing features into your product or a system administrator responsible for overseeing licenses, understanding how to access license data is crucial for effective licensing management in licencespring, licenses are equipped with numerous fields, encompassing essential information such as status, maintenance period, start date, and more in this tutorial, we will delve into the process of accessing these fields and comprehending their significance prerequisites completed the getting started docid\ lsfy9tq3vfq4roow9shkd tutorial, specifically initialized licensemanager (or licensehandler ) with your configuration using the appropriate settings created a licenseid using either licenseid fromkey or licenseid fromuser function, depending on the activation method you prefer activated a license of any type license id licenseid is a fundamental component of licencespring's licensing infrastructure, serving as a crucial license identifier object it acts as a unique and immutable identifier assigned to each individual license within the system licenseid can be accessed using the following getters on the license object const licenseid& licensespring license id() licenseid licensespring license id() // key based license licensekey // user based license user license status license status is a critical attribute within licencespring's licensing framework, representing the current state of a license as a string value, it can take on four distinct values 'active', 'disabled', 'expired', or 'inactive' developers can access license status in the sdks through std string licensespring license status()licensestatus licensespring license status() license statelicense check license status() for more information about the different statuses, see license types docid\ xhxttcvj7gs6qeaqu7cua you can also check for active, valid, enabled, and expired licenses using isactive , isvalid , isenabled , and isexpired methods respectively maintenance period a maintenance period refers to a specific duration during which software vendors or service providers offer ongoing support, updates, and access to new versions or features for their products or services see maintenance period docid\ modljq4cp5ubomxrrqxbk for more information about implementing a maintenance period developers have multiple fields to utilize when it comes to maintenance periods, starting with the getter for license maintenance period in local time or utc these are shown below //local time tm licensespring license maintenanceperiod()	 //utc tm licensespring license maintenanceperiodutc()//local time datetime licensespring license maintenanceperiod()	 //utc datetime licensespring license maintenanceperiodutc() license maintenanceperiodlicense maintenance period() it is also possible to check if the maintenance period is expired, using the boolean checker bool licensespring license ismaintenanceperiodexpired() bool licensespring license ismaintenanceperiodexpired() license ismaintenanceperiodexpiredlicense is maintence period expired() finally, the licensespring sdks offer the ability to return the number of days remaining until the end of the maintenace period int licensespring license maintenancedaysremaining()int licensespring license maintenancedaysremaining()license maintenance days remaining() start date licenses have an optional start date field, defining the first activation date for added flexibility this allows customers to activate licenses when needed, aligning with specific timelines and project requirements it also enables software vendors to generate pre sales and plan product launches efficiently the start date of a license can be accessed by using std string & licensespring license startdate() datetime licensespring license startdate() license startdate // date?license start date() cannotbeactivatednowexception will be thrown if start date field is set for the license and current date is behind start date last check the license last check date in local time is provided as a time structure, indicating the most recent date and time when the license was last checked on the user's system, adjusted to either the local time zone or utc these getters for the date and time of the last check are //local time tm licensespring license lastcheckdate() //utc tm licensespring license lastcheckdateutc()//local time datetime licensespring license lastcheckdate()	 //utc datetime licensespring license lastcheckdateutc() license lastsyncdatelicense last check() it is also possible to retrieve the number of days since the last check int licensespring license dayspassedsincelastcheck() int licensespring license dayspassedsincelastcheck()license days since last check() activation count tracking current activations and maximum activations is vital for effective license management the current activations offer real time insights into usage trends, aiding vendors in decision making, while the maximum activations set crucial limits, preventing unauthorized use and ensuring compliance the getters used to access these values are shown below //number of current activations uint32 t licensespring license timesactivated() //maximum activations uint32 t licensespring license maxactivations() //number of current activations uint licensespring license timesactivated()	 //maximum activations uint licensespring license maxactivations() license timesactivated license maxactivationslicense max activations() this data empowers both vendors and users to optimize resource allocation and maintain a harmonious licensing ecosystem licensenoavailableactivationsexception thrown when license has already been activated maximum number of times license transfers license transfer refers to the process of moving a software license from one device to another in such cases, the activation of the license on the new device is counted as an activation event this means that when a license is transferred to a different device, it is considered as if it were newly activated on that device developers can access the current transfer count of a license by using uint32 t licensespring license transfercount()uint licensespring license transfercount() license transfercountlicense transfer count() to check the amount of allowed transfers on a license int32 t licensespring license transferlimit() bool licensespring license isdevicetransferallowed() bool licensespring license isdevicetransferlimited()license is device transfer limited() license is device transfer allowed() license owner the license owner refers to the individual or organization associated with a specific software license this information provides essential details about the entity that holds the rights and permissions to use the licensed product or service the license owner can be retrieved through the sdk with customer licensespring license owner()customer licensespring license owner()license customer // customer