SDKs
Java SDK
Floating Server V2
49 min
floating server v2 java client documentation overview the floating server v2 (fsv2) java client provides a complete api for managing floating licenses through an on premises server it supports license management, user registration/unregistration, feature management, consumption tracking, offline/airgap licensing, and administrative operations key concepts register/unregister replaces activate/deactivate — registering a user to a license is the fsv2 equivalent of activating a floating license getlicensebyid returns full license state including floatinginusedevices , isvalid , islicensed , licenseactive , and licenseenabled getlicenseusers returns the list of currently registered users with their borrow status — use this to verify if a user is already registered getlicensefeatures returns registered feature users fsv1 and fsv2 are separate implementations — v1 proxy endpoints are not available on the v2 server getting started proxyconfiguration proxyconfiguration = proxyconfiguration builder() host("localhost") port(8080) proxyuser("admin") proxypass("admin") product("\<productcode>") proxycertpath("path/to/certificate chain pem") build(); proxyfloatingservice service = new proxyfloatingservice(proxyconfiguration); typical integration flow // 1 get available licenses list\<licensedata> licenses = service getlicenses(); licensedata license = licenses get(0); long licenseid = license getid(); // 2 register a user to a license (equivalent to "activate") registerusertolicenserequest req = registerusertolicenserequest builder() email("user\@example com") username("user1") build(); licensedata updatedlicense = service registerusertolicensev2(licenseid, req); // 3 check license state — floatinginusedevices shows active registrations licensedata licensestate = service getlicensebyid(licenseid); system out println("in use devices " + licensestate getfloatinginusedevices()); system out println("is valid " + licensestate getisvalid()); // 4 verify registered users list\<floatinguserresponse> users = service getlicenseusers(licenseid); for (floatinguserresponse user users) { system out println(user getusername() + " borrowed until " + user getborroweduntil()); } // 5 re register before floating timeout expires (periodic check in) service registerusertolicensev2(licenseid, req); // 6 release when done unregisteruserfromlicenserequest unreg = unregisteruserfromlicenserequest builder() email("user\@example com") username("user1") build(); service unregisteruserfromlicensev2(licenseid, unreg); authentication methods login authenticates a user with the floating server public loginresponse login(loginrequest payload) throws licensespringexception parameters payload (loginrequest) login credentials containing username and password returns loginresponse authentication response containing token and user information changepassword updates the password for a user on the floating server public changepasswordresponse changepassword(changepasswordrequest payload) throws licensespringexception parameters payload (changepasswordrequest) contains username, old password, and new password returns changepasswordresponse response indicating success or failure setinitialpassword sets the initial password for a newly created user public initialpasswordresponse setinitialpassword(initialpasswordrequest payload) throws licensespringexception parameters payload (initialpasswordrequest) contains username and new password returns initialpasswordresponse response confirming password was set getme retrieves the current authenticated user's information public meresponse getme() throws licensespringexception returns meresponse current user details license management methods getlicenses retrieves all licenses for the configured product public list\<licensedata> getlicenses() throws licensespringexception returns list\<licensedata> list of all licenses for the product (empty list if none found) getlicensebyid retrieves detailed information for a specific license by id use this to check the current state of a license including how many floating slots are in use public licensedata getlicensebyid(long id) throws licensespringexception parameters id (long) the license identifier returns licensedata complete license object with details including floatinginusedevices — number of currently registered users isvalid — whether the license is valid islicensed — whether the license has a valid assignment licenseactive — whether the license is active licenseenabled — whether the license is enabled floatingusers — maximum concurrent floating users allowed floatingtimeout — timeout in minutes before registration expires expired — whether the license has expired (server side check) addlicensev2 activates a product license on the floating server public addlicenseresponse addlicensev2(addlicenseparams params) throws licensespringexception parameters params (addlicenseparams) license activation parameters containing the license key returns addlicenseresponse activation result details removelicensebyid removes a license from the floating server by id public removelicenseresponse removelicensebyid(long id) throws licensespringexception parameters id (long) the license identifier to remove returns removelicenseresponse response message indicating success user registration methods registerusertolicensev2 registers a user to a specific license this is the fsv2 equivalent of activating a floating license — it reserves a floating slot for the user public licensedata registerusertolicensev2(long licenseid, registerusertolicenserequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (registerusertolicenserequest) user registration details (email, username) returns licensedata updated license data after user registration note re calling this method for an already registered user acts as a check in, resetting the floating timeout unregisteruserfromlicensev2 unregisters a user from a specific license, freeing up a floating slot public void unregisteruserfromlicensev2(long licenseid, unregisteruserfromlicenserequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (unregisteruserfromlicenserequest) user unregistration details getlicenseusers retrieves the list of currently registered users for a license use this to verify if a specific user is already registered, check borrow status, or get the full list of active floating users public list\<floatinguserresponse> getlicenseusers(long licenseid) throws licensespringexception parameters licenseid (long) the license identifier returns list\<floatinguserresponse> list of registered users, each containing id — user registration id email — user email username — username licenseid — associated license id maxactivations — maximum activations for this user timesactivated — current activation count borroweduntil — borrow expiration timestamp (null if not borrowed) createdat / updatedat — timestamps unregisterallusersfromlicense unregisters all users from a license at once public messageresponse unregisterallusersfromlicense(long licenseid) throws licensespringexception parameters licenseid (long) the license identifier returns messageresponse confirmation message borrowlicensev2 borrows a license for offline use with specified expiration time public borrowlicenseresponse borrowlicensev2(long licenseid, borrowlicenseparams payload) throws licensespringexception parameters licenseid (long) the license identifier payload (borrowlicenseparams) borrow parameters containing username and borroweduntil timestamp returns borrowlicenseresponse borrow operation result description borrows a license slot for offline usage the borroweduntil timestamp is converted to utc and formatted as iso offset date time server user management methods adduser adds a new admin/operator user to the floating server public adduserresponse adduser(adduserrequest payload) throws licensespringexception parameters payload (adduserrequest) user details (email, username, password, role) returns adduserresponse response containing added user information getusers retrieves all server users (admin/operator accounts) public list\<userresponse> getusers() throws licensespringexception returns list\<userresponse> all server user accounts removeuser removes a server user by id public removeuserresponse removeuser(long userid) throws licensespringexception parameters userid (long) the user id to remove returns removeuserresponse response confirming user removal feature management methods registerfeatureforuserv2 registers a feature allocation for a user under a specific license public registerfeatureforuserresponse registerfeatureforuserv2(long licenseid, registerfeatureforuserrequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (registerfeatureforuserrequest) feature registration details (user and feature code) returns registerfeatureforuserresponse registration result unregisterfeatureforuserv2 releases a feature allocation for a user under a specific license public void unregisterfeatureforuserv2(long licenseid, unregisterfeatureforuserrequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (unregisterfeatureforuserrequest) feature unregistration details (user and feature code) getlicensefeatures retrieves the list of registered feature users for a license use this to check which users have which features registered public list\<floatingfeatureuserresponse> getlicensefeatures(long licenseid) throws licensespringexception parameters licenseid (long) the license identifier returns list\<floatingfeatureuserresponse> list of feature registrations, each containing id — registration id email — user email username — username featurecode — the registered feature code licenseid — associated license id createdat / updatedat — timestamps releaseallfeaturesfromlicense releases all feature allocations from a license public messageresponse releaseallfeaturesfromlicense(long licenseid) throws licensespringexception parameters licenseid (long) the license identifier returns messageresponse confirmation message consumption tracking methods addconsumptiontolicensev2 adds consumption data to a license public addconsumptiontolicenseresponse addconsumptiontolicensev2(long licenseid, addconsumptiontolicenserequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (addconsumptiontolicenserequest) consumption details to record returns addconsumptiontolicenseresponse consumption recording result addconsumptiontofeaturev2 adds consumption data to a specific feature within a license public addconsumptiontofeatureresponse addconsumptiontofeaturev2(long licenseid, addconsumptiontofeaturerequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (addconsumptiontofeaturerequest) feature consumption details to record returns addconsumptiontofeatureresponse feature consumption recording result offline licensing methods offlineactivationgenerate generates an offline activation request for processing without network connectivity public offlineactivationresponse offlineactivationgenerate(offlineactivationrequest payload) throws licensespringexception parameters payload (offlineactivationrequest) offline activation request details returns offlineactivationresponse generated activation data offlineactivationupload uploads a completed offline activation response public offlineactivationresponse offlineactivationupload(offlineactivationrequest payload) throws licensespringexception parameters payload (offlineactivationrequest) completed activation data to upload returns offlineactivationresponse upload confirmation offlinedeactivationgenerate generates an offline deactivation request public offlinedeactivationresponse offlinedeactivationgenerate(offlinedeactivationrequest payload) throws licensespringexception parameters payload (offlinedeactivationrequest) offline deactivation request details returns offlinedeactivationresponse generated deactivation data offlineupdate processes an offline license update public offlineactivationresponse offlineupdate(offlineactivationrequest payload) throws licensespringexception parameters payload (offlineactivationrequest) offline update data returns offlineactivationresponse update result air gapped licensing methods airgapgenerate generates an air gapped activation signature public airgapactivationresponse airgapgenerate(airgapactivationrequest payload) throws licensespringexception parameters payload (airgapactivationrequest) air gap generation request returns airgapactivationresponse generated signature airgapactivate activates an air gapped license public airgapactivationresponse airgapactivate(airgapactivationrequest payload) throws licensespringexception parameters payload (airgapactivationrequest) air gap activation data returns airgapactivationresponse activation result airgapdeactivategenerate generates an air gapped deactivation request public airgapdeactivationresponse airgapdeactivategenerate(airgapdeactivationrequest payload) throws licensespringexception parameters payload (airgapdeactivationrequest) air gap deactivation request returns airgapdeactivationresponse generated deactivation data airgapdeactivate processes an air gapped deactivation public airgapdeactivationresponse airgapdeactivate(airgapdeactivationrequest payload) throws licensespringexception parameters payload (airgapdeactivationrequest) air gap deactivation data returns airgapdeactivationresponse deactivation result server configuration methods getconfig retrieves the current floating server configuration public cloudconfigresponse getconfig() throws licensespringexception returns cloudconfigresponse current server configuration updateconfig updates the floating server configuration public cloudconfigresponse updateconfig(cloudconfigupdaterequest payload) throws licensespringexception parameters payload (cloudconfigupdaterequest) configuration changes to apply returns cloudconfigresponse updated configuration getsyncsettings retrieves the current sync settings public syncsettingsresponse getsyncsettings() throws licensespringexception returns syncsettingsresponse current sync configuration setsyncsettings updates the sync settings public syncresponse setsyncsettings(syncsettingsrequest payload) throws licensespringexception parameters payload (syncsettingsrequest) sync settings to apply returns syncresponse updated sync status triggersync triggers a manual synchronization with the licensespring platform public syncresponse triggersync() throws licensespringexception returns syncresponse sync result health check serverhealthy checks if the floating server is running and responsive public boolean serverhealthy() throws licensespringexception returns boolean true if the server is healthy fsv1 vs fsv2 compatibility fsv1 and fsv2 are separate implementations with different api contracts activate license register() → registerusertolicensev2() deactivate license unregister() → unregisteruserfromlicensev2() check license getlicense() → getlicensebyid() check registered users n/a → getlicenseusers() (new in v2) check feature users n/a → getlicensefeatures() (new in v2) borrow borrow() → borrowlicensev2() add consumption addconsumption() → addconsumptiontolicensev2() fsv1 proxy endpoints are not available on the v2 server the sdk's proxyfloatingservice automatically routes to the correct endpoints based on the detected api version note all v2 methods throw unsupportedoperationexception if called against a v1 server, and vice versa