Package com.cumulocity.sdk.client.option
Class TenantOptionApiImpl
- java.lang.Object
-
- com.cumulocity.sdk.client.option.TenantOptionApiImpl
-
- All Implemented Interfaces:
TenantOptionApi
public class TenantOptionApiImpl extends Object implements TenantOptionApi
-
-
Constructor Summary
Constructors Constructor Description TenantOptionApiImpl(RestConnector restConnector, TenantApiRepresentation tenantApiRepresentation, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(OptionPK optionPK)
Deletes option from the platform.List<OptionRepresentation>
getAllOptionsForCategory(String category)
Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READOptionRepresentation
getOption(OptionPK optionPK)
Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READTenantOptionCollection
getOptions()
Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READOptionRepresentation
save(OptionRepresentation representation)
Creates or updates an option in the platform.Future
saveAsync(OptionRepresentation representation)
Creates or updates an option in the platform.
-
-
-
Constructor Detail
-
TenantOptionApiImpl
public TenantOptionApiImpl(RestConnector restConnector, TenantApiRepresentation tenantApiRepresentation, int pageSize)
-
-
Method Detail
-
getOption
public OptionRepresentation getOption(OptionPK optionPK) throws SDKException
Description copied from interface:TenantOptionApi
Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOption
in interfaceTenantOptionApi
- Parameters:
optionPK
- id of the option to search for- Returns:
- the option with the given id
- Throws:
SDKException
- if the option is not found or if the query failed
-
getOptions
public TenantOptionCollection getOptions() throws SDKException
Description copied from interface:TenantOptionApi
Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOptions
in interfaceTenantOptionApi
- Returns:
- collection of options with paging functionality
- Throws:
SDKException
- if the query failed
-
save
public OptionRepresentation save(OptionRepresentation representation) throws SDKException
Description copied from interface:TenantOptionApi
Creates or updates an option in the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
save
in interfaceTenantOptionApi
- Parameters:
representation
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
saveAsync
public Future saveAsync(OptionRepresentation representation) throws SDKException
Description copied from interface:TenantOptionApi
Creates or updates an option in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
saveAsync
in interfaceTenantOptionApi
- Parameters:
representation
- option to be created- Returns:
- the created option with the generated id
- Throws:
SDKException
- if the option could not be created
-
delete
public void delete(OptionPK optionPK) throws SDKException
Description copied from interface:TenantOptionApi
Deletes option from the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
delete
in interfaceTenantOptionApi
- Parameters:
optionPK
- to be deleted- Throws:
SDKException
- if the measurement could not be deleted
-
getAllOptionsForCategory
public List<OptionRepresentation> getAllOptionsForCategory(String category) throws SDKException
Description copied from interface:TenantOptionApi
Gets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getAllOptionsForCategory
in interfaceTenantOptionApi
- Parameters:
category
- tenant options category- Returns:
- collection of options
- Throws:
SDKException
- if the query failed
-
-