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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EventRepresentation
create(EventRepresentation event)
Creates event in the platform.Future
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 filterEventRepresentation
getEvent(GId gid)
Gets event by idEventCollection
getEvents()
Gets the all the event in the platformEventCollection
getEventsByFilter(EventFilter filter)
Gets the events from the platform based on specified filterEventRepresentation
update(EventRepresentation eventRepresentation)
This update the event in the platform.
-
-
-
Method Detail
-
getEvent
EventRepresentation getEvent(GId gid) throws SDKException
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
EventRepresentation create(EventRepresentation event) throws SDKException
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
Future createAsync(EventRepresentation event) throws SDKException
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
void delete(EventRepresentation event) throws SDKException
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
void deleteEventsByFilter(EventFilter filter) throws IllegalArgumentException, SDKException
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
EventCollection getEvents() throws SDKException
Gets the all the event in the platform- Returns:
- collection of events with paging functionality
- Throws:
SDKException
- if the query failed
-
getEventsByFilter
EventCollection getEventsByFilter(EventFilter filter) throws SDKException
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
EventRepresentation update(EventRepresentation eventRepresentation) throws SDKException
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
-
-