Data Subscription SDK Reference¶
For Real-time Data Subscription¶
Subscription Client Class: EosClient¶
Function | Description | Parameter | Response |
---|---|---|---|
EosClient(String host, Integer port, String accessKey, String secretKey) | The constructor function. |
|
EosClient instance |
getDataService() | Get the basic alert data subscription service instance. | N/A | IDataService instance |
getAdvancedAlertService() | Get the advanced alert data subscription service instance. | 无 | IAdvancedAlertService instance |
Real-time Data Subscription Service Class: IDataService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IDataHandler dataHandler, String subId) | Get the subscribed real-time data of subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IDataHandler dataHandler, String subId, String consumerGroup) | Get the subscribed real-time data of the subID and define the consumer group.
|
|
null |
Real-time Data Handling Class: IDataHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
dataRead(StreamMessage message) | Read the subscribed real-time data. | message: The subscribed real-time data. | null |
For Alert Data Subscription¶
Subscription Client Class: EosClient¶
Function | Description | Parameter | Response |
---|---|---|---|
EosClient(String host, Integer port, String accessKey, String secretKey) | The constructor function. |
|
EosClient instance |
getAlertService() | Get alert data subscription service instance. | N/A | IAlertService instance |
Basic Alert Data Subscription Service Class: IAlertService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IAlertHandler alertHandler, String subId) | Get the subscribed alert data of the subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IAlertHandler alertHandler, String subId, String consumerGroup) | Get the subscribed alert data of the subID and define the consumer group.
|
|
null |
Basic Subscription Data Handling Class: IAlertHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
alertRead(Alert alert) | Read the subscribed alert data | alert: The subscribed alert data. | null |
Advanced Alert Data Subscription Service Class: IAdvancedAlertService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IAdvancedAlertHandler alertHandler, String subId) | Get the subscribed alert data of the subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IAdvancedAlertHandler alertHandler, String subId, String consumerGroup) | Get the subscribed alert data of the subID and define the consumer group.
|
|
null |
Advanced Subscription Data Handling Class: IAdvancedAlertHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
AdvancedAlertRead(Alert alert) | Read the subscribed advanced alert data | alert: The subscribed advanced alert data. | null |
For Offline Data Subscription (EnOS Cloud only)¶
Subscription Client Class: EosClient¶
Function | Description | Parameter | Response |
---|---|---|---|
EosClient(String host, Integer port, String accessKey, String secretKey) | The constructor function. |
|
EosClient instance |
getOfflineDataService() | Get the offline data subscription service instance. | N/A | IDataService instance |
Offline Data Subscription Service Class: IDataService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IDataHandler dataHandler, String subId) | Get the subscribed offline data of the subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IDataHandler dataHandler, String subId, String consumerGroup) | Get subscribed offline data of subID and define the consumer group.
|
|
null |
Offline Data Handling Class: IDataHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
dataRead(StreamMessage message) | Read the subscribed offline data. | message: The subscribed offline data. | null |
For Event Data Subscription¶
Subscription Client Class: EosClient¶
Function | Description | Parameter | Response |
---|---|---|---|
EosClient(String host, Integer port, String accessKey, String secretKey) | The constructor function. |
|
EosClient instance |
getEventService() | Get event data subscription service instance. | N/A | IEventService instance |
Event Data Subscription Service Class: IEventService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IEventHandler eventHandler, String subId) | Get the subscribed event data of the subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IEventHandler eventHandler, String subId, String consumerGroup) | Get the subscribed event data of the subID and define the consumer group.
|
|
null |
Event Data Handling Class: IEventHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
eventRead(Event event) | Read the subscribed event data. | event: The subscribed event data. | null |
For Device Event Report Subscription (EnOS Cloud only)¶
Subscription Client Class: EosClient¶
Function | Description | Parameter | Response |
---|---|---|---|
EosClient(String host, Integer port, String accessKey, String secretKey) | The constructor function. |
|
EosClient instance |
getReportService() | Get the device event report service instance. | N/A | IReportService instance |
Device Event Report Service Class: IReportService¶
Function | Description | Parameter | Response |
---|---|---|---|
subscribe(IReportHandler reportHandler, String subId) | Get the subscribed device event report of subID (this subscription client belongs to the default consumer group). |
|
null |
subscribe(IReportHandler reportHandler, String subId, String consumerGroup) | Get the subscribed device event report of the subID and define the consumer group.
|
|
null |
Device Event Report Handling Class: IReportHandler¶
Function | Description | Parameter | Response |
---|---|---|---|
eventRead(Report message) | Read the subscribed device event report. | message: The subscribed device event report. | null |