SDKs
Java SDK

Java Hardware (Device) IDs

10min
introduction licensespring sdk already provides some preconfigured identity providers, which are described in the section below if none of the preconfigured identity providers match desired use case, feel free to make your own implementation of identityprovider interface which generates a custom hardwareid getting started you can find all preconfigured identity providers in module licensespring core, package com licensespring model as enum hardwareidstrategy types of identity providers 1\ auto hardware id this identity provider will generate unique identity key per device that means that each device you are using will have its own unique identity identity key is generated based on following 3 hardware components motherboard processor (cpu) hard disks or similar storage units use this strategy if you want to generate one and only one unique id per device and you are running licensespring on physical computer as opposed to running licensespring on virtual machine 2\ no disk hardware id this identity provider is the same as auto hardware id , but without disk information this in in the cases where users add removable storage devices (like smart card reader) and the hardware id changes 3\ aws node lock this identity provider will generate unique id per virtual machine running on aws cloud platform it will generate unique id by using virtual machine id that is unique for each virtual machine instance in order to use this strategy, device which is running licensespring must have internet access as well as access to ip address 169 254 169 254 this is necessary because in order to retrieve vm id, metadata service api running on 169 254 169 254 must be called use this strategy if you are running licensespring on aws cloud platform and want to generate one and only one unique id per vm instance if using this identity provider you must be sure that licensespring application will be running on aws cloud platform this is necessary because in case you are trying to use this identity provider on physical computer then notcloudplatformexception will be thrown also, in case you are trying to use this on virtual machine that is not running on aws, wrongplatformexception will be thrown unless you are absolutely certain that licensespring will be running on aws, this strategy should be replaced with auto node lock 4\ azure node lock this identity provider will generate unique id per virtual machine running on azure cloud platform it will generate unique id by using virtual machine id that is unique for each virtual machine instance in order to use this strategy, device which is running licensespring must have internet access as well as access to ip address 169 254 169 254 this is necessary because in order to retrieve vm id, metadata service api running on 169 254 169 254 must be called it also checks for the website instance id environment variable from version 2 4 7 (from version 2 5 2 in auto node lock too) use this strategy if you are running licensespring on azure cloud platform and want to generate one and only one unique id per vm instance if using this identity provider you must be sure that licensespring application will be running on azure cloud platform this is necessary because in case you are trying to use this identity provider on physical computer then notcloudplatformexception will be thrown also, in case you are trying to use this on virtual machine that is not running on azure, wrongplatformexception will be thrown unless you are absolutely certain that licensespring will be running on azure, this strategy should be replaced with auto node lock 5\ auto node lock this identity provider will attempt to figure out on which type of device you are running licensespring (physical computer or virtual machine) if you are running on physical device then auto hardware id strategy will be chosen if you are running on virtual machine then, depending on which cloud platform you are running licensespring, either aws node lock or azure node lock strategy will be chosen use this strategy if you are not sure on what type of device licensespring will be running auto node lock strategy will not throw exceptions like aws node lock or azure node lock do but because auto node lock needs to figure out which strategy to choose, it takes longer to execute 6\ once per process this identity provider will generate new identity each time method getkey() is called this is useful for generating multiple identity keys on one device this strategy is useful for floating license as identity key is not bound to single hardware/device so that multiple processes/vms (or several layers of vms) will have unique keys preventing over usage this is the default method used by the floating client docid 85ozdmi ceei i5t6ldh7 use this strategy in order to completely control how many instances of your application are running it also requires the cachehardwareid(boolean) configuration option to be true or a configurationexception will be thrown during init 7\ custom identity provider if none of identity providers matches your use case, feel free to make your own custom implementation identityprovider interface can be implemented in the following way public class mycustomidentityprovider implements identityprovider { @override public string getkey() { return "mycustomidentitykey"; } }