Re: Real-time statements and notifications state

Follow

Originally posted by support@cumulocity.com on 2013-08-08 10:15:01

Hi Carlos,

the notifications API is frozen and it should be stable. You can use it to, for example, continuously update your web user interface or get commands sent in real time to devices. If you encounter any bugs, please send them over. Here is a snippet on how to use it from a Java agent to receive commands. "gid" is the ID of your agent in the inventory.


Subscriber subscriber = platform.getDeviceControlApi().getNotificationsSubscriber();
subscriber.subscribe(gid,
	new SubscriptionListener() {
		@Override
		public void onNotification(Subscription sub, OperationRepresentation operation) {
			// Execute the operation
		}

		@Override
		public void onError(Subscription sub, Throwable e) {
			e.printStackTrace();
		}
	});

Regarding the real-time statements, the language is frozen and you can already deploy modules with real-time statements as part of PaaS applications. The first release version of the user interface and the deployment API will be part of the C4 release. We are currently working on bug fixes and usability improvements, i.e., improving the error reporting, simplifying mail sending and simplifying the deployment model. A likely outcome will be that we'll focus on the file-style deployment as described in http://cumulocity.com/guides/reference-guide/real-time-statements.html">http://cumulocity.com/guides/reference- … ments.html.

Hope that helps,
André
Have more questions? Submit a request

Comments