Package com.cumulocity.sdk.client.event
Class EventApiImpl
- java.lang.Object
-
- com.cumulocity.sdk.client.event.EventApiImpl
-
-
Constructor Summary
Constructors Constructor Description EventApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, EventsApiRepresentation eventsApiRepresentation, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventRepresentationcreate(EventRepresentation representation)Creates event in the platform.FuturecreateAsync(EventRepresentation representation)Creates event in the platform.voiddelete(EventRepresentation event)Deletes event from the platform.voiddeleteEventsByFilter(EventFilter filter)Deletes events from the platform based on the specified filterEventRepresentationgetEvent(GId eventId)Gets event by idEventCollectiongetEvents()Gets the all the event in the platformEventCollectiongetEventsByFilter(EventFilter filter)Gets the events from the platform based on specified filterEventRepresentationupdate(EventRepresentation eventRepresentation)This update the event in the platform.
-
-
-
Constructor Detail
-
EventApiImpl
public EventApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, EventsApiRepresentation eventsApiRepresentation, int pageSize)
-
-
Method Detail
-
getEvent
public EventRepresentation getEvent(GId eventId) throws SDKException
Description copied from interface:EventApiGets event by id- Specified by:
getEventin 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
public EventCollection getEvents() throws SDKException
Description copied from interface:EventApiGets the all the event in the platform- Specified by:
getEventsin interfaceEventApi- Returns:
- collection of events with paging functionality
- Throws:
SDKException- if the query failed
-
create
public EventRepresentation create(EventRepresentation representation) throws SDKException
Description copied from interface:EventApiCreates event in the platform. The id of the event must not be set, since it will be generated by the platform- Specified by:
createin 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
public Future createAsync(EventRepresentation representation) throws SDKException
Description copied from interface:EventApiCreates event in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider.- Specified by:
createAsyncin 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
public void delete(EventRepresentation event) throws SDKException
Description copied from interface:EventApiDeletes event from the platform. The event to be deleted is identified by the id within the given event.- Specified by:
deletein interfaceEventApi- Parameters:
event- to be deleted- Throws:
SDKException- if the event could not be deleted
-
deleteEventsByFilter
public void deleteEventsByFilter(EventFilter filter) throws IllegalArgumentException, SDKException
Description copied from interface:EventApiDeletes events from the platform based on the specified filter- Specified by:
deleteEventsByFilterin interfaceEventApi- Parameters:
filter- the filter criteria(s)- Throws:
IllegalArgumentException- when null event filter providedSDKException- if the event(s) could not be deleted
-
getEventsByFilter
public EventCollection getEventsByFilter(EventFilter filter) throws SDKException
Description copied from interface:EventApiGets the events from the platform based on specified filter- Specified by:
getEventsByFilterin 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
public EventRepresentation update(EventRepresentation eventRepresentation) throws SDKException
Description copied from interface:EventApiThis update the event in the platform. Cannot update the ID.- Specified by:
updatein interfaceEventApi- Parameters:
eventRepresentation- event to be updated- Returns:
- The created event
- Throws:
SDKException- if the event could not be updated
-
-