Package com.cumulocity.sdk.client.event
Class EventApiImpl
java.lang.Object
com.cumulocity.sdk.client.event.EventApiImpl
- All Implemented Interfaces:
EventApi
-
Constructor Summary
ConstructorDescriptionEventApiImpl
(RestConnector restConnector, UrlProcessor urlProcessor, EventsApiRepresentation eventsApiRepresentation, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(EventRepresentation representation) Creates event in the platform.createAsync
(EventRepresentation representation) 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.
-
Constructor Details
-
EventApiImpl
public EventApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, EventsApiRepresentation eventsApiRepresentation, int pageSize)
-
-
Method Details
-
getEvent
Description copied from interface:EventApi
Gets event by id- Specified by:
getEvent
in interfaceEventApi
- Parameters:
eventId
- 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
-
getEvents
Description copied from interface:EventApi
Gets the all the event in the platform- Specified by:
getEvents
in interfaceEventApi
- Returns:
- collection of events with paging functionality
- Throws:
SDKException
- if the query failed
-
create
Description copied from interface:EventApi
Creates event in the platform. The id of the event must not be set, since it will be generated by the platform- Specified by:
create
in interfaceEventApi
- Parameters:
representation
- event to be created- Returns:
- the created event with the generated id
- Throws:
SDKException
- if the event could not be created
-
createAsync
Description copied from interface:EventApi
Creates event 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 interfaceEventApi
- Parameters:
representation
- event to be created- Returns:
- the created event with the generated id
- Throws:
SDKException
- if the event could not be created
-
delete
Description copied from interface:EventApi
Deletes event from the platform. The event to be deleted is identified by the id within the given event.- Specified by:
delete
in interfaceEventApi
- Parameters:
event
- to be deleted- Throws:
SDKException
- if the event could not be deleted
-
deleteEventsByFilter
Description copied from interface:EventApi
Deletes events from the platform based on the specified filter- Specified by:
deleteEventsByFilter
in interfaceEventApi
- Parameters:
filter
- the filter criteria(s)- Throws:
IllegalArgumentException
- when null event filter providedSDKException
- if the event(s) could not be deleted
-
getEventsByFilter
Description copied from interface:EventApi
Gets the events from the platform based on specified filter- Specified by:
getEventsByFilter
in interfaceEventApi
- Parameters:
filter
- the filter criteria(s)- Returns:
- collection of events matched by the filter with paging functionality
- Throws:
SDKException
- if the query failed
-
update
Description copied from interface:EventApi
This update the event in the platform. Cannot update the ID.- Specified by:
update
in interfaceEventApi
- Parameters:
eventRepresentation
- event to be updated- Returns:
- The created event
- Throws:
SDKException
- if the event could not be updated
-