Fixes to the VirtualFireAlarmMQTTConnector

Shabirmean 9 years ago
parent 23fc39c60a
commit 5f8751cd95

@ -147,7 +147,6 @@ public class VirtualFireAlarmService {
// Runnable xmppStarter = new Runnable() {
// @Override
// public void run() {
virtualFireAlarmMQTTConnector.initConnector();
virtualFireAlarmMQTTConnector.connect();
// }
// };

@ -43,22 +43,19 @@ import java.util.UUID;
public class VirtualFireAlarmMQTTConnector extends MQTTTransportHandler {
private static Log log = LogFactory.getLog(VirtualFireAlarmMQTTConnector.class);
private static String serverName;
private static String subscribeTopic;
private static String iotServerSubscriber;
private static String serverName = DeviceManagementConfigurationManager.getInstance().
getDeviceManagementServerInfo().getName();
private static String subscribeTopic = serverName + File.separator + "+" + File.separator +
VirtualFireAlarmConstants.DEVICE_TYPE + File.separator + "+" + File.separator + "publisher";
private static String iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5);
private VirtualFireAlarmMQTTConnector() {
super(iotServerSubscriber, VirtualFireAlarmConstants.DEVICE_TYPE,
MqttConfig.getInstance().getMqttQueueEndpoint(), subscribeTopic);
}
public void initConnector(){
iotServerSubscriber = UUID.randomUUID().toString().substring(0, 5);
serverName = DeviceManagementConfigurationManager.getInstance().getDeviceManagementServerInfo().getName();
subscribeTopic = serverName + File.separator + "+" + File.separator + VirtualFireAlarmConstants.DEVICE_TYPE +
File.separator + "+" + File.separator + "publisher";
}
@Override
public void connect() {
Runnable connector = new Runnable() {

@ -220,7 +220,7 @@ public class XmppServerClient implements ControlQueueConnector {
return true;
} else {
String warnMsg = "XMPP <Enabled> set to false in 'devicemgt-config.xml'";
log.error(warnMsg);
log.warn(warnMsg);
throw new DeviceControllerException(warnMsg);
}
}

Loading…
Cancel
Save