Subscribe Event Request
The data collector subscribe event request provides API to let an event consumer subscribe to a certain list of events. A callback function must be provided so the DataCollector can notify and call the specified callback. The callback function should be non-blocking and return quickly.
Note that although these requests do currently support "asyncCall" API, using the synchronous "execute" API is recommended since it is a non-blocking call.
Please see the API reference for the main classes related to Data Collector.
Subscribe Event
This "output" API lets an event consumer subscribe to a certain list of events. A callback function must be provided so the DataCollector can notify and call the specified callback. The callback function should be non-blocking and return quickly.
Key methods
Method | Details |
---|---|
setConsumerName(String consumerName) | Set the consumer name as an identifier for DataCollector |
setEventTypeList(EventType[] eventTypeList) | Set the list of event types to subscribe to |
setEventCallback(EventCallback eventCallback) | Set the callback function which should be implemented com.telenav.sdk.datacollector.model.EventCallback |
Sample code
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 4 5 6 7 8 9 10 |
|
Response example
1 2 3 4 5 |
|