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 MeasurementRepresentation
create(MeasurementRepresentation measurementRepresentation)
Creates measurement in the platform.Future
createAsync(MeasurementRepresentation measurementRepresentation)
Creates measurement in the platform.MeasurementCollectionRepresentation
createBulk(MeasurementCollectionRepresentation measurementCollection)
Creates measurements in the platform.void
createBulkWithoutResponse(MeasurementCollectionRepresentation measurementCollection)
Creates measurements in the platform.void
createWithoutResponse(MeasurementRepresentation measurementRepresentation)
Creates measurement in the platform.void
delete(MeasurementRepresentation measurement)
Deletes measurement from the platform.void
deleteMeasurement(MeasurementRepresentation measurement)
Deprecated.void
deleteMeasurementsByFilter(MeasurementFilter filter)
Delete measurements from the platform based on the specified filterMeasurementRepresentation
getMeasurement(GId measurementId)
Gets measurement by idMeasurementCollection
getMeasurements()
Gets the all the measurement in the platformMeasurementCollection
getMeasurementsByFilter(MeasurementFilter filter)
Gets the measurements from the platform based on specified filterprotected String
getSelfUri()
-
-
-
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:MeasurementApi
Gets measurement by id- Specified by:
getMeasurement
in 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:MeasurementApi
Deletes measurement from the platform. The measurement to be deleted is identified by the id within the given measurement.- Specified by:
deleteMeasurement
in 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:MeasurementApi
Deletes measurement from the platform. The measurement to be deleted is identified by the id within the given measurement.- Specified by:
delete
in 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:MeasurementApi
Delete measurements from the platform based on the specified filter- Specified by:
deleteMeasurementsByFilter
in 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:MeasurementApi
Gets the measurements from the platform based on specified filter- Specified by:
getMeasurementsByFilter
in 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:MeasurementApi
Gets the all the measurement in the platform- Specified by:
getMeasurements
in 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:MeasurementApi
Creates measurement in the platform. The id of the measurement must not be set, since it will be generated by the platform- Specified by:
create
in 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:MeasurementApi
Creates measurements in the platform. The id of the measurements must not be set, since it will be generated by the platform- Specified by:
createBulk
in 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:MeasurementApi
Creates measurements in the platform. Does not send Accept header to make the request be processed faster.- Specified by:
createBulkWithoutResponse
in interfaceMeasurementApi
- Parameters:
measurementCollection
- measurements to be created
-
createWithoutResponse
public void createWithoutResponse(MeasurementRepresentation measurementRepresentation) throws SDKException
Description copied from interface:MeasurementApi
Creates measurement in the platform. Does not send Accept header to make the request be processed faster.- Specified by:
createWithoutResponse
in 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:MeasurementApi
Creates measurement 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 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
-
-