Package com.cumulocity.sdk.client.alarm
Interface AlarmApi
-
- All Known Implementing Classes:
AlarmApiImpl
public interface AlarmApi
API for creating, updating and retrieving alarms from the platform.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description AlarmRepresentation
create(AlarmRepresentation alarm)
Creates an alarm in the platform.Future
createAsync(AlarmRepresentation alarm)
Creates an alarm in the platform.void
deleteAlarmsByFilter(AlarmFilter filter)
Delete alarms from the platform based on the specified filterAlarmRepresentation
getAlarm(GId gid)
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 alarm)
Updates an alarm in the platform.AlarmRepresentation
updateAlarm(AlarmRepresentation alarm)
Deprecated.
-
-
-
Method Detail
-
getAlarm
AlarmRepresentation getAlarm(GId gid) throws SDKException
Gets an alarm by id- Parameters:
gid
- 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
-
create
AlarmRepresentation create(AlarmRepresentation alarm) throws SDKException
Creates an alarm in the platform. The id of the alarm must not be set, since it will be generated by the platform- Parameters:
alarm
- alarm to be created- Returns:
- the created alarm with the generated id
- Throws:
SDKException
- if the alarm could not be created
-
createAsync
Future createAsync(AlarmRepresentation alarm) throws SDKException
Creates an alarm in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider.- Parameters:
alarm
- alarm to be created- Returns:
- the created alarm with the generated id
- Throws:
SDKException
- if the alarm could not be created
-
update
AlarmRepresentation update(AlarmRepresentation alarm) throws SDKException
Updates an alarm in the platform. The alarm to be updated is identified by the id within the given alarm.- Parameters:
alarm
- to be updated- Returns:
- the updated alarm
- Throws:
SDKException
- if the alarm could not be updated
-
getAlarms
AlarmCollection getAlarms() throws SDKException
Gets all alarms from the platform- Returns:
- collection of alarms with paging functionality
- Throws:
SDKException
- if the query failed
-
getAlarmsByFilter
AlarmCollection getAlarmsByFilter(AlarmFilter filter) throws SDKException
Gets alarms from the platform based on the specified filter- Parameters:
filter
- the filter criteria(s)- Returns:
- collection of alarms matched by the filter with paging functionality
- Throws:
SDKException
- if the query failed
-
deleteAlarmsByFilter
void deleteAlarmsByFilter(AlarmFilter filter) throws IllegalArgumentException, SDKException
Delete alarms from the platform based on the specified filter- Parameters:
filter
- the filter criteria(s)- Throws:
SDKException
- if the query failedIllegalArgumentException
-
updateAlarm
@Deprecated AlarmRepresentation updateAlarm(AlarmRepresentation alarm) throws SDKException
Deprecated.Updates an alarm in the platform. The alarm to be updated is identified by the id within the given alarm.- Parameters:
alarm
- to be updated- Returns:
- the updated alarm
- Throws:
SDKException
- if the alarm could not be updated
-
-