SDKs

Java SDK

81min

The Java License Client module embodies essential license functionalities, encompassing tasks like online and offline license activation and deactivation, provisioning trial licenses, recording usage instances, and monitoring variables.

The Floating Client serves as the foundational module with a specific emphasis on floating license functionalities. For a deeper understanding of floating licenses, additional information can be accessed by referring to the provided resource on Floating Licenses.

The Management SDK module offers a collection of APIs designed to generate license keys and facilitate order placement. For further details about the general Management API, see our Management API Documentation.

Minimum Java version for this SDK is 8.161.

If you are unsure which SDK module to implement, visit Java Modules to learn what each module offers.

From version 2.2.0 onwards, you can find all the release artefacts - direct downloads, including hosted Javadoc links on our Javadoc & Downloads page.

Release Notes

November 20th, 2024, v2.16.5

License Client:

  • properly passed down LicenseRepository to LicenseService

October 24th, 2024, v2.16.4

All:

  • update com.google.code.gson to 2.11.0

Floating Client:

  • added support for user based licences on borrowLicense method

August 27th, 2024, v2.16.3

License Client:

  • added missing customer fields (12 up from 7)

Management Client:

  • remove orderBy active_up_to_date_devices - not supported anymore

July 25th, 2024, v2.16.2

Floating Client:

  • ProxyFloatingService.register() method should parse responses from newer floating-server versions (backwards compatible)

June 26th, 2024, v2.16.1

All:

  • update oshi version to 6.6.0

License Client:

  • added configuration options to force signature v2 check

Management Client:

  • added the following:
    • LicenseService.updateFeatures
    • LicenseService.deleteLicense
    • OrderService.safeDeleteOrder
  • updated response type in LicenseService.createOrder

May 29th, 2024, v2.16.0

All:

  • Added JsonElement metadata field to: LicenseData, Customer, Product, LicenseFeature (licenseclient sdk and management sdk)
  • Added LicenseManager.getDeviceVariables(identity)
  • Added a parameter to the LicenseManager.initialize() method to accept OkHttpClient.Builder for customization of the underlying client (for a https proxy use case)

Breaking Change:

  • metadata field in LicenseFeature model changed from Object type to JsonElement

May 7th, 2024, v2.15.0

All:

  • Added LicenseUser model and user field in LicenseData for user based licenses
  • Added expiration check on getCurrent() calls while in offline mode
  • Added fallback when detecting OS version

April 16th, 2024, v2.14.0

All:

  • Add VerifySignatureDecoder to enhance security by verifying signatures of server responses
  • Set active and enabled fields to true after successfully performing local check
  • Bump org.bouncycastle.bcpkix-jdk18on, org.bouncycastle.bcprov-jdk18on to v1.78
  • Enhance license security by storing the LicenseData signature alongside the license file and conducting signature verification upon loading the license from the file

January 19th, 2024, v2.13.0

All:

  • Bump io.github.openfeign v12.4 -> v13.1
  • Change scheduler mode to fixed-rate

License Client:

  • Add CachedEncryptedLicenseRepository that caches license in-memory

December 12th, 2023, v2.12.0

Floating Client:

  • FloatingLicenseService:
    • Add releaseFloatingFeature
    • Add checkLicenseFeature

License Client:

  • LicenseService:
    • Add checkLicenseFeature

Management Client:

  • FloatingFeaturesService:
    • Add releaseDevice
    • Add getLicenseProductFeature
    • Add getLicenseProductFeatures
    • Add updateFeatures

December 6th, 2023, v2.11.1

All

  • Compatibility with older Java versions:
    • v1.8u141 and older: Trust LicenseSpring API Root certificate
    • v1.8u161 and older: Fallback to 128 bit key size because key size greater than 128 bit is not supported.
  • Deprecate disableSSL option

November 7th, 2023, v2.10.0

All

  • Proxy Certificate: Users can provide .pem file certificate in order to configure HTTP client to trust Proxy Server certificate.
  • Connection Specs: Users can provide connection specs to setup HTTP client with different cipher suites.

October 12th, 2023, v2.9.0

Floating Client

  • added Floating License borrowing

September 14th, 2023, v2.8.6

All SDK's

  • added resetConsumption and consumptionPeriod to LicenseFeature class

July 10th, 2023, v2.8.3

All SDK's

  • Changed the exception message (ConnectionException) when there are problems with proxy auth. New message is:
    • "Failed to authenticate with the proxy server. Please check your proxy credentials setup or contact your IT department for assistance."

July 3rd, 2023, v2.8.2

All SDK's

  • Added id and deviceId fields to the LicenseData class

June 26th, 2023, v2.8.1

License Management

  • Fix error decoder empty code and message fields

April 28th, 2023, v2.8.0

License Management

  • BREAKING: Changed single user to list of users in OrderLicense class
  • Added isManager boolean field to UserBasedLicense class

April 28th, 2023, v2.7.0

All SDK's

  • Add support for parsing date when creating ZonedDateTime License Client
  • Fixed AirGapped signatures

March 17th, 2023, v2.6.2

Floating Client

  • Fix when using only checkLicense() (without activateLicense() - example: on app restart)

March 1st, 2023, v2.6.1

License Client

  • Changed AirGapped to use Java classes instead of BouncyCastle

February 28th, 2023, v2.6.0

All SDK's

  • licenseSignature verification fix (pem files)

January 30th, 2023, v2.5.9 - BROKEN VERSION

License Client

  • Remove unused BouncyCastle provider in AirGappedService

January 17th, 2023, v2.5.8 - BROKEN VERSION

License Client

  • Renewed the code signing certificate

January 16th, 2023, v2.5.7 - BROKEN VERSION

License Client

  • Removed BouncyCastle provider for AirGap - use default provider

January 10th, 2023, v2.5.6 - BROKEN VERSION

License Client

  • Added support for multiple licenses on the same device. Added the LicenseManagerFactory for creating multiple LicenseManager objects (one for each different license)
  • Added support for offline user-based licences

November 4th, 2022, v2.5.5 - BROKEN VERSION

License Client

  • Added AirGappedService and LicenseSpringManager methods: getAirGapActivationCode(), verifyAirGapConfirmationCode(), activateAirGapResponse()

August 10th, 2022, v2.5.4

License Client

  • Added reinitialize() methods to LicenseManager

June 28th, 2022, v2.5.3

All SDK's

  • Corrected query parameters on azure metadata endpoint

June 10th, 2022, v2.5.2

All SDK's

  • Added azure environment variable WEBSITE_INSTANCE_ID check to HardwareIdStrategy.AUTO_NODE_LOCK

May 18th, 2022, v2.5.1

All SDK's

  • Updated OSHI library to 6.1.6 version

December 21st, 2021, v2.5.0

License Client and Floating Client

  • Added verification on any kind of license load.

December 20th, 2021, v2.4.16

License Client and Floating Client

  • Added verification of license on every check call.

December 14th, 2021, v2.4.15

All SDK's

  • Added HardwareIdStrategy.NO_DISK_HARDWARE_ID, for creating hardware IDs without disk information (in case of removable card readers or similar devices that are detected as disks). For more information, see Java Hardware (Device) IDs

December 9th, 2021, v2.4.14

License Client

  • Added setOfflineMode to LicenseManager.

License Client and Floating Client

  • Added infoToStore configuration parameters. This enables to fine tune what information you want to send to LS servers during license activation and checking. If storeMachineInfo is off, then this property is ignored, defaults to ALL info. Docs are at the end of configuration optional parameters, see Java License Client for an example for License Client

November 22nd, 2021, v2.4.13

  • Populated lastUsage field after license check (resolves issues when using offline mode after online activation)
  • Added storeMachineInfo configuration parameter (License and Floating Configurations) - false by default. This toggles the collection of additional machine data, which includes:
    • hostname
    • ipAddress
    • macAddress
    • vmInfo
    • osInfo

November 10th, 2021, v2.4.12

All SDK's

  • Added requestTimeout to configurations (in seconds) for API calls, defaults to 10 seconds

October 11th, 2021, v2.4.11

License Client

  • Added fields to LicenseFeature class: allowOverages, maxOverages
  • Added overages logic to increaseConsumption() and increaseFeatureConsumption() methods

September 29th, 2021, v2.4.10

Management SDK

  • Added fields to ProductFeature class: allowOverages, maxOverages, resetConsumption, consumptionPeriod

August 27th, 2021, v2.4.9

All SDK's

  • Added azure environment variable check (WEBSITE_INSTANCE_ID) for offline azure cloud instances
  • Added name and expiryDate for LicenseFeatures

June 29th, 2021, v2.4.8

All SDK's

  • Added shutdownScheduler() method to client SDKs for manually shutting down the scheduled executors used for periodic checks, see Java Advanced Usage.

June 24th, 2021, v2.4.7

All SDK's

  • Added Shutdown hooks to all executor services (used when the periodic check feature is turned on)
  • Added the disableSsl configuration option for rare cases when the app cannot verify LicenseSpring servers certificates. More info in Java Advanced Usage.

June 9th, 2021, v2.4.6

All SDK's

  • Added support for basic authentication when using a forward proxy. Just set proxyUser and proxyPass in any configuration object to use. More info in Java Advanced Usage.

May 20th, 2021, v2.4.5

All SDK's

  • Added support for AWS IMDSv2 node locking (was only IMDSv1)
  • Additional fields to the LicenseData object:
    • allowOverages
    • maxOverages
    • preventVm
    • isFloatingCloud
    • isFloating
    • transferCount
    • floatingInUseDevices
    • floatingInUse
    • resetConsumption
    • consumptionPeriod

You can read the description of each field in the Javadoc & Downloads section.

Floating Client SDK

  • Added on-premise floating server support! Documentation can be found on our Proxy Floating page.

Management SDK

  • Added licenseUsers to the DeviceLicense object (used in the devices via LicenseServices)

April 19th, 2021, v2.4.4

License Client

  • Added ignoreServerExceptions field in LicenseSpringConfiguration - when enabled, it acts as gracePeriodDays (ignoring exceptions if SDK cannot connect to LS servers for License check), but without a time limit

April 15th, 2021, v2.4.3

License Client

  • Increased the maximum allowed for gracePeriodDays to 30 (was 5) and added that information to Java License Client

April 13th, 2021, v2.4.2

All SDK's

  • Added Locale.ENGLISH for query field name serialization (fix for Turkish locale)

Management SDK

  • Changed field in the Device model - "license" is no longer just an ID, now it's an object with: id, license_key

April 9th, 2021, v2.4.1

License Client

  • Fixed an issue when in offline mode to check for clock tampering before setting the lastUsage (this is done during initialisation and on every LicenseManager.getCurrent() call) - you can also manually check for clock tampering in by calling license.localCheck()

April 2nd, 2021, v2.4.0

This release introduces a multitude of changes made in the License Management module. A lot of DTO changes (request and response models). If you are using the License Management SDK, please update to the latest version since older API's are no longer supported or they had method signature changes.

BREAKING CHANGES

Management SDK

  • Removed assignUsers method in OrderService. There is a new method with similar functionality in LicenseService called assignMultipleUsers
  • The field orderItems in the search result of searchOrders method is now empty to cut down on length of the results. The field orderItems is still available for reading while using the getOrder method.
  • BackOfficeLicense has a field product which isn't Long type anymore, instead it's a class BackOfficeLicenseProduct.
  • Removed fields companyName and reference from LicenseUser class.
  • Removed field companyName from AssignUserToLicenseRequest class.

Floating Client SDK

  • Removed field isCloudFloating from FloatingConfiguration class. The field is redunant because floating/floating cloud configurations are separated in two classes: ProxyConfiguration and FloatingConfiguration.

Changelog

All SDK's

  • Added support for a forward proxy! Just set proxyPort and proxyHost in any configuration object to use the forward proxy. More info in Java Advanced Usage
  • Updated oshi and feign libraries to their latest versions (5.6.1 and 11.1) - to fix some bugs on Windows

License Client

  • Added deletion of local license file in checkLicense() method (invoked during initialisation too), in case of license_not_found response (this is the case of deleting a license)

Management SDK

  • 3 new services added as a composition to existing management services:
    • DeviceVariablesService found in LicenseService
    • LicenseCustomFieldsService found in LicenseService
    • ProductCustomFieldsService found in OrderService
  • All 3 (DeviceVariablesService, LicenseCustomFieldsService, ProductCustomFieldsService) have the following methods:
    • search
    • get
    • create
    • update
    • delete
    • paginate
  • Added enableRetrying option to ManagementConfiguration (same functionality as in the other SDKs)
  • New method setUserPassword in LicenseService class.
  • Added prebuild check for releaseDate field in CreateInstallationFileRequest to check if it's in YYYY-MM-DD format.
  • New fields in BackOfficeCustomer class :
    • labels - array of customers labels
    • allLabelNames - name of customers labels
    • labelIds - ids of customers labels
  • New fields in BackOfficeLicense class:
    • licenseUsers - list of all users that use the license
    • activeUpToDateDevices - total number of devices that are currently using the license
    • totalActiveDevices - total number of devices that have status active on the license
    • note - note about the license
    • maxLicenseUsers - maximum number of users that can use the license
  • New fields in LicenseUser class:
    • isStaff - boolean, is user also a part of the company staff
    • subscribedToEmail - boolean, is user subscribed to newsletter
    • acquiredConsent - date when consent was acquired
  • New field in AssignUserToLicenseRequest class, isManager boolean field.
  • New methods in LicenseService class:
    • resetTotalConsumptions
    • setTotalConsumptions
    • assignMultipleUsers
    • unassignUser
    • blacklistDevice
    • resetDevice
  • New methods in OrderService class:
    • searchInstallationFiles
    • getInstallationFile
    • createInstallationFile
    • paginateThroughAllInstallationFiles
  • New filters and sort options in search requests.

September 25th, 2020, v.2.3.2

  • Adapted the caching mechanism in the License class, so that both feature and license consumptions are first checked and then updated. (apriori)

September 22nd, 2020, v.2.3.1

  • Fixed issue with license feature consumption
  • Added utility methods to check presence of features on LicenseData class
  • Fixed wrong javadoc on the LicenseManager class, check method. Added more context for check method.

September 18th, 2020, v.2.3.0

Online documentation

  • Added Javadoc coverage information on online documentation per module & version
  • Added a help page on Java Modules

License Client

  • Added offline de/activation methods with InputStream and OutputStream as parameters
  • Fixed issue with offline activation response loading - wrong file name.

LicenseManager

  • Added patchLicense method to modify product features on existing licenses.
  • Added some javadoc
  • Increased test coverage

September 10th, 2020, v2.2.0

Core SDK

  • Completely restructured online documentation
  • Transitions to hosted Javadoc & Downloads. The javadoc is still available for download via maven.
  • Added node locking options for AWS and Azure Cloud(s)
  • Refactored internal class packages
  • Added a Retryer option, which enables retries of failed requests due to infrastructural reasons (connection issues, server 5xx errors) - up to 4 retries with the longest delay period of 20 seconds. Off by default.
  • Expanded the LicenseSpring Exception model (note: the basic classes still remain, all extend from LicenseSpringException, and are still unchecked)
  • Rewritten @SuperBuilder in configuration classes, to generate javadoc properly
  • Added a delombok process, in order to add javadoc to auto-generated code
  • Higher coverage with javadoc on all Java SDKs

License Client SDK

  • Added a grace period configuration option, which resolves the remote Check services to a local license check with a grace period from 1 to 5 days. Note that the grace period applies only to the Check method and for infrastructural problems (connection, server error). License validation exceptions are still thrown. Default behaviour is off.
  • Added throws LicenseSpringException to every LicenseManager method (unchecked)
  • Enabled negative increments of consumptions - defaults to disabled in configuration.
  • Removed the option to place orders from the Client SDKs.

Floating Client SDK

  • Implemented an automated Shutdown hook background thread. The thread releases activated licenses and deactivates the license. By default the shutdown hook is enabled, and can be disabled
  • Added a per-process (UUID) generated hardware ID strategy which works well with the floating license model.
  • Defined a CheckSubscriber interface which can be used to subscribe to background check events. Default implementation ignores the incoming events.
  • Added a background periodic check caller for all activated licenses. Deactivation removes the licenses from the pool. Period is 1/2 of the floating license duration. On by default.
  • Tested support for multiple licenses and products at the same time. Multiple FloatingLicenseServices required for multiple products, multiple licenses on the same product can be used within the same FloatingLicenseServices instance.

Management SDK

  • Implemented the following methods on LicenseService
    • searchLicenses
    • disableAllLicenses
    • disableLicense
    • getLicense
    • updateLicense
    • assignUser
    • resetLicense
    • enableLicense
    • searchDevices
    • getDevice
    • paginateThroughAllLicenses
    • paginateThroughAllDevices

Implemented the following methods on OrderService

  • searchOrders
  • getOrder
  • exportToCsv
  • assignUsers
  • generateLicenseKeys (migrated from Webhook API)
  • createOrder (migrated from Webhook API)
  • searchProducts
  • getProduct
  • paginateThroughAllOrders
  • paginateThroughAllProducts

July 28th, 2020, v2.1.0

  • Added OSGi support

July 15th, 2020, v2.0.2

  • Removed oshi-demo from dependancy list
  • Support in detecting AWS EC2 instances
  • Added javadoc in Floating SDK

July 15th, 2020, v2.0.0

  • Java SDK was split into 4 different modules
  • Manifest updated and created for each module - support for OSGI was added
  • Added LICENSE file to distribution in jars
  • Added support for floating licenses

Auto-Generated javadoc on deployment - ready for use in iDEs.

June 12th, 2020, v1.9.3

  • Refactored offline license request/response code from LicenseRepository into a separate class
  • Made LicenseRepository an interface SDK users can implement.
  • Added a intitialize() method overload on LicenseSpringManager which accepts the LicenseRepository as the second parameter.
  • Added the default implementation of LicenseRepository, no SDK users will not need to change their implementation, unless building a custom LicenseRepository.
  • Added some checks to prevent entering locking code when there is no need to sync consumptions with LicenseSpring servers.

May 22nd, 2020, v1.9.2

  • Fixed issues with consumptions and caching - the local consumption check was not performed with local state.
  • Removed license deletion on initialization because of server errors. The SDK still deletes the license if the hardware key does not match the one in the license file. The LicenseManager initialize() method can now throw the LicenseSpringException, which the client should handle per use case basis.

May 21st, 2020, v1.9.1

  • Fixed bug with daysRemaining method on License. SUBSCRIPTION license returned max days, instead of CONSUMPTION type.

May 8th, 2020, v1.9

  • Fixed issues with OSHI auto-update version
  • Added request logging options, default is OFF/NONE.
  • Added more tests
  • Refactored code

May 1st, 2020, v1.8

  • fixed issues with Version API
  • implemented local cache for feature consumptions
  • added consumption sync to standard check calls
  • implemented periodic license check - can be enabled via configuration. Period of sync can also be specified.

April 2nd, 2020, v1.7

  • exposed JsonSerialization class

March 29th, 2020, v1.6.

  • Fixed omission of generateTrialKey overload with full customer details
  • Implemented Order model

March 19th, 2020, v1.4.

  • Fixed bug in hardware key generation when no disk is mounted (e.g. VM)

March 13th, 2020, v1.3

  • Added javadoc
  • Changed hardware key generation (might break some builds) - reactivate your license.
  • Fixed minor issues on tracking OS name
  • Fixed major issue with locale support

February 28, 2020, v0.0.1

  • Initial Release of the LicenseSpring Java SDK.
  • There are issues with Offline activation, expected to be resolve by 7th of March, 2020.