License Data
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.
- 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.
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:
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:
For more information about the different statuses, see License Types.
You can also check for active, valid, enabled, and expired licenses using isActive, isValid, isEnabled, and isExpired methods respectively.
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 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:
It is also possible to check if the maintenance period is expired, using the Boolean checker:
Finally, the LicenseSpring SDKs offer the ability to return the number of days remaining until the end of the maintenace period:
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:
CannotBeActivatedNowException will be thrown if start date field is set for the license and current date is behind start date.
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:
It is also possible to retrieve the number of days since the last check:
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:
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 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:
To check the amount of allowed transfers on a license:
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: