SDKs
Java SDK
Floating Server V2
22 min
floating server v2 java client documentation 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 throws licensespringexception if authentication fails unsupportedoperationexception if using floating server v1 api description logs in a user with the provided credentials and returns an authentication token only available with floating server v2 api configuration methods 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 of password change throws licensespringexception if password change fails unsupportedoperationexception if using floating server v1 api description changes the password for the specified user only available with floating server v2 api 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) throws licensespringexception if the request fails unsupportedoperationexception if using floating server v1 api description fetches all licenses associated with the product specified in proxyconfiguration only available with floating server v2 api getlicensebyid retrieves detailed information for a specific license by id public licensedata getlicensebyid(long id) throws licensespringexception parameters id (long) the license identifier returns licensedata complete license object with details throws licensespringexception if the request fails unsupportedoperationexception if using floating server v1 api description retrieves comprehensive license details by id only available with floating server v2 api 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 throws licensespringexception if activation fails unsupportedoperationexception if using floating server v1 api description activates a product license using the license key the product is taken from proxyconfiguration only available with floating server v2 api 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 throws licensespringexception if removal fails unsupportedoperationexception if using floating server v1 api description removes the specified license from the floating server only available with floating server v2 api 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 throws licensespringexception if borrowing fails unsupportedoperationexception if using floating server v1 api description borrows a license slot for offline usage the borroweduntil timestamp is converted to utc and formatted as iso offset date time only available with floating server v2 api user management methods adduser adds a new user to the floating server public adduserresponse adduser(adduserrequest payload) throws licensespringexception parameters payload (adduserrequest) user details to add returns adduserresponse response containing added user information throws licensespringexception if user addition fails unsupportedoperationexception if using floating server v1 api description creates a new user on the floating server only available with floating server v2 api removeuser removes a user from the floating server public removeuserresponse removeuser(removeuserrequest payload) throws licensespringexception parameters payload (removeuserrequest) user details to remove returns removeuserresponse response confirming user removal throws licensespringexception if user removal fails unsupportedoperationexception if using floating server v1 api description deletes a user from the floating server only available with floating server v2 api registerusertolicensev2 registers a user to a specific license public licensedata registerusertolicensev2(long licenseid, registerusertolicenserequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (registerusertolicenserequest) user registration details returns licensedata updated license data after user registration throws licensespringexception if registration fails unsupportedoperationexception if using floating server v1 api description registers a user to the specified license with allowed registrations only available with floating server v2 api unregisteruserfromlicensev2 unregisters a user from a specific license public void unregisteruserfromlicensev2(long licenseid, unregisteruserfromlicenserequest payload) throws licensespringexception parameters licenseid (long) the license identifier payload (unregisteruserfromlicenserequest) user unregistration details throws licensespringexception if unregistration fails unsupportedoperationexception if using floating server v1 api description unregisters a user from the specified license, freeing up a user slot only available with floating server v2 api 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 containing user and feature code returns registerfeatureforuserresponse registration result throws licensespringexception if registration fails unsupportedoperationexception if using floating server v1 api description registers a feature allocation for a user under the specified license only available with floating server v2 api 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 containing user and feature code throws licensespringexception if release fails unsupportedoperationexception if using floating server v1 api description releases a feature allocation for a user, freeing up the feature slot only available with floating server v2 api 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 throws licensespringexception if consumption recording fails unsupportedoperationexception if using floating server v1 api description records consumption usage against the specified license only available with floating server v2 api 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 throws licensespringexception if consumption recording fails unsupportedoperationexception if using floating server v1 api description records consumption usage against a specific feature within the license only available with floating server v2 api getting started proxyconfiguration proxyconfiguration = proxyconfiguration builder() host("localhost") port(8080) proxyuser("admin") proxypass("admin") product("\<productcode>") build(); proxyfloatingservice service = new proxyfloatingservice(proxyconfiguration); // add new user to floating server, default user created is admin/admin adduserrequest adduserreq = adduserrequest builder() email("\<email>") username("\<username>") password("\<password>") role("admin") build(); service adduser(adduserreq); list\<licensedata> licenses = service getlicenses(); // pick license out of available ones licensedata license = licenses get(0); long licenseid = license getid(); registerusertolicenserequest req = registerusertolicenserequest builder() email("\<email>") username("\<username>") build(); service registerusertolicensev2(licenseid, req); note all methods documented here are only available when using floating server v2 api the service automatically detects api version on initialization