public class LicenseService extends Object
| Constructor and Description |
|---|
LicenseService(ManagementConfiguration configuration)
LicenseService has to be built using the ManagementConfiguration object.
|
| Modifier and Type | Method and Description |
|---|---|
List<MultipleAssignmentResponse> |
assignMultipleUsers(Long licenseId,
AssignMultipleUsersRequest request)
Assigns multiple users to a single license if requesting manager has access permissions to it.
|
String |
assignUser(Long licenseId,
AssignUserToLicenseRequest licenseUser)
Assigns the provided user to the license.
|
boolean |
blacklistDevice(Long id)
Blacklists the device.
|
DeviceVariablesService |
deviceVariablesService()
Returns service for device variables.
|
boolean |
disableAllLicenses(Long[] licenseIds)
Disables licenses in bulk.
|
boolean |
disableLicense(Long licenseId)
Disables the license with provided id.
|
BackOfficeLicense |
enableLicense(Long licenseId)
Enables license with the provided id.
|
Device |
getDevice(Long id)
Gets the device data.
|
BackOfficeLicense |
getLicense(Long licenseId)
Retrieves license data.
|
LicenseCustomFieldsService |
licenseCustomFieldsService()
Returns service for license custom fields.
|
List<Device> |
paginateThroughAllDevices(SearchDevicesRequest request)
Goes through all pages of the search devices response and returns a list with all possible devices that satisfy the request.
|
List<BackOfficeLicense> |
paginateThroughAllLicenses(SearchLicensesRequest request)
Goes through all pages of the search licenses response and returns a list with all possible licenses that satisfy the request.
|
BackOfficeLicense |
patchLicenseFeatures(Long licenseId,
PatchLicenseFeaturesRequest request)
Patches the license (product) features available.
|
boolean |
resetDevice(Long id)
Resets the device.
|
boolean |
resetLicense(Long licenseId)
Resets the license with the provided id.
|
BackOfficeLicense |
resetTotalConsumptions(Long licenseId)
Resets the total consumptions on the license to zero.
|
SearchResult<Device> |
searchDevices(SearchDevicesRequest request)
Returns a list of devices that satisfy the request.
|
SearchResult<BackOfficeLicense> |
searchLicenses(SearchLicensesRequest request)
Returns list of licenses that satisfy the request.
|
BackOfficeLicense |
setTotalConsumptions(Long licenseId,
int totalConsumptions)
Sets the total consumptions on the license to the desired number.
|
boolean |
setUserPassword(int userId,
String newPassword)
Sets the license users password to a new value.
|
Boolean |
unassignUser(Long licenseId,
int licenseUserId)
Unassigns a user from a single license if requesting manager has access permissions to it.
|
BackOfficeLicense |
updateLicense(Long licenseId,
UpdateLicenseRequest request)
Updates the license with the provided id.
|
public LicenseService(ManagementConfiguration configuration)
configuration - build via the builder patternpublic LicenseCustomFieldsService licenseCustomFieldsService()
public DeviceVariablesService deviceVariablesService()
public SearchResult<BackOfficeLicense> searchLicenses(SearchLicensesRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
request - search request that can be made using the builder methodcom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean disableAllLicenses(Long[] licenseIds) throws com.licensespring.model.exceptions.LicenseSpringException
licenseIds - string array that contains all license ids that need to be disabledcom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense getLicense(Long licenseId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be fetched, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense updateLicense(Long licenseId, UpdateLicenseRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be updated, 16 digit numberrequest - use builder for constructing the object, fill only the fields that you want to updatecom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense patchLicenseFeatures(Long licenseId, PatchLicenseFeaturesRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be updated, 16 digit numberrequest - use builder for constructing the object, fill all fields to prevent losing featurescom.licensespring.model.exceptions.LicenseSpringExceptionpublic String assignUser(Long licenseId, AssignUserToLicenseRequest licenseUser) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be assigned to the user, 16 digit numberlicenseUser - AssignedLicenseUser object, contains user data, use builder to construct this objectcom.licensespring.model.exceptions.LicenseSpringExceptionpublic List<MultipleAssignmentResponse> assignMultipleUsers(Long licenseId, AssignMultipleUsersRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be assigned to the user, 16 digit numberrequest - request containing information about the users and this assignmentcom.licensespring.model.exceptions.LicenseSpringExceptionpublic Boolean unassignUser(Long licenseId, int licenseUserId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license, 16 digit numberlicenseUserId - id of the user that needs to be unassignedcom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean disableLicense(Long licenseId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be disabled, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean resetLicense(Long licenseId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs a reset, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense enableLicense(Long licenseId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs to be enabled, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense setTotalConsumptions(Long licenseId, int totalConsumptions) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs consumptions update, 16 digit numbertotalConsumptions - number of consumptions to set the field total_consumptions tocom.licensespring.model.exceptions.LicenseSpringExceptionpublic BackOfficeLicense resetTotalConsumptions(Long licenseId) throws com.licensespring.model.exceptions.LicenseSpringException
licenseId - id of the license that needs consumptions reset, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic SearchResult<Device> searchDevices(SearchDevicesRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
request - search request that can be made using the buildercom.licensespring.model.exceptions.LicenseSpringExceptionpublic Device getDevice(Long id) throws com.licensespring.model.exceptions.LicenseSpringException
id - id of the device, 16 digit numbercom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean resetDevice(Long id) throws com.licensespring.model.exceptions.LicenseSpringException
id - id of the device that needs a resetcom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean blacklistDevice(Long id) throws com.licensespring.model.exceptions.LicenseSpringException
id - id of the device that needs to be blacklistedcom.licensespring.model.exceptions.LicenseSpringExceptionpublic List<BackOfficeLicense> paginateThroughAllLicenses(SearchLicensesRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
searchLicenses(SearchLicensesRequest)
in order to get results per page.request - can be made with builder, contains query fieldscom.licensespring.model.exceptions.LicenseSpringExceptionpublic List<Device> paginateThroughAllDevices(SearchDevicesRequest request) throws com.licensespring.model.exceptions.LicenseSpringException
searchDevices(SearchDevicesRequest)
in order to get results per page.request - can be made with builder, contains query fieldscom.licensespring.model.exceptions.LicenseSpringExceptionpublic boolean setUserPassword(int userId,
String newPassword)
throws com.licensespring.model.exceptions.LicenseSpringException
userId - id of the license usernewPassword - new passwordcom.licensespring.model.exceptions.LicenseSpringExceptionCopyright © 2022 Cense Data Inc.. All rights reserved.