Proxy Floating
The ProxyFloatingService is intended to be used with the on-premise Floating Server (Old) and is part of the Floating Client module.
At the minimum there are three parameters you will need to initialize the SDK:
- apiKey, your company API key
- sharedKey, company-specific encryption key, used when signing requests
- productCode, an alphanumeric code identifying a specific product
The productCode is tied to a specific product the license applies to and is defined while creating the product.
Optional Configuration parameters for initializing the Floating Client SDK:
- addShutdownHook indicates if you want the SDK to automatically release any currently active licenses on the device before you shut down the runtime process. Default is true.
- enablePeriodicRegister enables periodic calls to register method to prolong the license usage. It will be prolonged every time the license has passed half of its floating timeout time. Usage time is set through the LicenseSpring platform with the floatingTimeout parameter in the product configuration
- proxyRegisterSubscriber subscriber on periodic register, default implementation is IgnoreRegisterEventSubscriber, but you can add your own implementation to handle the onSuccess and onError of the periodic register. This, of course, isn't a parameter you need to worry about if you chose not to enable periodic checks.
- requestLogging request logging for debug purposes, default is no request logging.
- appVersion manually set the version of the application that's using the SDK.
- enableRetrying enables the retry option on failed API call to the server. The call can be repeated for up to 4 times. Default is false
- identityProvider set a custom IdentityProvider which generates unique keys for a particular device. Default implementation is based on ONCE_PER_PROCESS. More details on our Java Hardware (Device) IDs
- requestTimeout set the timeout of requests make to API (in seconds), default is 10 seconds
After setting up the SDK configuration, there are a number of methods and objects available to the app developer.
To make the ProxyFloatingService, initialize it by passing the ProxyConfiguration object you set up earlier.
Now you can use the methods that the ProxyFloatingService provides.
Registers the user by making a ProxyRequest which contains the product code from the ProxyConfiguration and the device ID which is provided by the IdentityProvider. Each registration lasts for the time specified in the LicenseSpring platform (floating timeout). In order to prolong the usage of the product, this method needs to be called periodically (this is automatically called in the background if the property enablePeriodicRegister in the ProxyConfiguration was set to true). Returns the LicenseData object which contains information about the license.
Unregisters the user, which by definition, frees up one user slot on the server. Returns true if the action was successful.
Fetches the license information from the server for the product specified in the ProxyConfiguration object.
Retrievers the server settings. The returned Settings object contains registrationExpiryMinutes, and an array of server addresses.
Pings the local proxy server.