com.cumulocity.sdk.client.measurement
Interface MeasurementApi

All Known Implementing Classes:
MeasurementApiImpl

public interface MeasurementApi

API for creating, deleting and retrieving measurements from the platform.


Method Summary
 MeasurementRepresentation create(MeasurementRepresentation measurement)
          Creates measurement in the platform.
 void deleteMeasurement(MeasurementRepresentation measurement)
          Deletes measurement from the platform.
 MeasurementRepresentation getMeasurement(GId gid)
          Gets measurement by id
 PagedCollectionResource<MeasurementCollectionRepresentation> getMeasurements()
          Gets the all the measurement in the platform
 PagedCollectionResource<MeasurementCollectionRepresentation> getMeasurementsByFilter(MeasurementFilter filter)
          Gets the measurements from the platform based on specified filter
 

Method Detail

getMeasurement

MeasurementRepresentation getMeasurement(GId gid)
                                         throws SDKException
Gets measurement by id

Parameters:
gid - 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

create

MeasurementRepresentation create(MeasurementRepresentation measurement)
                                 throws SDKException
Creates measurement in the platform. The id of the measurement must not be set, since it will be generated by the platform

Parameters:
measurement - measurement to be created
Returns:
the created measurement with the generated id
Throws:
SDKException - if the measurement could not be created

deleteMeasurement

void deleteMeasurement(MeasurementRepresentation measurement)
                       throws SDKException
Deletes measurement from the platform. The measurement to be deleted is identified by the id within the given measurement.

Parameters:
measurement - to be deleted
Throws:
SDKException - if the measurement could not be deleted

getMeasurements

PagedCollectionResource<MeasurementCollectionRepresentation> getMeasurements()
                                                                             throws SDKException
Gets the all the measurement in the platform

Returns:
collection of measurements with paging functionality
Throws:
SDKException - if the query failed

getMeasurementsByFilter

PagedCollectionResource<MeasurementCollectionRepresentation> getMeasurementsByFilter(MeasurementFilter filter)
                                                                                     throws SDKException
Gets the measurements from the platform based on specified filter

Parameters:
filter - the filter criteria(s)
Returns:
collection of measurements matched by the filter with paging functionality
Throws:
SDKException - if the query failed


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.