Package com.cumulocity.sdk.client.event
Interface EventApi
- All Known Implementing Classes:
EventApiImpl
public interface EventApi
API for creating, deleting and retrieving events from the platform.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(EventRepresentation event) Creates event in the platform.createAsync
(EventRepresentation event) Creates event in the platform.void
delete
(EventRepresentation event) Deletes event from the platform.void
deleteEventsByFilter
(EventFilter filter) Deletes events from the platform based on the specified filterGets event by idGets the all the event in the platformgetEventsByFilter
(EventFilter filter) Gets the events from the platform based on specified filterupdate
(EventRepresentation eventRepresentation) This update the event in the platform.
-
Method Details
-
getEvent
Gets event by id- Parameters:
gid
- id of the event to search for- Returns:
- the event with the given id
- Throws:
SDKException
- if the event is not found or if the query failed
-
create
Creates event in the platform. The id of the event must not be set, since it will be generated by the platform- Parameters:
event
- event to be created- Returns:
- the created event with the generated id
- Throws:
SDKException
- if the event could not be created
-
createAsync
Creates event in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider.- Parameters:
event
- event to be created- Returns:
- the created event with the generated id
- Throws:
SDKException
- if the event could not be created
-
delete
Deletes event from the platform. The event to be deleted is identified by the id within the given event.- Parameters:
event
- to be deleted- Throws:
SDKException
- if the event could not be deleted
-
deleteEventsByFilter
Deletes events from the platform based on the specified filter- Parameters:
filter
- the filter criteria(s)- Throws:
IllegalArgumentException
- when null event filter providedSDKException
- if the event(s) could not be deleted
-
getEvents
Gets the all the event in the platform- Returns:
- collection of events with paging functionality
- Throws:
SDKException
- if the query failed
-
getEventsByFilter
Gets the events from the platform based on specified filter- Parameters:
filter
- the filter criteria(s)- Returns:
- collection of events matched by the filter with paging functionality
- Throws:
SDKException
- if the query failed
-
update
This update the event in the platform. Cannot update the ID.- Parameters:
eventRepresentation
- event to be updated- Returns:
- The created event
- Throws:
SDKException
- if the event could not be updated
-