Providing a client ID to the agent

revert-dabc3590
savidude 8 years ago
parent d1b0dac723
commit 239487d30a

@ -112,8 +112,8 @@ public class RaspberryPiServiceImpl implements RaspberryPiService {
@QueryParam("from") long from, @QueryParam("to") long to) { @QueryParam("from") long from, @QueryParam("to") long to) {
String fromDate = String.valueOf(from); String fromDate = String.valueOf(from);
String toDate = String.valueOf(to); String toDate = String.valueOf(to);
String query = "deviceId:" + deviceId + " AND deviceType:" + String query = "meta_deviceId:" + deviceId + " AND meta_deviceType:" +
RaspberrypiConstants.DEVICE_TYPE + " AND time : [" + fromDate + " TO " + toDate + "]"; RaspberrypiConstants.DEVICE_TYPE + " AND meta_time : [" + fromDate + " TO " + toDate + "]";
String sensorTableName = RaspberrypiConstants.TEMPERATURE_EVENT_TABLE; String sensorTableName = RaspberrypiConstants.TEMPERATURE_EVENT_TABLE;
try { try {
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId, if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,

@ -26,7 +26,7 @@ public class RaspberrypiConstants {
public static final String BULB_CONTEXT = "BULB"; public static final String BULB_CONTEXT = "BULB";
//sensor events summerized table name //sensor events summerized table name
public static final String TEMPERATURE_EVENT_TABLE = "DEVICE_TEMPERATURE_SUMMARY"; public static final String TEMPERATURE_EVENT_TABLE = "IOT_PER_DEVICE_STREAM_RASPBERRYPI_TEMPERATURE";
//mqtt tranport related constants //mqtt tranport related constants
public static final String MQTT_ADAPTER_TOPIC_PROPERTY_NAME = "mqtt.adapter.topic"; public static final String MQTT_ADAPTER_TOPIC_PROPERTY_NAME = "mqtt.adapter.topic";

@ -101,7 +101,7 @@ def main():
print ("MQTT_LISTENER: MQTT_TOPIC is " + TOPIC_TO_SUBSCRIBE) print ("MQTT_LISTENER: MQTT_TOPIC is " + TOPIC_TO_SUBSCRIBE)
global mqttClient global mqttClient
mqttClient = mqtt.Client() mqttClient = mqtt.Client(client_id="RaspberryPi Agent")
mqttClient.on_connect = on_connect mqttClient.on_connect = on_connect
mqttClient.on_message = on_message mqttClient.on_message = on_message
mqttClient.on_publish = on_publish mqttClient.on_publish = on_publish

Loading…
Cancel
Save