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 voiddelete(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_READOptionRepresentationgetOption(OptionPK optionPK)Gets an option by id Requires role ROLE_OPTION_MANAGEMENT_READTenantOptionCollectiongetOptions()Gets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READOptionRepresentationsave(OptionRepresentation representation)Creates or updates an option in the platform.FuturesaveAsync(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:TenantOptionApiGets an option by id Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOptionin 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:TenantOptionApiGets all options from the platform Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getOptionsin 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:TenantOptionApiCreates or updates an option in the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
savein 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:TenantOptionApiCreates 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:
saveAsyncin 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:TenantOptionApiDeletes option from the platform. Requires role ROLE_OPTION_MANAGEMENT_ADMIN- Specified by:
deletein 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:TenantOptionApiGets all options from the platform for the specific category Requires role ROLE_OPTION_MANAGEMENT_READ- Specified by:
getAllOptionsForCategoryin interfaceTenantOptionApi- Parameters:
category- tenant options category- Returns:
- collection of options
- Throws:
SDKException- if the query failed
-
-