|
|
@ -121,8 +121,8 @@ public class VirtualFireAlarmService {
|
|
|
|
final VirtualFireAlarmXMPPConnector virtualFireAlarmXMPPConnector) {
|
|
|
|
final VirtualFireAlarmXMPPConnector virtualFireAlarmXMPPConnector) {
|
|
|
|
this.virtualFireAlarmXMPPConnector = virtualFireAlarmXMPPConnector;
|
|
|
|
this.virtualFireAlarmXMPPConnector = virtualFireAlarmXMPPConnector;
|
|
|
|
|
|
|
|
|
|
|
|
if (MqttConfig.getInstance().isEnabled()) {
|
|
|
|
if (XmppConfig.getInstance().isEnabled()) {
|
|
|
|
Runnable mqttStarter = new Runnable() {
|
|
|
|
Runnable xmppStarter = new Runnable() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
virtualFireAlarmXMPPConnector.initConnector();
|
|
|
|
virtualFireAlarmXMPPConnector.initConnector();
|
|
|
@ -130,9 +130,9 @@ public class VirtualFireAlarmService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Thread mqttStarterThread = new Thread(mqttStarter);
|
|
|
|
Thread xmppStarterThread = new Thread(xmppStarter);
|
|
|
|
mqttStarterThread.setDaemon(true);
|
|
|
|
xmppStarterThread.setDaemon(true);
|
|
|
|
mqttStarterThread.start();
|
|
|
|
xmppStarterThread.start();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.warn("MQTT disabled in 'devicemgt-config.xml'. Hence, VirtualFireAlarmMQTTConnector not started.");
|
|
|
|
log.warn("MQTT disabled in 'devicemgt-config.xml'. Hence, VirtualFireAlarmMQTTConnector not started.");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -144,7 +144,7 @@ public class VirtualFireAlarmService {
|
|
|
|
public void setVirtualFireAlarmMQTTConnector(
|
|
|
|
public void setVirtualFireAlarmMQTTConnector(
|
|
|
|
final VirtualFireAlarmMQTTConnector virtualFireAlarmMQTTConnector) {
|
|
|
|
final VirtualFireAlarmMQTTConnector virtualFireAlarmMQTTConnector) {
|
|
|
|
this.virtualFireAlarmMQTTConnector = virtualFireAlarmMQTTConnector;
|
|
|
|
this.virtualFireAlarmMQTTConnector = virtualFireAlarmMQTTConnector;
|
|
|
|
if (XmppConfig.getInstance().isEnabled()) {
|
|
|
|
if (MqttConfig.getInstance().isEnabled()) {
|
|
|
|
virtualFireAlarmMQTTConnector.connect();
|
|
|
|
virtualFireAlarmMQTTConnector.connect();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log.warn("XMPP disabled in 'devicemgt-config.xml'. Hence, VirtualFireAlarmXMPPConnector not started.");
|
|
|
|
log.warn("XMPP disabled in 'devicemgt-config.xml'. Hence, VirtualFireAlarmXMPPConnector not started.");
|
|
|
|