Merge pull request #724 from Nirothipan/master

Android Virtual Fire Alarm Initial query exception
revert-dabc3590
Ayyoob Hamza 8 years ago committed by GitHub
commit d53de7a18f

@ -108,7 +108,6 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
public void processIncomingMessage(MqttMessage message, String... messageParams) { public void processIncomingMessage(MqttMessage message, String... messageParams) {
final AgentManager agentManager = AgentManager.getInstance(); final AgentManager agentManager = AgentManager.getInstance();
String tenantDomain = agentManager.getAgentConfigs().getTenantDomain(); String tenantDomain = agentManager.getAgentConfigs().getTenantDomain();
String deviceOwner = agentManager.getAgentConfigs().getDeviceOwner();
String deviceID = agentManager.getAgentConfigs().getDeviceId(); String deviceID = agentManager.getAgentConfigs().getDeviceId();
String receivedMessage; String receivedMessage;
String replyMessage; String replyMessage;
@ -219,7 +218,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
} catch (TransportHandlerException e) { } catch (TransportHandlerException e) {
log.warn(AgentConstants.LOG_APPENDER + "Data Publish attempt to topic - [" + log.warn(AgentConstants.LOG_APPENDER + "Data Publish attempt to topic - [" +
AgentConstants.MQTT_PUBLISH_TOPIC + "] failed for payload [" + message + "]"); AgentConstants.MQTT_PUBLISH_TOPIC + "] failed for payload [" + message + "]");
} catch (AgentCoreOperationException e) { } catch (AgentCoreOperationException e) {
log.warn(AgentConstants.LOG_APPENDER + "Preparing Secure payload failed", e); log.warn(AgentConstants.LOG_APPENDER + "Preparing Secure payload failed", e);
} }
@ -255,7 +254,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
Thread.sleep(timeoutInterval); Thread.sleep(timeoutInterval);
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
log.error(AgentConstants.LOG_APPENDER + log.error(AgentConstants.LOG_APPENDER +
"MQTT-Terminator: Thread Sleep Interrupt Exception"); "MQTT-Terminator: Thread Sleep Interrupt Exception");
} }
} }
} }

@ -1,5 +1,5 @@
define stream fireAlarmEventStream (deviceID string, temp int); define stream fireAlarmEventStream (deviceID string, temp int);
from fireAlarmEventStream#window.time(7886776 sec) from fireAlarmEventStream#window.time(10 sec)
select deviceID, max(temp) as maxValue select deviceID, max(temp) as maxValue
group by deviceID group by deviceID
insert into analyzeStream for expired-events; insert into analyzeStream for expired-events;
@ -8,4 +8,4 @@ select maxValue
insert into bulbOnStream; insert into bulbOnStream;
from fireAlarmEventStream[temp > 1093] from fireAlarmEventStream[temp > 1093]
select deviceID, temp select deviceID, temp
insert into bulbOffStream; insert into bulbOffStream;

@ -103,7 +103,6 @@ public class VirtualFireAlarmServiceImpl implements VirtualFireAlarmService {
commandOp.setPayLoad(actualMessage); commandOp.setPayLoad(actualMessage);
Properties props = new Properties(); Properties props = new Properties();
props.setProperty(VirtualFireAlarmConstants.MQTT_ADAPTER_TOPIC_PROPERTY_NAME, publishTopic);
props.setProperty(VirtualFireAlarmConstants.CLIENT_JID_PROPERTY_KEY, deviceId + "@" + XmppConfig props.setProperty(VirtualFireAlarmConstants.CLIENT_JID_PROPERTY_KEY, deviceId + "@" + XmppConfig
.getInstance().getServerName()); .getInstance().getServerName());
props.setProperty(VirtualFireAlarmConstants.SUBJECT_PROPERTY_KEY, "CONTROL-REQUEST"); props.setProperty(VirtualFireAlarmConstants.SUBJECT_PROPERTY_KEY, "CONTROL-REQUEST");

Loading…
Cancel
Save