public class FloatingLicenseService extends Object
Constructor and Description |
---|
FloatingLicenseService(FloatingConfiguration configuration)
Floating service has to be built using the FloatingConfiguration.
|
Modifier and Type | Method and Description |
---|---|
com.licensespring.LicenseData |
activateLicense(com.licensespring.model.ActivationLicense identity)
Activate the license.
|
void |
addConsumption(com.licensespring.model.LicenseIdentity identity,
int consumptions)
Increases the consumptions on the license by the parameter provided.
|
void |
addFeatureConsumption(com.licensespring.model.LicenseIdentity identity,
String feature,
Integer consumptions)
Increases the consumptions of a feature by the provided parameter.
|
com.licensespring.dto.floating.LicenseBorrowResponse |
borrowLicense(com.licensespring.model.LicenseIdentity identity,
ZonedDateTime borrowedUntil)
Borrows a license using provided license identity and a specified datetime until which the
license is borrowed.
|
com.licensespring.dto.CheckResponse |
checkLicense(com.licensespring.model.LicenseIdentity identity)
Checks if license is valid and syncs local consumptions if configuration property
enableLocalCaching is true.
|
com.licensespring.model.LicenseFeature |
checkLicenseFeature(com.licensespring.model.LicenseIdentity identity,
String featureCode)
Check a license device against a license feature.
|
boolean |
deactivateLicense(com.licensespring.model.LicenseIdentity identity)
A license can be deactivated using this method, then the license can be used on another device.
|
com.licensespring.model.InstallationFile |
installationFile(com.licensespring.model.LicenseIdentity identity)
Gets the latest installation file for the product.
|
com.licensespring.model.Product |
productDetails()
Fetches product data from the server.
|
void |
releaseFloatingFeature(com.licensespring.model.LicenseIdentity identity,
String featureCode)
Release a license device from a floating license feature.
|
void |
releaseLicense(com.licensespring.model.LicenseIdentity identity)
Releases a floating cloud license from current device and syncs local consumptions if
configuration property enableLocalCaching is true.
|
void |
shutdownScheduler()
Calls
ExecutorService.shutdownNow() for the periodic check executor, if period
check is enabled Used for cases where JVM doesn't get the shutdown signal and keeps a thread
running indefinitely |
void |
trackVariables(com.licensespring.model.LicenseIdentity identity,
com.licensespring.model.DeviceVariables variables)
Tracks custom device variables which can be seen in the platform.
|
String[] |
versions(com.licensespring.model.LicenseIdentity identity)
Gets all the available versions for the product configured via configuration settings.
|
public FloatingLicenseService(FloatingConfiguration configuration)
configuration
- build via the builder patternpublic com.licensespring.LicenseData activateLicense(com.licensespring.model.ActivationLicense identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or (username and password), use the ActivationLicense factory
methods to buildcom.licensespring.model.exceptions.LicenseSpringException
public void releaseLicense(com.licensespring.model.LicenseIdentity identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildcom.licensespring.model.exceptions.LicenseSpringException
public com.licensespring.dto.CheckResponse checkLicense(com.licensespring.model.LicenseIdentity identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildcom.licensespring.model.exceptions.LicenseSpringException
public void addConsumption(com.licensespring.model.LicenseIdentity identity, int consumptions) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildconsumptions
- number of consumptionscom.licensespring.model.exceptions.LicenseSpringException
public void addFeatureConsumption(com.licensespring.model.LicenseIdentity identity, String feature, Integer consumptions) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildfeature
- feature which was consumedconsumptions
- number of consumptionscom.licensespring.model.exceptions.LicenseSpringException
public com.licensespring.model.InstallationFile installationFile(com.licensespring.model.LicenseIdentity identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildcom.licensespring.model.exceptions.LicenseSpringException
public void trackVariables(com.licensespring.model.LicenseIdentity identity, com.licensespring.model.DeviceVariables variables)
identity
- license key or username, use the LicenseIdentity factory methods to build.variables
- map of variables you want to trackpublic String[] versions(com.licensespring.model.LicenseIdentity identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to buildcom.licensespring.model.exceptions.LicenseSpringException
public boolean deactivateLicense(com.licensespring.model.LicenseIdentity identity) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license key or username, use the LicenseIdentity factory methods to build.com.licensespring.model.exceptions.LicenseSpringException
public com.licensespring.model.Product productDetails() throws com.licensespring.model.exceptions.LicenseSpringException
com.licensespring.model.exceptions.LicenseSpringException
public void shutdownScheduler()
ExecutorService.shutdownNow()
for the periodic check executor, if period
check is enabled Used for cases where JVM doesn't get the shutdown signal and keeps a thread
running indefinitelypublic com.licensespring.dto.floating.LicenseBorrowResponse borrowLicense(com.licensespring.model.LicenseIdentity identity, ZonedDateTime borrowedUntil) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- a LicenseIdentity
object containing details for identifying the license
to be borrowed.borrowedUntil
- a ZonedDateTime
indicating until when the license should be
borrowed.LicenseBorrowResponse
object containing details of the borrowed license.com.licensespring.model.exceptions.LicenseSpringException
- if the API call encounters a client-side error, server-side
error, or there’s an infrastructure error. The specific type of exception can provide more
detailed context regarding the error.public void releaseFloatingFeature(com.licensespring.model.LicenseIdentity identity, String featureCode) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license identityfeatureCode
- feature codecom.licensespring.model.exceptions.LicenseSpringException
public com.licensespring.model.LicenseFeature checkLicenseFeature(com.licensespring.model.LicenseIdentity identity, String featureCode) throws com.licensespring.model.exceptions.LicenseSpringException
identity
- license identityfeatureCode
- feature codecom.licensespring.model.exceptions.LicenseSpringException
Copyright © 2024 Cense Data Inc.. All rights reserved.