Cumulocity SDK Java Client library provides the classes necessary to interact with the Cumulocity REST
API.
The Cumulocity SDK Java client library provides Java interfaces to the following:
- Inventory
- Identity
- Measurement
- Alarm
- Audit Record
- Event
Example Usage:
// Create the platform instance providing the URL of the platform, the tenant id, the tenant user name and password.
Platform platform = new PlatformImpl("http://domain.cumulocity.com/", "tenant", "username", "password");
// Access individual API resource object
MeasurementApi measurement = platform.getMeasurementApi()();
// Create necessary representation
GId sourceId = new GId();
sourceId.setValue("12345");
MeasurementRepresentation representation = new MeasurementRepresentation();
representation.setType("reading");
representation.setTime(new Date());
representation.setSource(sourceId);
ExampleFragment fragment = new ExampleFragment();
representation.set(fragment);
// Call the method
MeasurementRepresentation createdRepresentation = measurement.create(representation);