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 EventRepresentation
create(EventRepresentation representation)
Creates event in the platform.Future
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 filterEventRepresentation
getEvent(GId eventId)
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.
-
-
-
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: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
public EventCollection getEvents() throws SDKException
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
public EventRepresentation create(EventRepresentation representation) throws SDKException
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
public Future createAsync(EventRepresentation representation) throws SDKException
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
public void delete(EventRepresentation event) throws SDKException
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
public void deleteEventsByFilter(EventFilter filter) throws IllegalArgumentException, SDKException
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
public EventCollection getEventsByFilter(EventFilter filter) throws SDKException
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
public EventRepresentation update(EventRepresentation eventRepresentation) throws SDKException
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
-
-