Class MeasurementApiImpl
- java.lang.Object
-
- com.cumulocity.sdk.client.measurement.MeasurementApiImpl
-
- All Implemented Interfaces:
MeasurementApi
public class MeasurementApiImpl extends Object implements MeasurementApi
-
-
Constructor Summary
Constructors Constructor Description MeasurementApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, MeasurementsApiRepresentation measurementsApiRepresentation, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MeasurementRepresentationcreate(MeasurementRepresentation measurementRepresentation)Creates measurement in the platform.FuturecreateAsync(MeasurementRepresentation measurementRepresentation)Creates measurement in the platform.MeasurementCollectionRepresentationcreateBulk(MeasurementCollectionRepresentation measurementCollection)Creates measurements in the platform.voidcreateBulkWithoutResponse(MeasurementCollectionRepresentation measurementCollection)Creates measurements in the platform.voidcreateWithoutResponse(MeasurementRepresentation measurementRepresentation)Creates measurement in the platform.voiddelete(MeasurementRepresentation measurement)Deletes measurement from the platform.voiddeleteMeasurement(MeasurementRepresentation measurement)Deprecated.voiddeleteMeasurementsByFilter(MeasurementFilter filter)Delete measurements from the platform based on the specified filterMeasurementRepresentationgetMeasurement(GId measurementId)Gets measurement by idMeasurementCollectiongetMeasurements()Gets the all the measurement in the platformMeasurementCollectiongetMeasurementsByFilter(MeasurementFilter filter)Gets the measurements from the platform based on specified filterprotected StringgetSelfUri()
-
-
-
Constructor Detail
-
MeasurementApiImpl
public MeasurementApiImpl(RestConnector restConnector, UrlProcessor urlProcessor, MeasurementsApiRepresentation measurementsApiRepresentation, int pageSize)
-
-
Method Detail
-
getMeasurement
public MeasurementRepresentation getMeasurement(GId measurementId) throws SDKException
Description copied from interface:MeasurementApiGets measurement by id- Specified by:
getMeasurementin interfaceMeasurementApi- Parameters:
measurementId- id of the measurement to search for- Returns:
- the measurement with the given id
- Throws:
SDKException- if the measurement is not found or if the query failed
-
deleteMeasurement
@Deprecated public void deleteMeasurement(MeasurementRepresentation measurement) throws SDKException
Deprecated.Description copied from interface:MeasurementApiDeletes measurement from the platform. The measurement to be deleted is identified by the id within the given measurement.- Specified by:
deleteMeasurementin interfaceMeasurementApi- Parameters:
measurement- to be deleted- Throws:
SDKException- if the measurement could not be deleted
-
delete
public void delete(MeasurementRepresentation measurement) throws SDKException
Description copied from interface:MeasurementApiDeletes measurement from the platform. The measurement to be deleted is identified by the id within the given measurement.- Specified by:
deletein interfaceMeasurementApi- Parameters:
measurement- to be deleted- Throws:
SDKException- if the measurement could not be deleted
-
deleteMeasurementsByFilter
public void deleteMeasurementsByFilter(MeasurementFilter filter) throws IllegalArgumentException, SDKException
Description copied from interface:MeasurementApiDelete measurements from the platform based on the specified filter- Specified by:
deleteMeasurementsByFilterin interfaceMeasurementApi- Parameters:
filter- the filter criteria(s)- Throws:
IllegalArgumentException- when invalid filter providedSDKException- if the query failed
-
getMeasurementsByFilter
public MeasurementCollection getMeasurementsByFilter(MeasurementFilter filter) throws SDKException
Description copied from interface:MeasurementApiGets the measurements from the platform based on specified filter- Specified by:
getMeasurementsByFilterin interfaceMeasurementApi- Parameters:
filter- the filter criteria(s)- Returns:
- collection of measurements matched by the filter with paging functionality
- Throws:
SDKException- if the query failed
-
getMeasurements
public MeasurementCollection getMeasurements() throws SDKException
Description copied from interface:MeasurementApiGets the all the measurement in the platform- Specified by:
getMeasurementsin interfaceMeasurementApi- Returns:
- collection of measurements with paging functionality
- Throws:
SDKException- if the query failed
-
create
public MeasurementRepresentation create(MeasurementRepresentation measurementRepresentation) throws SDKException
Description copied from interface:MeasurementApiCreates measurement in the platform. The id of the measurement must not be set, since it will be generated by the platform- Specified by:
createin interfaceMeasurementApi- Parameters:
measurementRepresentation- measurement to be created- Returns:
- the created measurement with the generated id
- Throws:
SDKException- if the measurement could not be created
-
createBulk
public MeasurementCollectionRepresentation createBulk(MeasurementCollectionRepresentation measurementCollection)
Description copied from interface:MeasurementApiCreates measurements in the platform. The id of the measurements must not be set, since it will be generated by the platform- Specified by:
createBulkin interfaceMeasurementApi- Parameters:
measurementCollection- measurements to be created- Returns:
- the created measurements with their generated ids
-
createBulkWithoutResponse
public void createBulkWithoutResponse(MeasurementCollectionRepresentation measurementCollection)
Description copied from interface:MeasurementApiCreates measurements in the platform. Does not send Accept header to make the request be processed faster.- Specified by:
createBulkWithoutResponsein interfaceMeasurementApi- Parameters:
measurementCollection- measurements to be created
-
createWithoutResponse
public void createWithoutResponse(MeasurementRepresentation measurementRepresentation) throws SDKException
Description copied from interface:MeasurementApiCreates measurement in the platform. Does not send Accept header to make the request be processed faster.- Specified by:
createWithoutResponsein interfaceMeasurementApi- Parameters:
measurementRepresentation- measurement to be created- Throws:
SDKException- if the measurement could not be created
-
createAsync
public Future createAsync(MeasurementRepresentation measurementRepresentation) throws SDKException
Description copied from interface:MeasurementApiCreates measurement in the platform. Immediate response is available through the Future object. In case of lost connection, buffers data in persistence provider.- Specified by:
createAsyncin interfaceMeasurementApi- Parameters:
measurementRepresentation- measurement to be created- Returns:
- the created measurement with the generated id
- Throws:
SDKException- if the measurement could not be created
-
getSelfUri
protected String getSelfUri() throws SDKException
- Throws:
SDKException
-
-