Copied the device-type datasources.xml files directly to the conf/datasources path

Shabirmean 9 years ago
parent 20beb69419
commit 1f10298819

@ -48,6 +48,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
super(deviceOwner, deviceType, mqttBrokerEndPoint, subscribeTopic);
}
@SuppressWarnings("unused")
public FireAlarmMQTTCommunicator(String deviceOwner, String deviceType,
String mqttBrokerEndPoint, String subscribeTopic,
int intervalInMillis) {
@ -97,6 +98,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
@Override
public void processIncomingMessage(MqttMessage message, String... messageParams) {
final AgentManager agentManager = AgentManager.getInstance();
String serverName = agentManager.getAgentConfigs().getServerName();
String deviceOwner = agentManager.getAgentConfigs().getDeviceOwner();
String deviceID = agentManager.getAgentConfigs().getDeviceId();
String receivedMessage;
@ -128,9 +130,8 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
String replyTemperature = "Current temperature was read as: '" + currentTemperature + "C'";
log.info(AgentConstants.LOG_APPENDER + replyTemperature);
String tempPublishTopic = String.format(
AgentConstants.MQTT_PUBLISH_TOPIC,
agentManager.getAgentConfigs().getServerName(), deviceOwner, deviceID);
String tempPublishTopic = String.format(AgentConstants.MQTT_PUBLISH_TOPIC,
serverName, deviceOwner, deviceID);
replyMessage = AgentConstants.TEMPERATURE_CONTROL + ":" + currentTemperature;
try {
@ -149,7 +150,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
log.info(AgentConstants.LOG_APPENDER + replyHumidity);
String humidPublishTopic = String.format(
AgentConstants.MQTT_PUBLISH_TOPIC, deviceOwner, deviceID);
AgentConstants.MQTT_PUBLISH_TOPIC, serverName, deviceOwner, deviceID);
replyMessage = AgentConstants.HUMIDITY_CONTROL + ":" + currentHumidity;
try {
@ -188,6 +189,7 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
pushMessage.setRetained(true);
String topic = String.format(AgentConstants.MQTT_PUBLISH_TOPIC,
agentManager.getAgentConfigs().getServerName(),
agentManager.getAgentConfigs().getDeviceOwner(),
agentManager.getAgentConfigs().getDeviceId());
@ -205,8 +207,8 @@ public class FireAlarmMQTTCommunicator extends MQTTTransportHandler {
}
};
dataPushServiceHandler = service.scheduleAtFixedRate(pushDataRunnable, publishInterval,
publishInterval, TimeUnit.SECONDS);
dataPushServiceHandler = service.scheduleAtFixedRate(pushDataRunnable, publishInterval, publishInterval,
TimeUnit.SECONDS);
}

@ -148,9 +148,6 @@ public class AgentManager {
}
}
//Start agent communication
agentCommunicator.get(protocol).connect();
try {
EnrollmentManager.getInstance().beginEnrollmentFlow();
} catch (AgentCoreOperationException e) {
@ -158,6 +155,9 @@ public class AgentManager {
e.printStackTrace();
System.exit(0);
}
//Start agent communication
agentCommunicator.get(protocol).connect();
}
private void switchCommunicator(String stopProtocol, String startProtocol) {

@ -227,10 +227,11 @@ public class EnrollmentManager {
private PKCS10CertificationRequest generateCertSignRequest() throws AgentCoreOperationException {
// Build the CN for the cert that's being requested.
X500NameBuilder nameBld = new X500NameBuilder(BCStyle.INSTANCE);
nameBld.addRDN(BCStyle.CN, AgentManager.getInstance().getAgentConfigs().getDeviceName());
nameBld.addRDN(BCStyle.CN, AgentManager.getInstance().getAgentConfigs().getServerName());
nameBld.addRDN(BCStyle.O, AgentManager.getInstance().getAgentConfigs().getDeviceOwner());
nameBld.addRDN(BCStyle.OU, AgentManager.getInstance().getAgentConfigs().getDeviceOwner());
nameBld.addRDN(BCStyle.UNIQUE_IDENTIFIER, AgentManager.getInstance().getAgentConfigs().getDeviceId());
nameBld.addRDN(BCStyle.SERIALNUMBER, AgentManager.getInstance().getAgentConfigs().getDeviceId());
X500Name principal = nameBld.build();
JcaContentSignerBuilder contentSignerBuilder = new JcaContentSignerBuilder(SIGNATURE_ALG).setProvider(PROVIDER);

@ -198,7 +198,7 @@ public abstract class MQTTTransportHandler
protected void subscribeToQueue() throws TransportHandlerException {
try {
//TODO:: QoS Level take it from a variable
client.subscribe(subscribeTopic, 0);
client.subscribe(subscribeTopic, 2);
log.info("Subscriber '" + clientId + "' subscribed to topic: " + subscribeTopic);
} catch (MqttException ex) {
//TODO:: Compulsory log of errors and remove formatted error

@ -69,7 +69,7 @@ public class VirtualFireAlarmMQTTSubscriber extends MqttSubscriber {
@Override
protected void postMessageArrived(String topic, MqttMessage mqttMessage) {
String ownerAndId = topic.replace("wso2" + File.separator + "iot" + File.separator, "");
String ownerAndId = topic.replace(serverName + File.separator, "");
ownerAndId = ownerAndId.replace(File.separator + VirtualFireAlarmConstants.DEVICE_TYPE + File.separator, ":");
ownerAndId = ownerAndId.replace(File.separator + "publisher", "");

@ -176,7 +176,7 @@ public abstract class MqttSubscriber implements MqttCallback {
}
try {
client.subscribe(subscribeTopic, 0);
client.subscribe(subscribeTopic, 2);
log.info("Subscribed with client id: " + clientId);
log.info("Subscribed to topic: " + subscribeTopic);

@ -4,8 +4,7 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/android_sense,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/sketches/);\

@ -2,7 +2,7 @@
"deviceType": {
"label": "Arduino",
"category": "iot",
"downloadAgentUri": "ArduinoDeviceManager/manager/device/arduino/download",
"downloadAgentLinkGenUri" : "ArduinoDeviceManager/manager/device/arduino/generate_link"
"downloadAgentUri": "manager/device/arduino/download",
"downloadAgentLinkGenUri" : "manager/device/arduino/generate_link"
}
}

@ -9,5 +9,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/arduino,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\

@ -5,7 +5,6 @@ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../reso
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/sketches/digital_display/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.digitaldisplay_${feature.version}/agent/,target:${installFolder}/../../resources/sketches/digital_display/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.digitaldisplay_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/digital_display,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.digitaldisplay_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.digitaldisplay_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.digitaldisplay_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\

@ -2,7 +2,7 @@
"deviceType": {
"label": "Drone Analyzer",
"category": "iot",
"downloadAgentUri": "DroneAnalyzerServiceUnitManager/manager/device/drone_analyzer/download",
"downloadAgentLinkGenUri" : "DroneAnalyzerServiceUnitManager/manager/device/drone_analyzer/generate_link"
"downloadAgentUri": "manager/device/drone_analyzer/download",
"downloadAgentLinkGenUri" : "manager/device/drone_analyzer/generate_link"
}
}

@ -9,5 +9,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.droneanalyzer_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/drone_analyzer,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.droneanalyzer_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.droneanalyzer_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.droneanalyzer_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\

@ -2,7 +2,7 @@
"deviceType": {
"label": "RaspberryPi",
"category": "iot",
"downloadAgentUri": "RaspberryPiDeviceManager/manager/device/raspberrypi/download",
"downloadAgentLinkGenUri" : "RaspberryPiDeviceManager/manager/device/raspberrypi/generate_link"
"downloadAgentUri": "manager/device/raspberrypi/download",
"downloadAgentLinkGenUri" : "manager/device/raspberrypi/generate_link"
}
}

@ -9,5 +9,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\

@ -2,7 +2,7 @@
"deviceType": {
"label": "Virtual Firealarm",
"category": "iot",
"downloadAgentUri": "VirtualFireAlarmDeviceManager/manager/device/virtual_firealarm/download",
"downloadAgentLinkGenUri" : "VirtualFireAlarmDeviceManager/manager/device/virtual_firealarm/generate_link"
"downloadAgentUri": "manager/device/virtual_firealarm/download",
"downloadAgentLinkGenUri" : "manager/device/virtual_firealarm/generate_link"
}
}

@ -13,5 +13,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/virtual_firealarm,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/datasources/devicemgt/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\

Loading…
Cancel
Save