Package com.cumulocity.sdk.client.alarm
Class AlarmApiImpl
- java.lang.Object
-
- com.cumulocity.sdk.client.alarm.AlarmApiImpl
-
-
Constructor Summary
Constructors Constructor Description AlarmApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, AlarmsApiRepresentation alarmsApiRepresentation, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AlarmRepresentation
create(AlarmRepresentation representation)
Creates an alarm in the platform.Future
createAsync(AlarmRepresentation representation)
Creates an alarm in the platform.void
deleteAlarmsByFilter(AlarmFilter filter)
Delete alarms from the platform based on the specified filterAlarmRepresentation
getAlarm(GId alarmId)
Gets an alarm by idAlarmCollection
getAlarms()
Gets all alarms from the platformAlarmCollection
getAlarmsByFilter(AlarmFilter filter)
Gets alarms from the platform based on the specified filterAlarmRepresentation
update(AlarmRepresentation alarmToUpdate)
Updates an alarm in the platform.AlarmRepresentation
updateAlarm(AlarmRepresentation alarmToUpdate)
Deprecated.
-
-
-
Constructor Detail
-
AlarmApiImpl
public AlarmApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, AlarmsApiRepresentation alarmsApiRepresentation, int pageSize)
-
-
Method Detail
-
getAlarm
public AlarmRepresentation getAlarm(GId alarmId) throws SDKException
Description copied from interface:AlarmApi
Gets an alarm by id- Specified by:
getAlarm
in interfaceAlarmApi
- Parameters:
alarmId
- id of the alarm to search for- Returns:
- the alarm with the given id
- Throws:
SDKException
- if the alarm is not found or if the query failed
-
updateAlarm
@Deprecated public AlarmRepresentation updateAlarm(AlarmRepresentation alarmToUpdate) throws SDKException
Deprecated.Description copied from interface:AlarmApi
Updates an alarm in the platform. The alarm to be updated is identified by the id within the given alarm.- Specified by:
updateAlarm
in interfaceAlarmApi
- Parameters:
alarmToUpdate
- to be updated- Returns:
- the updated alarm
- Throws:
SDKException
- if the alarm could not be updated
-
update
public AlarmRepresentation update(AlarmRepresentation alarmToUpdate) throws SDKException
Description copied from interface:AlarmApi
Updates an alarm in the platform. The alarm to be updated is identified by the id within the given alarm.- Specified by:
update
in interfaceAlarmApi
- Parameters:
alarmToUpdate
- to be updated- Returns:
- the updated alarm
- Throws:
SDKException
- if the alarm could not be updated
-
getAlarms
public AlarmCollection getAlarms() throws SDKException
Description copied from interface:AlarmApi
Gets all alarms from the platform- Specified by:
getAlarms
in interfaceAlarmApi
- Returns:
- collection of alarms with paging functionality
- Throws:
SDKException
- if the query failed
-
create
public AlarmRepresentation create(AlarmRepresentation representation) throws SDKException
Description copied from interface:AlarmApi
Creates an alarm in the platform. The id of the alarm must not be set, since it will be generated by the platform- Specified by:
create
in interfaceAlarmApi
- Parameters:
representation
- alarm to be created- Returns:
- the created alarm with the generated id
- Throws:
SDKException
- if the alarm could not be created
-
createAsync
public Future createAsync(AlarmRepresentation representation) throws SDKException
Description copied from interface:AlarmApi
Creates an alarm in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider.- Specified by:
createAsync
in interfaceAlarmApi
- Parameters:
representation
- alarm to be created- Returns:
- the created alarm with the generated id
- Throws:
SDKException
- if the alarm could not be created
-
getAlarmsByFilter
public AlarmCollection getAlarmsByFilter(AlarmFilter filter) throws SDKException
Description copied from interface:AlarmApi
Gets alarms from the platform based on the specified filter- Specified by:
getAlarmsByFilter
in interfaceAlarmApi
- Parameters:
filter
- the filter criteria(s)- Returns:
- collection of alarms matched by the filter with paging functionality
- Throws:
SDKException
- if the query failed
-
deleteAlarmsByFilter
public void deleteAlarmsByFilter(AlarmFilter filter) throws IllegalArgumentException, SDKException
Description copied from interface:AlarmApi
Delete alarms from the platform based on the specified filter- Specified by:
deleteAlarmsByFilter
in interfaceAlarmApi
- Parameters:
filter
- the filter criteria(s)- Throws:
SDKException
- if the query failedIllegalArgumentException
-
-