diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml
index f434f1c59..f8c9c2d65 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml
@@ -23,7 +23,7 @@
virtual-fire-alarm-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.hbs b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.hbs
index 583e332f7..6ad97dfb5 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.hbs
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.hbs
@@ -19,7 +19,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js
new file mode 100644
index 000000000..74111c244
--- /dev/null
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/configuration.js
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+function onRequest(context){
+ var viewModel = {};
+ var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
+ viewModel["permissions"] = userModule.getUIPermissions();
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js
index 19f1c9ff3..9c69e7899 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration/public/js/platform-configuration.js
@@ -103,3 +103,30 @@ var addConfiguration = function () {
}
);
};
+
+var artifactUpload = function () {
+ var contentType = "application/json";
+ var backendEndBasePath = "/api/device-mgt/v1.0";
+ var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm";
+ var defaultStatusClasses = "fw fw-stack-1x";
+ var content = $("#virtual-firealarm-statistic-response-template").find(".content");
+ var title = content.find("#title");
+ var statusIcon = content.find("#status-icon");
+ var data = {}
+ invokerUtil.post(urix, data, function (data) {
+ title.html("Deploying statistic artifacts. Please wait...");
+ statusIcon.attr("class", defaultStatusClasses + " fw-check");
+ $(modalPopupContent).html(content.html());
+ showPopup();
+ setTimeout(function () {
+ hidePopup();
+ location.reload(true);
+ }, 5000);
+
+ }, function (jqXHR) {
+ title.html("Failed to deploy artifacts, Please contact administrator.");
+ statusIcon.attr("class", defaultStatusClasses + " fw-error");
+ $(modalPopupContent).html(content.html());
+ showPopup();
+ }, contentType);
+};
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js
index 5c34b9331..40e36dd96 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js
@@ -28,15 +28,31 @@ function onRequest(context) {
var jwtClient = jwtService.getJWTClient();
var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]);
var token = "";
+ var user = session.get(constants.USER_SESSION_KEY);
+ if (!user) {
+ log.error("User object was not found in the session");
+ throw constants.ERRORS.USER_NOT_FOUND;
+ }
+
if (encodedClientKeys) {
- var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"];
- var resp = tokenUtil.decode(encodedClientKeys).split(":");
- var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {});
- if (tokenPair) {
- token = tokenPair.accessToken;
- }
- websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?"
- + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
+ var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"];
+ var resp = tokenUtil.decode(encodedClientKeys).split(":");
+ if (user.domain == "carbon.super") {
+ var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username , "default", {});
+ if (tokenPair) {
+ token = tokenPair.accessToken;
+ }
+ websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?"
+ + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
+ } else {
+ var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + user.domain
+ , "default", {});
+ if (tokenPair) {
+ token = tokenPair.accessToken;
+ }
+ websocketEndpoint = websocketEndpoint + "/secured-websocket/t/" + user.domain + "/org.wso2.iot.devices.temperature/1.0.0?"
+ + "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type + "&websocketToken=" + token;
+ }
}
return {"device": device, "websocketEndpoint": websocketEndpoint};
}
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js
index a667ef4cc..d4ceb751f 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/public/js/download.js
@@ -134,31 +134,4 @@ function doAction(data) {
hideAgentDownloadPopup();
});
}
-}
-
-function artifactUpload() {
- var contentType = "application/json";
-
- var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm";
- var defaultStatusClasses = "fw fw-stack-1x";
- var content = $("#virtualfirealarm-statistic-response-template").find(".content");
- var title = content.find("#title");
- var statusIcon = content.find("#status-icon");
- var data = {}
- invokerUtil.post(urix, data, function (data) {
- title.html("Deploying statistic artifacts. Please wait...");
- statusIcon.attr("class", defaultStatusClasses + " fw-check");
- $(modalPopupContent).html(content.html());
- showPopup();
- setTimeout(function () {
- hidePopup();
- location.reload(true);
- }, 5000);
-
- }, function (jqXHR) {
- title.html("Failed to deploy artifacts, Please contact administrator.");
- statusIcon.attr("class", defaultStatusClasses + " fw-error");
- $(modalPopupContent).html(content.html());
- showPopup();
- }, contentType);
}
\ No newline at end of file
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs
index 922ace659..f34aa0d6f 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view/type-view.hbs
@@ -54,9 +54,6 @@
Download Agent
- {{#if displayStatus}}
- Deploy Analytics Artifacts
- {{/if}}
Click [ here ] for latest instructions and
diff --git a/components/device-types/virtual-fire-alarm-plugin/pom.xml b/components/device-types/virtual-fire-alarm-plugin/pom.xml
index 829d6d4f6..1d324a4d9 100644
--- a/components/device-types/virtual-fire-alarm-plugin/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml
index df51ad296..c094c83fc 100644
--- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml
+++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/pom.xml
@@ -18,7 +18,7 @@
org.wso2.carbon.devicemgt-plugins
appm-connector
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java
index 607570bd0..f35823785 100644
--- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java
+++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.osgiconnector/src/main/java/org/wso2/carbon/appmgt/mdm/osgiconnector/ApplicationOperationsImpl.java
@@ -20,6 +20,7 @@ import org.apache.commons.logging.LogFactory;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
+import org.wso2.carbon.appmgt.impl.service.ServiceReferenceHolder;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileApp;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.beans.MobileAppTypes;
import org.wso2.carbon.appmgt.mdm.osgiconnector.mdmmgt.common.DeviceApplicationException;
@@ -32,6 +33,7 @@ import org.wso2.carbon.appmgt.mobile.beans.ApplicationOperationDevice;
import org.wso2.carbon.appmgt.mobile.interfaces.ApplicationOperations;
import org.wso2.carbon.appmgt.mobile.mdm.App;
import org.wso2.carbon.appmgt.mobile.mdm.Device;
+import org.wso2.carbon.appmgt.mobile.store.Generic;
import org.wso2.carbon.appmgt.mobile.utils.MobileApplicationException;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
@@ -39,6 +41,15 @@ import org.wso2.carbon.device.mgt.common.Platform;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
+import org.wso2.carbon.appmgt.mobile.utils.User;
+
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.registry.api.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.user.api.UserStoreException;
+import org.wso2.carbon.user.api.UserStoreManager;
+import org.wso2.carbon.user.core.service.RealmService;
import java.util.ArrayList;
import java.util.List;
@@ -47,6 +58,9 @@ import java.util.Properties;
public class ApplicationOperationsImpl implements ApplicationOperations {
private static final Log log = LogFactory.getLog(ApplicationOperationsImpl.class);
+ public static final String MEDIA_TYPE_XML = "application/xml";
+ public static final String INSTALL = "install";
+ public static final String UNINSTALL = "uninstall";
/**
* @param applicationOperationAction holds the information needs to perform an action on mdm.
@@ -56,7 +70,7 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
throws MobileApplicationException {
if (log.isDebugEnabled()) {
log.debug(applicationOperationAction.getAction() + " action is triggered for " +
- applicationOperationAction.getType() +".");
+ applicationOperationAction.getType() +".");
}
Operation operation = null;
@@ -73,19 +87,19 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
getDevicesOfUser(userName);
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
- if(MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) ||
- applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){
- if (MDMAppConstants.ACTIVE.equalsIgnoreCase(device.getEnrolmentInfo().
- getStatus().toString())) {
+ if (MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) ||
+ applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())) {
+ if (MDMAppConstants.ACTIVE.equalsIgnoreCase(device.getEnrolmentInfo().
+ getStatus().toString())) {
deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
}
}
}
}
} catch (DeviceManagementException devEx) {
- String errorMsg = "Error occurred fetch device for user " + userName +
- " at app installation";
- logError(errorMsg, devEx);
+ String errorMsg = "Error occurred fetch device for user " + userName +
+ " at app installation";
+ logError(errorMsg, devEx);
throw new MobileApplicationException(errorMsg, devEx);
}
} else if (MDMAppConstants.ROLE.equals(applicationOperationAction.getType())) {
@@ -105,9 +119,9 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
}
}
} catch (DeviceManagementException devMgtEx) {
- String errorMsg = "Error occurred fetch device for user role " + userRole +
- " at app installation";
- logError(errorMsg, devMgtEx);
+ String errorMsg = "Error occurred fetch device for user role " + userRole +
+ " at app installation";
+ logError(errorMsg, devMgtEx);
throw new MobileApplicationException(errorMsg, devMgtEx);
}
@@ -189,8 +203,8 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
}
}
}
- activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())
- .installApplicationForDevices(operation, deviceIdentifiers);
+ activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())
+ .installApplicationForDevices(operation, deviceIdentifiers);
}
@@ -236,20 +250,18 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
List devices;
List deviceList = null;
try {
- if(MDMAppConstants.WEBAPP.equals
- (applicationOperationDevice.getPlatform())) {
- deviceList = MDMServiceAPIUtils
- .getDeviceManagementService(applicationOperationDevice.getTenantId()).
- getDevicesOfUser(
- applicationOperationDevice.getCurrentUser().getUsername());
- } else {
+ if (MDMAppConstants.WEBAPP.equals
+ (applicationOperationDevice.getPlatform())) {
+ deviceList = MDMServiceAPIUtils
+ .getDeviceManagementService(applicationOperationDevice.getTenantId()).
+ getDevicesOfUser(applicationOperationDevice.getCurrentUser().getUsername());
+ } else {
deviceList = MDMServiceAPIUtils
.getDeviceManagementService(applicationOperationDevice.getTenantId()).
- getDevicesOfUser(
- applicationOperationDevice.getCurrentUser().getUsername(),
+ getDevicesOfUser(applicationOperationDevice.getCurrentUser().getUsername(),
applicationOperationDevice.getPlatform());
}
- devices = new ArrayList<>(deviceList.size());
+ devices = new ArrayList<>(deviceList.size());
if(log.isDebugEnabled()){
log.debug("device list got from mdm "+ deviceList.toString());
}
@@ -268,18 +280,18 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
device.setType(MDMAppConstants.MOBILE_DEVICE);
String imgUrl;
if (MDMAppConstants.ANDROID.equalsIgnoreCase(commonDevice.getType())) {
- imgUrl = String.format(applicationOperationDevice.getConfigParams()
- .get(MDMAppConstants.IMAGE_URL),
- MDMAppConstants.NEXUS);
- } else if (MDMAppConstants.IOS.equalsIgnoreCase(commonDevice.getType())) {
- imgUrl = String.format(applicationOperationDevice.getConfigParams()
- .get(MDMAppConstants.IMAGE_URL),
- MDMAppConstants.IPHONE);
- } else {
- imgUrl = String.format(applicationOperationDevice.getConfigParams()
- .get(MDMAppConstants.IMAGE_URL),
- MDMAppConstants.NONE);
- }
+ imgUrl = String.format(applicationOperationDevice.getConfigParams()
+ .get(MDMAppConstants.IMAGE_URL),
+ MDMAppConstants.NEXUS);
+ } else if (MDMAppConstants.IOS.equalsIgnoreCase(commonDevice.getType())) {
+ imgUrl = String.format(applicationOperationDevice.getConfigParams()
+ .get(MDMAppConstants.IMAGE_URL),
+ MDMAppConstants.IPHONE);
+ } else {
+ imgUrl = String.format(applicationOperationDevice.getConfigParams()
+ .get(MDMAppConstants.IMAGE_URL),
+ MDMAppConstants.NONE);
+ }
device.setImage(imgUrl);
device.setPlatform(commonDevice.getType());
devices.add(device);
@@ -311,5 +323,138 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
}
}
+ public static UserStoreManager getUserStoreManager() throws UserStoreException {
+ RealmService realmService;
+ UserStoreManager userStoreManager;
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
+ if (realmService == null) {
+ String msg = "Realm service has not initialized.";
+ log.error(msg);
+ throw new IllegalStateException(msg);
+ }
+ int tenantId = ctx.getTenantId();
+ userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();
+ return userStoreManager;
+ }
+
+ class ApplicationSubscription extends Thread {
+
+ User currentUser;
+ String action;
+ App app;
+ int tenantId;
+ String type;
+ String[] params;
+ UserStoreManager userStoreManager;
+ UserRegistry userRegistry;
+
+ public ApplicationSubscription(User currentUser, String action, App app, int tenantId, final String type,
+ final String[] params) {
+ this.currentUser = currentUser;
+ this.action = action;
+ this.app = app;
+ this.tenantId = tenantId;
+ this.type = type;
+ this.params = params;
+ }
+
+ @Override
+ public void run() {
+
+ try {
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext privilegedCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ privilegedCarbonContext.setTenantId(tenantId);
+ RealmService realmService = (RealmService) privilegedCarbonContext.getOSGiService(RealmService.class, null);
+ if (realmService == null) {
+ String msg = "RealmService is not initialized";
+ log.error(msg);
+ throw new IllegalStateException(msg);
+ }
+
+ String tenantDomain;
+ try {
+ tenantDomain = realmService.getTenantManager().getDomain(tenantId);
+ privilegedCarbonContext.setTenantDomain(tenantDomain);
+ privilegedCarbonContext.setUsername(currentUser.getUsername());
+ userStoreManager = getUserStoreManager();
+ userRegistry = ServiceReferenceHolder.getInstance().getRegistryService()
+ .getGovernanceUserRegistry(currentUser.getUsername(), tenantId);
+ } catch (UserStoreException e) {
+ log.error("Error occured while fetching user store", e);
+ } catch (RegistryException e) {
+ log.error("Error occured while fetching registry instance", e);
+ }
+
+ String basePath = "/users/";
+ String subscriptionPath = "/subscriptions/mobileapp/";
+ String path;
+ if (type != null && type.equals("role")) {
+ for (String param : params) {
+ String[] users;
+ if (log.isDebugEnabled()) {
+ log.debug("role being added:" + param);
+ }
+ try {
+ users = userStoreManager.getUserListOfRole(param);
+ for (String user : users) {
+ path = basePath + user + subscriptionPath + app.getId();
+ updateSubscription(action, path, user, userRegistry);
+ }
+ } catch (UserStoreException e) {
+ log.error("Error occured while getting user list of role " + param, e);
+ }
+
+ }
+ } else if (type != null && type.equals("user")) {
+ for (String user : params) {
+ if (log.isDebugEnabled()) {
+ log.debug("user:" + user);
+ }
+ path = basePath + user + subscriptionPath + app.getId();
+ updateSubscription(action, path, user, userRegistry);
+ }
+ } else if (type != null && type.equals("device")) {
+ log.debug("device user:" + currentUser.getUsername());
+ path = basePath + currentUser.getUsername() + subscriptionPath + app.getId();
+ updateSubscription(action, path, currentUser.getUsername(), userRegistry);
+ }
+ log.info("registry subscription complete.");
+ } finally {
+ PrivilegedCarbonContext.endTenantFlow();
+ }
+ }
+ }
+
+ private void updateSubscription(String action, String path, String username, UserRegistry userRegistry) {
+ if (log.isDebugEnabled()) {
+ log.debug("update subscribe user:" + username + " , action:" + action + " ,path:" + path);
+ }
+ if (action != null && action.equals(INSTALL)) {
+ try {
+ if (!userRegistry.resourceExists(path)) {
+ Resource resource = userRegistry.newResource();
+ resource.setMediaType(MEDIA_TYPE_XML);
+ userRegistry.put(path, resource);
+ Generic generic = new Generic();
+ generic.showAppVisibilityToUser(path, username, "ALLOW");
+ }
+ } catch (RegistryException e) {
+ log.error("Error occured while accessing registry.", e);
+ }
+ } else if (action != null && action.equals(UNINSTALL)) {
+ try {
+ if (userRegistry.resourceExists(path)) {
+ userRegistry.delete(path);
+ Generic generic = new Generic();
+ generic.showAppVisibilityToUser(path, username, "DENY");
+ }
+ } catch (RegistryException e) {
+ log.error("Error occured while accessing registry.", e);
+ }
+ }
+ }
+
}
diff --git a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml
index e52457332..faa2e5299 100644
--- a/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml
+++ b/components/extensions/appm-connector/org.wso2.carbon.appmgt.mdm.restconnector/pom.xml
@@ -18,7 +18,7 @@
org.wso2.carbon.devicemgt-plugins
appm-connector
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/appm-connector/pom.xml b/components/extensions/appm-connector/pom.xml
index 31d082d0a..14555303d 100644
--- a/components/extensions/appm-connector/pom.xml
+++ b/components/extensions/appm-connector/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml
index 13d0372f8..9fdf522ac 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/src/main/java/org/wso2/carbon/device/mgt/input/adapter/extension/validator/MQTTContentValidator.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/src/main/java/org/wso2/carbon/device/mgt/input/adapter/extension/validator/MQTTContentValidator.java
index fdd4c34cf..3322acb9d 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/src/main/java/org/wso2/carbon/device/mgt/input/adapter/extension/validator/MQTTContentValidator.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.extension/src/main/java/org/wso2/carbon/device/mgt/input/adapter/extension/validator/MQTTContentValidator.java
@@ -40,7 +40,7 @@ public class MQTTContentValidator implements ContentValidator {
@Override
public String getType() {
- return null;
+ return CDMF_MQTT_CONTENT_VALIDATOR;
}
@Override
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml
index 8e7fd45ce..8b02645b2 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/src/main/java/org/wso2/carbon/device/mgt/input/adapter/http/HTTPMessageServlet.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/src/main/java/org/wso2/carbon/device/mgt/input/adapter/http/HTTPMessageServlet.java
index afda05edf..9ac531e6d 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/src/main/java/org/wso2/carbon/device/mgt/input/adapter/http/HTTPMessageServlet.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/src/main/java/org/wso2/carbon/device/mgt/input/adapter/http/HTTPMessageServlet.java
@@ -69,9 +69,14 @@ public class HTTPMessageServlet extends HttpServlet {
this.tenantId = tenantId;
this.exposedTransports = eventAdapterConfiguration.getProperties().get(
HTTPEventAdapterConstants.EXPOSED_TRANSPORTS);
+ String globalContentValidator = globalProperties.get(HTTPEventAdapterConstants.
+ ADAPTER_CONF_CONTENT_VALIDATOR_TYPE);
String contentValidatorType = eventAdapterConfiguration.getProperties().get(
HTTPEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_TYPE);
+ if (globalContentValidator != null && !globalContentValidator.isEmpty() ) {
+ contentValidatorType = globalContentValidator;
+ }
if (contentValidatorType == null || HTTPEventAdapterConstants.DEFAULT.equals(contentValidatorType)) {
contentValidator = InputAdapterServiceDataHolder.getInputAdapterExtensionService()
.getDefaultContentValidator();
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml
index a3bcecf24..f46a64d8b 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
@@ -32,10 +32,10 @@
http://wso2.org
-
- commons-codec.wso2
- commons-codec
-
+
+ commons-codec.wso2
+ commons-codec
+
org.wso2.carbon.analytics-common
org.wso2.carbon.event.input.adapter.core
@@ -76,10 +76,10 @@
org.wso2.carbon.devicemgt-plugins
org.wso2.carbon.device.mgt.input.adapter.extension
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.identity.jwt.client.extension
-
+
+ org.wso2.carbon.devicemgt
+ org.wso2.carbon.identity.jwt.client.extension
+
@@ -133,18 +133,22 @@
org.apache.http.impl.client;version="${httpclient.version.range}",
org.json.simple.*,
com.jayway.jsonpath.*,
- org.wso2.carbon.identity.jwt.client.extension.*,
- javax.net.ssl,
- org.apache.commons.codec.binary,
- org.apache.commons.logging,
- org.apache.http.entity,
- org.osgi.framework,
- org.osgi.service.component,
- org.osgi.service.http,
- org.wso2.carbon.context,
- org.wso2.carbon.core,
- org.wso2.carbon.device.mgt.input.adapter.extension,
- org.wso2.carbon.user.api
+ org.wso2.carbon.identity.jwt.client.extension.*,
+ javax.net.ssl,
+ org.apache.commons.codec.binary,
+ org.apache.commons.logging,
+ org.apache.http.entity,
+ org.osgi.framework,
+ org.osgi.service.component,
+ org.osgi.service.http,
+ org.wso2.carbon.context,
+ org.wso2.carbon.core,
+ org.wso2.carbon.device.mgt.input.adapter.extension,
+ org.wso2.carbon.user.api,
+ org.wso2.carbon.utils.multitenancy,
+ org.apache.axis2.context,
+ org.wso2.carbon.core.multitenancy.utils,
+ org.wso2.carbon.utils
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java
index f6b80dc79..8f5c996d0 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapter.java
@@ -19,13 +19,14 @@ package org.wso2.carbon.device.mgt.input.adapter.mqtt;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.input.adapter.mqtt.util.MQTTAdapterListener;
-import org.wso2.carbon.device.mgt.input.adapter.mqtt.util.MQTTEventAdapterConstants;
import org.wso2.carbon.device.mgt.input.adapter.mqtt.util.MQTTBrokerConnectionConfiguration;
+import org.wso2.carbon.device.mgt.input.adapter.mqtt.util.MQTTEventAdapterConstants;
import org.wso2.carbon.event.input.adapter.core.InputEventAdapter;
import org.wso2.carbon.event.input.adapter.core.InputEventAdapterConfiguration;
import org.wso2.carbon.event.input.adapter.core.InputEventAdapterListener;
import org.wso2.carbon.event.input.adapter.core.exception.InputEventAdapterException;
import org.wso2.carbon.event.input.adapter.core.exception.TestConnectionNotSupportedException;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.util.Map;
import java.util.UUID;
@@ -54,10 +55,11 @@ public class MQTTEventAdapter implements InputEventAdapter {
try {
mqttBrokerConnectionConfiguration = new MQTTBrokerConnectionConfiguration(eventAdapterConfiguration
,globalProperties);
+ String topic = eventAdapterConfiguration.getProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC);
mqttAdapterListener = new MQTTAdapterListener(mqttBrokerConnectionConfiguration
- ,eventAdapterConfiguration.getProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC)
- ,eventAdapterConfiguration.getProperties().get(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID)
- ,eventAdapterListener, PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
+ ,topic
+ ,eventAdapterConfiguration
+ ,eventAdapterListener);
} catch (Throwable t) {
throw new InputEventAdapterException(t.getMessage(), t);
}
@@ -77,6 +79,10 @@ public class MQTTEventAdapter implements InputEventAdapter {
@Override
public void connect() {
+ if (!PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()
+ .equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
+ return;
+ }
if (!mqttAdapterListener.isConnectionInitialized()) {
mqttAdapterListener.createConnection();
}
@@ -87,6 +93,10 @@ public class MQTTEventAdapter implements InputEventAdapter {
public void disconnect() {
//when mqtt and this feature both together then this method becomes a blocking method, Therefore
// have used a thread to skip it.
+ if (!PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()
+ .equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
+ return;
+ }
try {
Thread thread = new Thread(new Runnable() {
public void run() {
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapterFactory.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapterFactory.java
index f5f93b17a..0419d26eb 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapterFactory.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/MQTTEventAdapterFactory.java
@@ -120,7 +120,7 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
// set clientId
Property clientId = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID);
clientId.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID));
- clientId.setRequired(false);
+ clientId.setRequired(true);
clientId.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID_HINT));
propertyList.add(clientId);
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceComponent.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceComponent.java
index e281a7dae..806fb5949 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceComponent.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceComponent.java
@@ -17,6 +17,7 @@
*/
package org.wso2.carbon.device.mgt.input.adapter.mqtt.internal;
+import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
@@ -24,7 +25,9 @@ import org.osgi.service.http.HttpService;
import org.wso2.carbon.device.mgt.input.adapter.extension.InputAdapterExtensionService;
import org.wso2.carbon.device.mgt.input.adapter.mqtt.MQTTEventAdapterFactory;
import org.wso2.carbon.event.input.adapter.core.InputEventAdapterFactory;
+import org.wso2.carbon.event.input.adapter.core.InputEventAdapterService;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
+import org.wso2.carbon.utils.ConfigurationContextService;
/**
* @scr.component name="input.iot.mqtt.AdapterService.component" immediate="true"
@@ -38,6 +41,15 @@ import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerSer
* policy="dynamic"
* bind="setJWTClientManagerService"
* unbind="unsetJWTClientManagerService"
+ * @scr.reference name="input.adapter.service" interface="org.wso2.carbon.event.input.adapter.core.InputEventAdapterService"
+ * cardinality="1..1"
+ * policy="dynamic"
+ * bind="setInputEventAdapterService"
+ * unbind="unsetInputEventAdapterService"
+ * @scr.reference name="config.context.service"
+ * interface="org.wso2.carbon.utils.ConfigurationContextService"
+ * cardinality="1..1" policy="dynamic" bind="setConfigurationContextService"
+ * unbind="unsetConfigurationContextService"
*/
public class InputAdapterServiceComponent {
@@ -80,4 +92,21 @@ public class InputAdapterServiceComponent {
InputAdapterServiceDataHolder.setJwtClientManagerService(null);
}
+ protected void setInputEventAdapterService(InputEventAdapterService inputEventAdapterService) {
+ InputAdapterServiceDataHolder.setInputEventAdapterService(inputEventAdapterService);
+ }
+
+ protected void unsetInputEventAdapterService(InputEventAdapterService inputEventAdapterService) {
+ InputAdapterServiceDataHolder.setInputEventAdapterService(null);
+ }
+
+ protected void setConfigurationContextService(ConfigurationContextService contextService) {
+ ConfigurationContext serverConfigContext = contextService.getServerConfigContext();
+ InputAdapterServiceDataHolder.setMainServerConfigContext(serverConfigContext);
+ }
+
+ protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
+ InputAdapterServiceDataHolder.setMainServerConfigContext(null);
+ }
+
}
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceDataHolder.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceDataHolder.java
index 72fdbe245..408b2b2c7 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceDataHolder.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/internal/InputAdapterServiceDataHolder.java
@@ -14,9 +14,11 @@
*/
package org.wso2.carbon.device.mgt.input.adapter.mqtt.internal;
+import org.apache.axis2.context.ConfigurationContext;
import org.osgi.service.http.HttpService;
import org.wso2.carbon.device.mgt.input.adapter.extension.InputAdapterExtensionService;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
+import org.wso2.carbon.event.input.adapter.core.InputEventAdapterService;
/**
* common place to hold some OSGI service references.
@@ -26,6 +28,8 @@ public final class InputAdapterServiceDataHolder {
private static HttpService httpService;
private static InputAdapterExtensionService inputAdapterExtensionService;
private static JWTClientManagerService jwtClientManagerService;
+ private static InputEventAdapterService inputEventAdapterService;
+ private static ConfigurationContext mainServerConfigContext;
private InputAdapterServiceDataHolder() {
}
@@ -55,4 +59,20 @@ public final class InputAdapterServiceDataHolder {
JWTClientManagerService jwtClientManagerService) {
InputAdapterServiceDataHolder.jwtClientManagerService = jwtClientManagerService;
}
+
+ public static InputEventAdapterService getInputEventAdapterService() {
+ return inputEventAdapterService;
+ }
+
+ public static void setInputEventAdapterService(InputEventAdapterService inputEventAdapterService) {
+ InputAdapterServiceDataHolder.inputEventAdapterService = inputEventAdapterService;
+ }
+
+ public static ConfigurationContext getMainServerConfigContext() {
+ return mainServerConfigContext;
+ }
+
+ public static void setMainServerConfigContext(ConfigurationContext mainServerConfigContext) {
+ InputAdapterServiceDataHolder.mainServerConfigContext = mainServerConfigContext;
+ }
}
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTAdapterListener.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTAdapterListener.java
index dbfc79c9c..635012538 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTAdapterListener.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTAdapterListener.java
@@ -17,12 +17,14 @@
*/
package org.wso2.carbon.device.mgt.input.adapter.mqtt.util;
+import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.HttpHostConnectException;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicHeader;
@@ -33,16 +35,19 @@ import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.core.ServerStatus;
+import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
import org.wso2.carbon.device.mgt.input.adapter.extension.ContentInfo;
import org.wso2.carbon.device.mgt.input.adapter.extension.ContentTransformer;
import org.wso2.carbon.device.mgt.input.adapter.extension.ContentValidator;
import org.wso2.carbon.device.mgt.input.adapter.mqtt.internal.InputAdapterServiceDataHolder;
+import org.wso2.carbon.event.input.adapter.core.InputEventAdapterConfiguration;
import org.wso2.carbon.event.input.adapter.core.InputEventAdapterListener;
import org.wso2.carbon.event.input.adapter.core.exception.InputEventAdapterRuntimeException;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
import org.wso2.carbon.user.api.UserStoreException;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -63,26 +68,29 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
private MQTTBrokerConnectionConfiguration mqttBrokerConnectionConfiguration;
private String topic;
- private int tenantId;
+ private String tenantDomain;
private boolean connectionSucceeded = false;
- ContentValidator contentValidator;
- ContentTransformer contentTransformer;
+ private ContentValidator contentValidator;
+ private ContentTransformer contentTransformer;
+ private InputEventAdapterConfiguration inputEventAdapterConfiguration;
private InputEventAdapterListener eventAdapterListener = null;
public MQTTAdapterListener(MQTTBrokerConnectionConfiguration mqttBrokerConnectionConfiguration,
- String topic, String mqttClientId,
- InputEventAdapterListener inputEventAdapterListener, int tenantId) {
-
- if(mqttClientId == null || mqttClientId.trim().isEmpty()){
+ String topic, InputEventAdapterConfiguration inputEventAdapterConfiguration,
+ InputEventAdapterListener inputEventAdapterListener) {
+ String mqttClientId = inputEventAdapterConfiguration.getProperties()
+ .get(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID);
+ if (mqttClientId == null || mqttClientId.trim().isEmpty()) {
mqttClientId = MqttClient.generateClientId();
}
+ this.inputEventAdapterConfiguration = inputEventAdapterConfiguration;
this.mqttBrokerConnectionConfiguration = mqttBrokerConnectionConfiguration;
this.cleanSession = mqttBrokerConnectionConfiguration.isCleanSession();
int keepAlive = mqttBrokerConnectionConfiguration.getKeepAlive();
this.topic = PropertyUtils.replaceTenantDomainProperty(topic);
this.eventAdapterListener = inputEventAdapterListener;
- this.tenantId = tenantId;
+ this.tenantDomain = this.topic.split("/")[0];
//SORTING messages until the server fetches them
String temp_directory = System.getProperty("java.io.tmpdir");
@@ -104,7 +112,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
if (contentValidatorType == null || contentValidatorType.equals(MQTTEventAdapterConstants.DEFAULT)) {
contentValidator = InputAdapterServiceDataHolder.getInputAdapterExtensionService()
.getDefaultContentValidator();
- } else {
+ } else {
contentValidator = InputAdapterServiceDataHolder.getInputAdapterExtensionService()
.getContentValidator(contentValidatorType);
}
@@ -124,7 +132,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
}
}
- public void startListener() throws MqttException {
+ public boolean startListener() throws MqttException {
if (this.mqttBrokerConnectionConfiguration.getUsername() != null &&
this.mqttBrokerConnectionConfiguration.getDcrUrl() != null) {
String username = this.mqttBrokerConnectionConfiguration.getUsername();
@@ -145,7 +153,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
if (!mqttBrokerConnectionConfiguration.isGlobalCredentailSet()) {
registrationProfile.setClientName(MQTTEventAdapterConstants.APPLICATION_NAME_PREFIX
+ mqttBrokerConnectionConfiguration.getAdapterName() +
- "_" + tenantId);
+ "_" + tenantDomain);
registrationProfile.setIsSaasApp(false);
} else {
registrationProfile.setClientName(MQTTEventAdapterConstants.APPLICATION_NAME_PREFIX
@@ -175,17 +183,35 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
log.error(msg, e);
}
}
+ } catch (HttpHostConnectException e) {
+ log.error("Keymanager is unreachable, Waiting....");
+ return false;
} catch (MalformedURLException e) {
log.error("Invalid dcrUrl : " + dcrUrlString);
- } catch (JWTClientException | UserStoreException e) {
+ return false;
+ } catch (JWTClientException | UserStoreException e) {
log.error("Failed to create an oauth token with jwt grant type.", e);
- } catch (NoSuchAlgorithmException |KeyManagementException |KeyStoreException | IOException e) {
+ return false;
+ } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException | IOException e) {
log.error("Failed to create a http connection.", e);
+ return false;
}
}
}
- mqttClient.connect(connectionOptions);
- mqttClient.subscribe(topic);
+ try {
+ mqttClient.connect(connectionOptions);
+ } catch (MqttException e) {
+ log.warn("Broker is unreachable, Waiting.....");
+ return false;
+ }
+ try {
+ mqttClient.subscribe(topic);
+ } catch (MqttException e) {
+ log.error("Failed to subscribe to topic: " + topic + ", Retrying.....");
+ return false;
+ }
+ return true;
+
}
public void stopListener(String adapterName) {
@@ -197,7 +223,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
mqttClient.disconnect(3000);
} catch (MqttException e) {
log.error("Can not unsubscribe from the destination " + topic +
- " with the event adapter " + adapterName, e);
+ " with the event adapter " + adapterName, e);
}
}
connectionSucceeded = true;
@@ -218,7 +244,14 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
log.debug(msgText);
}
PrivilegedCarbonContext.startTenantFlow();
- PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(tenantId);
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
+ if (!tenantDomain.equalsIgnoreCase(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
+ TenantAxisUtils.getTenantConfigurationContext(tenantDomain, InputAdapterServiceDataHolder.getMainServerConfigContext());
+ }
+
+ InputEventAdapterListener inputEventAdapterListener = InputAdapterServiceDataHolder
+ .getInputEventAdapterService().getInputAdapterRuntime(PrivilegedCarbonContext.getThreadLocalCarbonContext()
+ .getTenantId(), inputEventAdapterConfiguration.getName());
if (log.isDebugEnabled()) {
log.debug("Event received in MQTT Event Adapter - " + msgText);
@@ -231,10 +264,10 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
msgText = (String) contentTransformer.transform(msgText, dynamicProperties);
contentInfo = contentValidator.validate(msgText, dynamicProperties);
if (contentInfo != null && contentInfo.isValidContent()) {
- eventAdapterListener.onEvent(contentInfo.getMessage());
+ inputEventAdapterListener.onEvent(contentInfo.getMessage());
}
} else {
- eventAdapterListener.onEvent(msgText);
+ inputEventAdapterListener.onEvent(msgText);
}
} finally {
PrivilegedCarbonContext.endTenantFlow();
@@ -252,10 +285,14 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
while (!connectionSucceeded) {
try {
connectionDuration = connectionDuration * MQTTEventAdapterConstants.RECONNECTION_PROGRESS_FACTOR;
+ if (connectionDuration > MQTTEventAdapterConstants.MAXIMUM_RECONNECTION_DURATION) {
+ connectionDuration = MQTTEventAdapterConstants.MAXIMUM_RECONNECTION_DURATION;
+ }
Thread.sleep(connectionDuration);
- startListener();
- connectionSucceeded = true;
- log.info("MQTT Connection successful");
+ if (startListener()) {
+ connectionSucceeded = true;
+ log.info("MQTT Connection successful");
+ }
} catch (InterruptedException e) {
log.error("Interruption occurred while waiting for reconnection", e);
} catch (MqttException e) {
@@ -276,7 +313,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
private String getToken(String clientId, String clientSecret)
throws UserStoreException, JWTClientException {
PrivilegedCarbonContext.startTenantFlow();
- PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(tenantId, true);
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
try {
String scopes = mqttBrokerConnectionConfiguration.getBrokerScopes();
String username = mqttBrokerConnectionConfiguration.getUsername();
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
index 3685c245f..32669bd96 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
@@ -105,10 +105,18 @@ public class MQTTBrokerConnectionConfiguration {
this.brokerUrl = PropertyUtils.replaceMqttProperty(url);
this.dcrUrl = PropertyUtils
.replaceMqttProperty(globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL));
- this.contentValidatorType = eventAdapterConfiguration.getProperties()
- .get(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_TYPE);
- this.cleanSession = Boolean.parseBoolean(eventAdapterConfiguration.getProperties()
- .get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
+ this.contentValidatorType = globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_TYPE);
+ if (contentValidatorType == null || contentValidatorType.isEmpty()) {
+ this.contentValidatorType = eventAdapterConfiguration.getProperties()
+ .get(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_TYPE);
+ }
+ String cleanSession = globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION);
+ if (cleanSession == null || cleanSession.isEmpty()) {
+ this.cleanSession = Boolean.parseBoolean(eventAdapterConfiguration.getProperties()
+ .get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
+ } else {
+ this.cleanSession = Boolean.parseBoolean(cleanSession);
+ }
//If global properties are available those will be assigned else constant values will be assigned
if (globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_KEEP_ALIVE) != null) {
keepAlive = Integer.parseInt((globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_KEEP_ALIVE)));
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTEventAdapterConstants.java b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTEventAdapterConstants.java
index dc0e45413..7d52fb53c 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTEventAdapterConstants.java
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/input/adapter/mqtt/util/MQTTEventAdapterConstants.java
@@ -50,6 +50,7 @@ public class MQTTEventAdapterConstants {
public static final int INITIAL_RECONNECTION_DURATION = 4000;
public static final int RECONNECTION_PROGRESS_FACTOR = 2;
+ public static final int MAXIMUM_RECONNECTION_DURATION = 60000;
public static final String EMPTY_STRING = "";
public static final String GRANT_TYPE_PARAM_NAME = "grant_type";
diff --git a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml
index d51910bf8..b83eeea47 100644
--- a/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml
index 0ae495a36..a52f5d32c 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapter.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapter.java
index fbc9c015d..658a124d2 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapter.java
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapter.java
@@ -44,10 +44,10 @@ public class MQTTEventAdapter implements OutputEventAdapter {
private Map globalProperties;
private MQTTAdapterPublisher mqttAdapterPublisher;
private int connectionKeepAliveInterval;
- private String qos;
private static ThreadPoolExecutor threadPoolExecutor;
private static final Log log = LogFactory.getLog(MQTTEventAdapter.class);
private int tenantId;
+ private MQTTBrokerConnectionConfiguration mqttBrokerConnectionConfiguration;
public MQTTEventAdapter(OutputEventAdapterConfiguration eventAdapterConfiguration,
Map globalProperties) {
@@ -117,11 +117,11 @@ public class MQTTEventAdapter implements OutputEventAdapter {
@Override
public void connect() {
- MQTTBrokerConnectionConfiguration mqttBrokerConnectionConfiguration =
+ mqttBrokerConnectionConfiguration =
new MQTTBrokerConnectionConfiguration(eventAdapterConfiguration, globalProperties);
String clientId = eventAdapterConfiguration.getStaticProperties().get(
MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID);
- qos = eventAdapterConfiguration.getStaticProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_QOS);
+
mqttAdapterPublisher = new MQTTAdapterPublisher(mqttBrokerConnectionConfiguration, clientId, tenantId);
}
@@ -179,11 +179,7 @@ public class MQTTEventAdapter implements OutputEventAdapter {
}
}
}
- if (qos == null || qos.trim().isEmpty()) {
- mqttAdapterPublisher.publish(message.toString(), topic);
- } else {
- mqttAdapterPublisher.publish(Integer.parseInt(qos), message.toString(), topic);
- }
+ mqttAdapterPublisher.publish(mqttBrokerConnectionConfiguration.getQos(), message.toString(), topic);
} catch (Throwable t) {
EventAdapterUtil.logAndDrop(eventAdapterConfiguration.getName(), message, null, t, log, tenantId);
}
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapterFactory.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapterFactory.java
index 1c8cd43de..b3351234f 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapterFactory.java
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/MQTTEventAdapterFactory.java
@@ -90,9 +90,9 @@ public class MQTTEventAdapterFactory extends OutputEventAdapterFactory {
// set Quality of Service
Property qos = new Property(MQTTEventAdapterConstants.ADAPTER_MESSAGE_QOS);
qos.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_MESSAGE_QOS));
- qos.setRequired(true);
+ qos.setRequired(false);
qos.setOptions(new String[]{"0", "1", "2"});
- qos.setDefaultValue("1");
+ qos.setDefaultValue("2");
staticPropertyList.add(brokerUrl);
staticPropertyList.add(userName);
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
index 2bbd394ab..7bdf982c9 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.mqtt/src/main/java/org/wso2/carbon/device/mgt/output/adapter/mqtt/util/MQTTBrokerConnectionConfiguration.java
@@ -34,6 +34,7 @@ public class MQTTBrokerConnectionConfiguration {
private boolean cleanSession = true;
private int keepAlive;
private boolean globalCredentailSet;
+ private int qos;
public String getTokenUrl() {
return tokenUrl;
@@ -75,6 +76,9 @@ public class MQTTBrokerConnectionConfiguration {
return globalCredentailSet;
}
+ public int getQos() {
+ return qos;
+ }
public MQTTBrokerConnectionConfiguration(OutputEventAdapterConfiguration eventAdapterConfiguration,
Map globalProperties) {
adapterName = eventAdapterConfiguration.getName();
@@ -98,14 +102,28 @@ public class MQTTBrokerConnectionConfiguration {
if (scopes == null) {
this.scopes = MQTTEventAdapterConstants.EMPTY_STRING;
}
- this.cleanSession = Boolean.parseBoolean(eventAdapterConfiguration.getStaticProperties()
- .get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
+ String cleanSession = globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION);
+ if (cleanSession == null || cleanSession.isEmpty()) {
+ this.cleanSession = Boolean.parseBoolean(eventAdapterConfiguration.getStaticProperties()
+ .get(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
+ } else {
+ this.cleanSession = Boolean.parseBoolean(cleanSession);
+ }
//If global properties are available those will be assigned else constant values will be assigned
if (globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_KEEP_ALIVE) != null) {
keepAlive = Integer.parseInt((globalProperties.get(MQTTEventAdapterConstants.ADAPTER_CONF_KEEP_ALIVE)));
} else {
keepAlive = MQTTEventAdapterConstants.ADAPTER_CONF_DEFAULT_KEEP_ALIVE;
}
+ String qosVal = globalProperties.get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_QOS);
+ if (qosVal != null && !qosVal.isEmpty()) {
+ this.qos = Integer.parseInt(qosVal);
+ } else {
+ qosVal = eventAdapterConfiguration.getStaticProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_QOS);
+ this.qos = Integer.parseInt(qosVal);
+ }
+
+
}
}
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml
index ab15cd7af..7c1109aab 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/src/main/webapp/WEB-INF/web.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/src/main/webapp/WEB-INF/web.xml
index 2ec7fc7e9..ee5417b4c 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/src/main/webapp/WEB-INF/web.xml
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/src/main/webapp/WEB-INF/web.xml
@@ -21,4 +21,39 @@
Output WebSocket
+
+ HttpHeaderSecurityFilter
+ org.apache.catalina.filters.HttpHeaderSecurityFilter
+
+ hstsEnabled
+ false
+
+
+
+
+ ContentTypeBasedCachePreventionFilter
+ org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter
+
+ patterns
+ text/html" ,application/json" ,text/plain
+
+
+ filterAction
+ enforce
+
+
+ httpHeaders
+ Cache-Control: no-store, no-cache, must-revalidate, private
+
+
+
+
+ HttpHeaderSecurityFilter
+ /*
+
+
+
+ ContentTypeBasedCachePreventionFilter
+ /*
+
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml
index 700f0cd29..527917363 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/DeviceAuthorizer.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/DeviceAuthorizer.java
index c4c40856e..775ea200f 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/DeviceAuthorizer.java
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/DeviceAuthorizer.java
@@ -63,23 +63,14 @@ public class DeviceAuthorizer implements Authorizer {
private static DeviceAccessAuthorizationAdminService deviceAccessAuthorizationAdminService;
private static final String CDMF_SERVER_BASE_CONTEXT = "/api/device-mgt/v1.0";
private static final String DEVICE_MGT_SERVER_URL = "deviceMgtServerUrl";
- private static final String STAT_PERMISSION = "statsPermission";
private static final String DEVICE_ID = "deviceId";
private static final String DEVICE_TYPE = "deviceType";
private static Log log = LogFactory.getLog(DeviceAuthorizer.class);
- private static List statPermissions;
-
public DeviceAuthorizer() {
}
@Override
public void init(Map globalProperties) {
- statPermissions = getPermissions(globalProperties);
- if (statPermissions != null && !statPermissions.isEmpty()) {
- for (String permission : statPermissions) {
- PermissionUtil.putPermission(permission);
- }
- }
try {
deviceAccessAuthorizationAdminService = Feign.builder().client(getSSLClient()).logger(new Slf4jLogger())
.logLevel(Logger.Level.FULL).requestInterceptor(new OAuthRequestInterceptor(globalProperties))
@@ -102,9 +93,6 @@ public class DeviceAuthorizer implements Authorizer {
AuthorizationRequest authorizationRequest = new AuthorizationRequest();
authorizationRequest.setTenantDomain(authenticationInfo.getTenantDomain());
- if (statPermissions != null && !statPermissions.isEmpty()) {
- authorizationRequest.setPermissions(statPermissions);
- }
authorizationRequest.setUsername(authenticationInfo.getUsername());
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(deviceId);
@@ -137,14 +125,6 @@ public class DeviceAuthorizer implements Authorizer {
return deviceMgtServerUrl;
}
- private List getPermissions(Map properties) {
- String stats = properties.get(STAT_PERMISSION);
- if (stats != null && !stats.isEmpty()) {
- return Arrays.asList(stats.replace("\n", "").split(" "));
- }
- return null;
- }
-
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/PermissionUtil.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/PermissionUtil.java
deleted file mode 100644
index cab25a8c4..000000000
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/PermissionUtil.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.wso2.carbon.device.mgt.output.adapter.websocket.authorization;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.base.MultitenantConstants;
-import org.wso2.carbon.device.mgt.output.adapter.websocket.internal.WebsocketEventAdaptorServiceDataHolder;
-import org.wso2.carbon.registry.api.Resource;
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-
-import java.util.StringTokenizer;
-
-/**
- * Utility class which holds necessary utility methods required for persisting permissions in
- * registry.
- */
-public class PermissionUtil {
-
- public static final String PERMISSION_PROPERTY_NAME = "name";
- private static Log log = LogFactory.getLog(DeviceAuthorizer.class);
-
- public static void putPermission(String permission) {
- try {
- StringTokenizer tokenizer = new StringTokenizer(permission, "/");
- String lastToken = "", currentToken, tempPath;
- while (tokenizer.hasMoreTokens()) {
- currentToken = tokenizer.nextToken();
- tempPath = lastToken + "/" + currentToken;
- if (!checkResourceExists(tempPath)) {
- createRegistryCollection(tempPath, currentToken);
-
- }
- lastToken = tempPath;
- }
- } catch (org.wso2.carbon.registry.api.RegistryException e) {
- log.error("Failed to creation permission in registry" + permission, e);
- }
- }
-
- public static void createRegistryCollection(String path, String resourceName)
- throws org.wso2.carbon.registry.api.RegistryException {
- Resource resource = getGovernanceRegistry().newCollection();
- resource.addProperty(PERMISSION_PROPERTY_NAME, resourceName);
- getGovernanceRegistry().beginTransaction();
- getGovernanceRegistry().put(path, resource);
- getGovernanceRegistry().commitTransaction();
- }
-
- public static boolean checkResourceExists(String path)
- throws RegistryException {
- return getGovernanceRegistry().resourceExists(path);
- }
-
- public static Registry getGovernanceRegistry() throws RegistryException {
- return WebsocketEventAdaptorServiceDataHolder.getRegistryService()
- .getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
- }
-
-}
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/client/dto/DeviceAccessAuthorizationAdminService.java b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/client/dto/DeviceAccessAuthorizationAdminService.java
index 7ff42b115..440173bf3 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/client/dto/DeviceAccessAuthorizationAdminService.java
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket/src/main/java/org/wso2/carbon/device/mgt/output/adapter/websocket/authorization/client/dto/DeviceAccessAuthorizationAdminService.java
@@ -28,7 +28,7 @@ import javax.ws.rs.core.MediaType;
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
-@Path("/admin/authorization")
+@Path("/admin/authorization/stat")
/**
* This interface provided the definition of the device - user access verification service.
*/
diff --git a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml
index 723aeb3dd..40606f5b8 100644
--- a/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.xmpp/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
cdmf-transport-adapters
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/extensions/cdmf-transport-adapters/pom.xml b/components/extensions/cdmf-transport-adapters/pom.xml
index eaa86fccc..18e368ce2 100644
--- a/components/extensions/cdmf-transport-adapters/pom.xml
+++ b/components/extensions/cdmf-transport-adapters/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml
index 31a12f7a1..ce48000b0 100644
--- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml
+++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
mb-extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/DeviceAccessBasedMQTTAuthorizer.java b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/DeviceAccessBasedMQTTAuthorizer.java
index 6fd2c3464..e158c726e 100644
--- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/DeviceAccessBasedMQTTAuthorizer.java
+++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/DeviceAccessBasedMQTTAuthorizer.java
@@ -77,12 +77,14 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
private static final String CACHE_MANAGER_NAME = "mqttAuthorizationCacheManager";
private static final String CACHE_NAME = "mqttAuthorizationCache";
private static DeviceAccessAuthorizationAdminService deviceAccessAuthorizationAdminService;
-
+ private static OAuthRequestInterceptor oAuthRequestInterceptor;
+ private static final String GATEWAY_ERROR_CODE = "404";
public DeviceAccessBasedMQTTAuthorizer() {
+ oAuthRequestInterceptor = new OAuthRequestInterceptor();
this.MQTTAuthorizationConfiguration = AuthorizationConfigurationManager.getInstance();
deviceAccessAuthorizationAdminService = Feign.builder().client(getSSLClient()).logger(new Slf4jLogger())
- .logLevel(Logger.Level.FULL).requestInterceptor(new OAuthRequestInterceptor())
+ .logLevel(Logger.Level.FULL).requestInterceptor(oAuthRequestInterceptor)
.contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder())
.target(DeviceAccessAuthorizationAdminService.class,
MQTTAuthorizationConfiguration.getDeviceMgtServerUrl() + CDMF_SERVER_BASE_CONTEXT);
@@ -121,7 +123,12 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
}
return false;
} catch (FeignException e) {
- log.error(e.getMessage(), e);
+ oAuthRequestInterceptor.resetApiApplicationKey();
+ if (e.getMessage().contains(GATEWAY_ERROR_CODE)) {
+ log.error("Failed to connect to the device authorization service.");
+ } else {
+ log.error(e.getMessage(), e);
+ }
return false;
}
}
@@ -164,6 +171,12 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
}
}
} catch (FeignException e) {
+ oAuthRequestInterceptor.resetApiApplicationKey();
+ if (e.getMessage().contains(GATEWAY_ERROR_CODE)) {
+ log.error("Failed to connect to the device authorization service.");
+ } else {
+ log.error(e.getMessage(), e);
+ }
log.error(e.getMessage(), e);
}
} finally {
diff --git a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/client/OAuthRequestInterceptor.java b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/client/OAuthRequestInterceptor.java
index b6124baae..d2917f59e 100755
--- a/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/client/OAuthRequestInterceptor.java
+++ b/components/extensions/mb-extensions/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization/src/main/java/org/wso2/carbon/andes/extensions/device/mgt/mqtt/authorization/client/OAuthRequestInterceptor.java
@@ -123,6 +123,10 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
template.header("Authorization", headerValue);
}
+ public void resetApiApplicationKey() {
+ apiApplicationKey = null;
+ }
+
private static Client getSSLClient() {
return new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier() {
@Override
diff --git a/components/extensions/mb-extensions/pom.xml b/components/extensions/mb-extensions/pom.xml
index 3bc52e0eb..6653e9021 100644
--- a/components/extensions/mb-extensions/pom.xml
+++ b/components/extensions/mb-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/pom.xml b/components/extensions/pom.xml
index 471e76b9e..639275b5a 100644
--- a/components/extensions/pom.xml
+++ b/components/extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml
index a171d8f32..f8945c007 100644
--- a/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml
+++ b/components/extensions/siddhi-extensions/org.wso2.extension.siddhi.execution.json/pom.xml
@@ -20,7 +20,7 @@
org.wso2.carbon.devicemgt-plugins
siddhi-extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -77,7 +77,7 @@
org.wso2.extension.siddhi.execution.json.*
- org.json,
+ org.json;version="${orbit.version.json.range}",
org.wso2.siddhi.core.*,
org.wso2.siddhi.query.api.*,
diff --git a/components/extensions/siddhi-extensions/pom.xml b/components/extensions/siddhi-extensions/pom.xml
index 865b6b92d..5cce874e3 100644
--- a/components/extensions/siddhi-extensions/pom.xml
+++ b/components/extensions/siddhi-extensions/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
extensions
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.analytics/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.analytics/pom.xml
index 684d73c17..ec384d200 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.analytics/pom.xml
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.analytics/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
android-plugin
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
index 84f16f315..082dcaaa2 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml
@@ -21,7 +21,7 @@
android-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java
index 9efe83656..6ef393cf3 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java
@@ -20,14 +20,22 @@ package org.wso2.carbon.mdm.services.android.services.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.device.mgt.common.*;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.device.mgt.common.Device;
+import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
+import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
+import org.wso2.carbon.device.mgt.common.DeviceManagementException;
+import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
+import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
+import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
+import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtException;
+import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
-import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
import org.wso2.carbon.mdm.services.android.bean.ErrorResponse;
import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication;
import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice;
@@ -38,7 +46,6 @@ import org.wso2.carbon.mdm.services.android.util.AndroidConstants;
import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils;
import org.wso2.carbon.mdm.services.android.util.Message;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
-import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import javax.validation.Valid;
@@ -186,8 +193,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
notification.setOperationId(operation.getId());
notification.setStatus(org.wso2.carbon.device.mgt.common.notification.mgt.Notification.
Status.NEW.toString());
- notification.setDescription(operation.getCode() + " operation did fail to execute on device " +
- deviceName + " with identifier " + deviceId);
+ notification.setDescription(operation.getCode() + " operation failed to execute on device " +
+ deviceName + " (ID: " + deviceId + ")");
AndroidAPIUtils.getNotificationManagementService().addNotification(id, notification);
}
if (log.isDebugEnabled()) {
@@ -219,8 +226,30 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
boolean status = AndroidAPIUtils.getDeviceManagementService().enrollDevice(device);
if (status) {
+ DeviceIdentifier deviceIdentifier = new DeviceIdentifier(androidDevice.getDeviceIdentifier(),
+ device.getType());
+
+ //Immediately update location information from initial payload
+ DeviceLocation deviceLocation = extractLocation(deviceIdentifier, androidDevice.getProperties());
+ if (deviceLocation != null) {
+ try {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ DeviceInformationManager informationManager =
+ (DeviceInformationManager) ctx.getOSGiService(DeviceInformationManager.class, null);
+
+ informationManager.addDeviceLocation(deviceLocation);
+ } catch (DeviceDetailsMgtException e) {
+ String msg = "Error occurred while updating the device location upon android " +
+ "', which carries the id '" + androidDevice.getDeviceIdentifier() + "'";
+ log.error(msg, e);
+ throw new UnexpectedServerErrorException(
+ new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
+ }
+ }
+
+ //Adding Tasks to get device information
List deviceIdentifiers = new ArrayList<>();
- deviceIdentifiers.add(new DeviceIdentifier(androidDevice.getDeviceIdentifier(), device.getType()));
+ deviceIdentifiers.add(deviceIdentifier);
List taskOperaions = new ArrayList<>();
taskOperaions.add(AndroidConstants.OperationCodes.APPLICATION_LIST);
@@ -416,4 +445,41 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
}
}
+ /**
+ * Extracts the device location
+ *
+ * @param deviceIdentifier
+ * @param properties
+ * @return returns null when location not found
+ */
+ private DeviceLocation extractLocation(DeviceIdentifier deviceIdentifier, List properties)
+ throws DeviceManagementException {
+
+ DeviceLocation location = null;
+ String latitude = "", longitude = "";
+
+ if (properties == null) return null;
+
+ for (Device.Property property : properties) {
+ String propertyName = property.getName();
+ if (propertyName == null) continue;
+ if (propertyName.equals("LATITUDE")) {
+ latitude = property.getValue();
+ if (!longitude.isEmpty()) break;
+ } else if (propertyName.equals("LONGITUDE")) {
+ longitude = property.getValue();
+ if (!latitude.isEmpty()) break;
+ }
+ }
+
+ if (!latitude.isEmpty() && !longitude.isEmpty()) {
+ location = new DeviceLocation();
+ location.setLatitude(Double.valueOf(latitude));
+ location.setLongitude(Double.valueOf(longitude));
+ location.setDeviceIdentifier(deviceIdentifier);
+ Device savedDevice = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier);
+ location.setDeviceId(savedDevice.getId());
+ }
+ return location;
+ }
}
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml
index c40c8a613..d8f1346fb 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/pom.xml
@@ -23,13 +23,13 @@
android-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.android.ui
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Mobile Android UI
pom
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk
index e21252790..8c1e0c5bc 100644
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs
index 498558a28..62ab1f6f6 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs
@@ -65,6 +65,7 @@
+ {{#unless iscloud}}
@@ -107,6 +108,7 @@
+ {{/unless}}
@@ -302,6 +304,7 @@
+ {{#unless iscloud}}
+ {{/unless}}
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs
index 2037c9c1c..07fe6950b 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-view/public/templates/android-policy-view.hbs
@@ -48,6 +48,7 @@
+ {{#unless iscloud}}
@@ -90,6 +91,7 @@
+ {{/unless}}
@@ -287,6 +289,7 @@
+ {{#unless iscloud}}
Bellow restrictions will be applied on devices with Android version 5.0 Lollipop onwards only
@@ -701,6 +704,7 @@
+ {{/unless}}
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png
index 8e5230965..fe508e61f 100644
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/install_agent.png differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png
deleted file mode 100644
index 9a01b0ac4..000000000
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/login.png and /dev/null differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png
new file mode 100644
index 000000000..a943c862d
Binary files /dev/null and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register-cloud.png differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png
index df3801a3b..761b43587 100644
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/register.png differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png
index 7187b6d20..6d516fadb 100644
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/registration.png differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png
index 23e6002df..7a9d9c7fc 100644
Binary files a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png and b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/images/set_profile.png differ
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js
index 5f92d11aa..6375247c8 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/public/js/type-view.js
@@ -384,31 +384,4 @@ $(document).ready(function () {
}
);
});
-});
-
-function artifactUpload() {
- var contentType = "application/json";
-
- var urix = backendEndBasePath + "/admin/devicetype/deploy/android";
- var defaultStatusClasses = "fw fw-stack-1x";
- var content = $("#android-statistic-response-template").find(".content");
- var title = content.find("#title");
- var statusIcon = content.find("#status-icon");
- var data = {}
- invokerUtil.post(urix, data, function (data) {
- title.html("Deploying statistic artifacts. Please wait...");
- statusIcon.attr("class", defaultStatusClasses + " fw-check");
- $(modalPopupContent).html(content.html());
- showPopup();
- setTimeout(function () {
- hidePopup();
- location.reload(true);
- }, 5000);
-
- }, function (jqXHR) {
- title.html("Failed to deploy artifacts, Please contact administrator.");
- statusIcon.attr("class", defaultStatusClasses + " fw-error");
- $(modalPopupContent).html(content.html());
- showPopup();
- }, contentType);
-}
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs
index 22018141c..183b0b96b 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.hbs
@@ -20,7 +20,7 @@
{{#if isVirtual}}
Download our virtual Android device, enroll it with WSO2
- Device Cloud and try it out!
+ Device Cloud and try it out!
@@ -79,11 +79,11 @@
-{{#if isCloud}}
-
- {{#if isVirtual}}
-
-
Step 1
+
+ {{#if isCloud}}
+
+
Step 1
+ {{#if isVirtual}}
- Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
@@ -107,97 +107,101 @@
-
- {{else}}
-
-
Step 1
+ {{else}}
Let's start by opening the Android agent on your device.
Tap on WSO2 Device Management Agent.
-
- {{/if}}
+ {{/if}}
+
Step 2
-
Enter your :
-
+
Enter your :
- - Organization: {{@user.domain}}
- Username: {{@user.username}}
- Password: Your Cloud password.
-
+
Step 3
-
To successfully register the virtual device,
+
To successfully register the device,
- Tap ALLOW to provide the necessary permissions.
- Tap ACTIVATE to enable the device administrator.
-{{else}}
-
+ {{else}}
Step 1
{{#if isVirtual}}
-
- - Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
- - Download and install the Android SDK.
-
- - If you already have an Android SDK on your computer, please provide the location of the
- SDK.
-
- - Else, this tool will download and install the minimum SDK components required to run the
- emulator.
- This is a one-time process.
-
-
-
- - Next, you will be asked to create an AVD:
-
- - If you don't have one, the WSO2_AVD will be created for you.
- - Else, you can use an existing AVD to try out IoT Android agent.
-
-
-
+
+
+ - Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.
+ - Download and install the Android SDK.
+
+ - If you already have an Android SDK on your computer, please provide the location of
+ the
+ SDK.
+
+ - Else, this tool will download and install the minimum SDK components required to run
+ the
+ emulator.
+ This is a one-time process.
+
+
+
+ - Next, you will be asked to create an AVD:
+
+ - If you don't have one, the WSO2_AVD will be created for you.
+ - Else, you can use an existing AVD to try out IoT Android agent.
+
+
+
+
{{else}}
-
Let's start by installing the Android agent on your device. Open the downloaded file, and tap
- INSTALL.
+
+
Let's start by installing the Android agent on your device. Open the downloaded file, and tap
+ INSTALL.
+
{{/if}}
Step 2
-
Tap Skip to proceed with the default enrollment process.
+
+
Tap Skip to proceed with the default enrollment process.
+
Step 3
-
Enter the server address based on your environment, in the text box provided.
+
+
Enter the server address based on your environment, in the text box provided.
+
Step 4
-
Enter your:
-
-
- - Organization: {{@user.domain}}
- - Username: {{@user.username}}
- - Password: Your password.
-
+
+
Enter your:
+
+ - Organization: {{@user.domain}}
+ - Username: {{@user.username}}
+ - Password: Your password.
+
+
-{{/if}}
-
+ {{/if}}
{{#zone "topCss"}}
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js
index a85a187d7..881806f4c 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.type-view/type-view.js
@@ -19,21 +19,6 @@
function onRequest(context) {
var viewModel = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
- //uncomment this to enable analytics artifact deployment
- //var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
- //var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status";
- //serviceInvokers.XMLHttp.get(
- // url, function (responsePayload) {
- // var responseContent = responsePayload.status;
- // new Log().error(responseContent);
- // if ("204" == responsePayload.status) {
- // viewModel["displayStatus"] = "Display";
- // }
- // },
- // function (responsePayload) {
- // //do nothing.
- // }
- //);
var isCloud = devicemgtProps["isCloud"];
viewModel["isVirtual"] = request.getParameter("type") == 'virtual';
viewModel["isCloud"] = isCloud;
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml
index c0425f766..06927ef1f 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml
@@ -22,7 +22,7 @@
android-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java
index f5b762db0..fb8ef1177 100644
--- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java
+++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidDeviceManagementService.java
@@ -20,7 +20,11 @@ package org.wso2.carbon.device.mgt.mobile.android.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.device.mgt.common.*;
+import org.wso2.carbon.device.mgt.common.DeviceManagementException;
+import org.wso2.carbon.device.mgt.common.DeviceManager;
+import org.wso2.carbon.device.mgt.common.InitialOperationConfig;
+import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
+import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
@@ -94,7 +98,8 @@ public class AndroidDeviceManagementService implements DeviceManagementService {
HashMap
config = new HashMap<>();
config.put(FCM_API_KEY, this.getConfigProperty(configuration, FCM_API_KEY));
config.put(FCM_SENDER_ID, this.getConfigProperty(configuration, FCM_SENDER_ID));
- return new PushNotificationConfig(AndroidPluginConstants.NotifierType.FCM, config);
+ return new PushNotificationConfig(AndroidPluginConstants.NotifierType.FCM, false,
+ config);
}
}
}
diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml
index bc76ed8ea..f5690ed52 100644
--- a/components/mobile-plugins/android-plugin/pom.xml
+++ b/components/mobile-plugins/android-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
mobile-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/pom.xml b/components/mobile-plugins/pom.xml
index 0de8bc5a9..50714635d 100644
--- a/components/mobile-plugins/pom.xml
+++ b/components/mobile-plugins/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml
index b602df5be..afb3a88c1 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml
@@ -21,7 +21,7 @@
windows-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -265,6 +265,11 @@
org.wso2.carbon.device.mgt.common
provided
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.mobile.windows
+ provided
+
org.wso2.carbon.devicemgt
org.wso2.carbon.webapp.authenticator.framework
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java
index 7a81fdd10..d6b51faba 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/BSTValidator.java
@@ -19,6 +19,7 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.common.util;
import org.apache.commons.codec.binary.Base64;
+import org.apache.http.auth.AUTH;
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.message.token.BinarySecurity;
@@ -32,6 +33,9 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.AuthenticationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.OAuthTokenValidationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
+import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import java.util.HashMap;
@@ -94,12 +98,17 @@ public class BSTValidator implements Validator {
private boolean authenticate(String binarySecurityToken, AuthenticationInfo authenticationInfo) throws
AuthenticationException {
WindowsAPIUtils.startTenantFlow(authenticationInfo);
- if (DeviceUtil.getCacheEntry(binarySecurityToken) != null) {
- CacheEntry cacheentry = (CacheEntry) DeviceUtil.getCacheEntry(binarySecurityToken);
- String username = cacheentry.getUsername();
- return username != null;
- } else {
- return false;
+ MobileCacheEntry cacheEntry;
+ try {
+ cacheEntry = DeviceUtil.getTokenEntry(binarySecurityToken);
+ if (cacheEntry != null) {
+ String username = cacheEntry.getUsername();
+ return username != null;
+ } else {
+ return false;
+ }
+ } catch (WindowsDeviceEnrolmentException e) {
+ throw new AuthenticationException("Authentication failure when fetching token entry", e);
}
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java
index b378ae8c9..51cd42b28 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/common/util/DeviceUtil.java
@@ -18,14 +18,17 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.common.util;
-import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
+import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsUtils;
-import javax.cache.Cache;
-import javax.cache.CacheConfiguration;
-import javax.cache.CacheManager;
-import javax.cache.Caching;
import java.util.UUID;
-import java.util.concurrent.TimeUnit;
/**
* Class for generate random token for XCEP and WSTEP.
@@ -36,45 +39,106 @@ public class DeviceUtil {
private static final String TOKEN_CACHE = "TOKEN_CACHE";
private static final long CACHE_DURATION = 15l;
private static boolean isContextCacheInitialized = false;
+ private static WindowsTokenService tokenService;
+
+ private static final Log log = LogFactory.getLog(DeviceUtil.class);
+
+ static {
+ try {
+ tokenService = WindowsUtils.getEnrollmentTokenService();
+ } catch (WindowsDeviceMgtPluginException e) {
+ log.error("WindowsTokenService cannot be initialized.", e);
+ }
+ }
public static String generateRandomToken() {
return String.valueOf(UUID.randomUUID());
}
- public static void persistChallengeToken(String token, String deviceID, String username) {
-
- Object objCacheEntry = getCacheEntry(token);
- CacheEntry cacheEntry;
- if (objCacheEntry == null) {
- cacheEntry = new CacheEntry();
- cacheEntry.setUsername(username);
- } else {
- cacheEntry = (CacheEntry) objCacheEntry;
- }
- if (deviceID != null) {
- cacheEntry.setDeviceID(deviceID);
+ public static void persistChallengeToken(String token, String deviceID, String username)
+ throws WindowsDeviceEnrolmentException {
+ try {
+ if(tokenService == null) {
+ tokenService = WindowsUtils.getEnrollmentTokenService();
+ }
+ MobileCacheEntry existingCacheEntry = tokenService.getCacheToken(token);
+ PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ if (existingCacheEntry == null) {
+ MobileCacheEntry newCacheEntry = new MobileCacheEntry();
+ newCacheEntry.setDeviceID(deviceID);
+ newCacheEntry.setUsername(username);
+ newCacheEntry.setCacheToken(token);
+ newCacheEntry.setTenantDomain(carbonCtx.getTenantDomain());
+ newCacheEntry.setTenanatID(carbonCtx.getTenantId());
+ tokenService.saveCacheToken(newCacheEntry);
+ } else {
+ existingCacheEntry.setDeviceID(deviceID);
+ existingCacheEntry.setCacheToken(token);
+ tokenService.updateCacheToken(existingCacheEntry);
+ }
+ } catch (MobileDeviceManagementDAOException e) {
+ String msg = "Error occured when saving cache token for device: " + deviceID;
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
+ } catch (WindowsDeviceMgtPluginException e) {
+ String msg = "Error occured when retrieving enrollment token service";
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
}
- getTokenCache().put(token.trim(), cacheEntry);
}
- public static void removeToken(String token) {
- getTokenCache().remove(token);
+ public static MobileCacheEntry getTokenEntry(String token)
+ throws WindowsDeviceEnrolmentException {
+ MobileCacheEntry tokenEntry;
+ try {
+ if (tokenService == null) {
+ tokenService = WindowsUtils.getEnrollmentTokenService();
+ }
+ tokenEntry = tokenService.getCacheToken(token);
+ } catch (WindowsDeviceMgtPluginException e) {
+ String msg = "Error occured when retrieving enrollment token service.";
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
+ } catch (MobileDeviceManagementDAOException e) {
+ String msg = "Error occured when retrieving enrollment token.";
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
+ }
+ return tokenEntry;
}
- public static Object getCacheEntry(String token) {
- return getTokenCache().get(token);
+ public static MobileCacheEntry getTokenEntryFromDeviceId(String deviceId)
+ throws WindowsDeviceEnrolmentException {
+ MobileCacheEntry tokenEntry;
+ try {
+ if (tokenService == null) {
+ tokenService = WindowsUtils.getEnrollmentTokenService();
+ }
+ tokenEntry = tokenService.getCacheTokenFromDeviceId(deviceId);
+ } catch (WindowsDeviceMgtPluginException e) {
+ String msg = "Error occured when retrieving enrollment token service.";
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
+ } catch (MobileDeviceManagementDAOException e) {
+ String msg = "Error occured when retrieving enrollment token.";
+ log.error(msg);
+ throw new WindowsDeviceEnrolmentException(msg, e);
+ }
+ return tokenEntry;
}
- private static Cache getTokenCache() {
- CacheManager contextCacheManager = Caching.getCacheManager(TOKEN_CACHE_MANAGER).
- getCache(TOKEN_CACHE).getCacheManager();
- if (!isContextCacheInitialized) {
- return Caching.getCacheManager(TOKEN_CACHE_MANAGER).getCache(TOKEN_CACHE);
- } else {
- isContextCacheInitialized = true;
- return contextCacheManager.createCacheBuilder(TOKEN_CACHE_MANAGER).setExpiry(
- CacheConfiguration.ExpiryType.MODIFIED,
- new CacheConfiguration.Duration(TimeUnit.MINUTES, CACHE_DURATION)).setStoreByValue(false).build();
+ public static void removeTokenEntry(String token) {
+ try {
+ if (tokenService == null) {
+ tokenService = WindowsUtils.getEnrollmentTokenService();
+ }
+ tokenService.removeCacheToken(token);
+ } catch (WindowsDeviceMgtPluginException e) {
+ String msg = "Error occured when retrieving enrollment token service.";
+ log.error(msg);
+ } catch (MobileDeviceManagementDAOException e) {
+ String msg = "Error occured when removing enrollment token.";
+ log.error(msg);
}
}
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java
index b8e9287e4..25f963ab3 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/operations/util/OperationHandler.java
@@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONException;
import org.json.JSONObject;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java
index d45455f0c..ee3d62c9c 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/enrollment/impl/EnrollmentServiceImpl.java
@@ -44,6 +44,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlCrede
import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.EnrollmentService;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.enrollment.beans.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.xml.sax.SAXException;
@@ -296,7 +297,7 @@ public class EnrollmentServiceImpl implements EnrollmentService {
//CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst);
// String userName = cacheEntry.getUsername();
authNameNode.setTextContent(userName);
- DeviceUtil.removeToken(headerBst);
+ DeviceUtil.removeTokenEntry(headerBst);
String password = DeviceUtil.generateRandomToken();
Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION);
NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes();
@@ -351,7 +352,12 @@ public class EnrollmentServiceImpl implements EnrollmentService {
* @return User for given token.
*/
private String getRequestedUser(String bst) {
- CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(bst);
+ MobileCacheEntry cacheEntry = null;
+ try {
+ cacheEntry = DeviceUtil.getTokenEntry(bst);
+ } catch (WindowsDeviceEnrolmentException e) {
+
+ }
return cacheEntry.getUsername();
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java
index 38dfde51d..ae0e59a9c 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/DeviceManagementServiceImpl.java
@@ -43,6 +43,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*;
import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.DeviceManagementService;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
@@ -80,14 +81,18 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlHeader.getSource().
getLocURI());
msgId = syncmlHeader.getMsgID();
+
if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) &&
(PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) {
token = syncmlHeader.getCredential().getData();
- CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token);
+ MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token);
+ DeviceUtil.persistChallengeToken(token, deviceIdentifier.getId(), user);
+ PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ carbonCtx.setTenantId(cacheToken.getTenanatID(), true);
if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) {
- if (modifyEnrollWithMoreDetail(request)) {
+ if (modifyEnrollWithMoreDetail(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) {
pendingOperations = operationHandler.getPendingOperations(syncmlDocument);
response = operationReply.generateReply(syncmlDocument, pendingOperations);
return Response.status(Response.Status.OK).entity(response).build();
@@ -102,6 +107,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
return Response.status(Response.Status.UNAUTHORIZED).entity(msg).build();
}
} else {
+ MobileCacheEntry cacheToken = DeviceUtil.getTokenEntryFromDeviceId(deviceIdentifier.getId());
+ PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ carbonCtx.setTenantId(cacheToken.getTenanatID());
if ((syncmlDocument.getBody().getAlert() != null)) {
if (!syncmlDocument.getBody().getAlert().getData().equals(Constants.DISENROLL_ALERT_DATA)) {
pendingOperations = operationHandler.getPendingOperations(syncmlDocument);
@@ -152,7 +160,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
* @throws WindowsDeviceEnrolmentException
* @throws WindowsOperationException
*/
- private boolean modifyEnrollWithMoreDetail(Document request) throws WindowsDeviceEnrolmentException,
+ private boolean modifyEnrollWithMoreDetail(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException,
WindowsOperationException {
String devMan = null;
@@ -177,6 +185,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
user = syncmlDocument.getHeader().getSource().getLocName();
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
authenticationInfo.setUsername(user);
+ authenticationInfo.setTenantId(tenantId);
+ authenticationInfo.setTenantDomain(tenantDomain);
WindowsAPIUtils.startTenantFlow(authenticationInfo);
DeviceIdentifier deviceIdentifier = convertToDeviceIdentifierObject(syncmlDocument.
getHeader().getSource().getLocURI());
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java
index 4cc2f0ac8..356035f04 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/syncml/impl/SyncmlServiceImpl.java
@@ -22,12 +22,15 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.device.mgt.common.*;
+import org.wso2.carbon.device.mgt.common.Device;
+import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
+import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
+import org.wso2.carbon.device.mgt.common.DeviceManagementException;
+import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants;
-import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlOperationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException;
@@ -35,10 +38,20 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDe
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.AuthenticationInfo;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.DeviceUtil;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.WindowsAPIUtils;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ItemTag;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.ReplaceTag;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlDocument;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.SyncmlHeader;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.WindowsOperationException;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.Constants;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.DeviceInfo;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationHandler;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.OperationReply;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlGenerator;
+import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.SyncmlParser;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.SyncmlService;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.syncml.beans.WindowsDevice;
-import org.wso2.carbon.device.mgt.mobile.windows.api.operations.*;
-import org.wso2.carbon.device.mgt.mobile.windows.api.operations.util.*;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
@@ -143,11 +156,11 @@ public class SyncmlServiceImpl implements SyncmlService {
if ((PluginConstants.SyncML.SYNCML_FIRST_MESSAGE_ID == msgId) &&
(PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId)) {
token = syncmlHeader.getCredential().getData();
- CacheEntry cacheToken = (CacheEntry) DeviceUtil.getCacheEntry(token);
+ MobileCacheEntry cacheToken = DeviceUtil.getTokenEntry(token);
if ((cacheToken.getUsername() != null) && (cacheToken.getUsername().equals(user))) {
- if (enrollDevice(request)) {
+ if (enrollDevice(request, cacheToken.getTenantDomain(), cacheToken.getTenanatID())) {
deviceInfoOperations = deviceInfo.getDeviceInfo();
response = generateReply(syncmlDocument, deviceInfoOperations);
return Response.status(Response.Status.OK).entity(response).build();
@@ -163,7 +176,8 @@ public class SyncmlServiceImpl implements SyncmlService {
}
} else if (PluginConstants.SyncML.SYNCML_SECOND_MESSAGE_ID == msgId &&
PluginConstants.SyncML.SYNCML_FIRST_SESSION_ID == sessionId) {
- if (enrollDevice(request)) {
+ PrivilegedCarbonContext carbonCtx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ if (enrollDevice(request, carbonCtx.getTenantDomain(), carbonCtx.getTenantId())) {
return Response.ok().entity(generateReply(syncmlDocument, null)).build();
} else {
String msg = "Error occurred in modify enrollment.";
@@ -223,7 +237,7 @@ public class SyncmlServiceImpl implements SyncmlService {
* @throws WindowsDeviceEnrolmentException
* @throws WindowsOperationException
*/
- private boolean enrollDevice(Document request) throws WindowsDeviceEnrolmentException,
+ private boolean enrollDevice(Document request, String tenantDomain, int tenantId) throws WindowsDeviceEnrolmentException,
WindowsOperationException {
String osVersion;
@@ -256,6 +270,8 @@ public class SyncmlServiceImpl implements SyncmlService {
user = syncmlDocument.getHeader().getSource().getLocName();
AuthenticationInfo authenticationInfo = new AuthenticationInfo();
authenticationInfo.setUsername(user);
+ authenticationInfo.setTenantDomain(tenantDomain);
+ authenticationInfo.setTenantId(tenantId);
WindowsAPIUtils.startTenantFlow(authenticationInfo);
if (log.isDebugEnabled()) {
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java
index a749214ba..f71aa52e2 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/wstep/impl/CertificateEnrollmentServiceImpl.java
@@ -26,14 +26,17 @@ import org.apache.cxf.headers.Header;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.jaxws.context.WrappedMessageContext;
import org.apache.cxf.message.Message;
-import org.w3c.dom.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.PluginConstants;
-import org.wso2.carbon.device.mgt.mobile.windows.api.common.beans.CacheEntry;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.CertificateGenerationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.SyncmlMessageFormatException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WAPProvisioningException;
@@ -46,6 +49,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.Additi
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.BinarySecurityToken;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestSecurityTokenResponse;
import org.wso2.carbon.device.mgt.mobile.windows.api.services.wstep.beans.RequestedSecurityToken;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
import org.xml.sax.SAXException;
import javax.annotation.Resource;
@@ -293,10 +297,10 @@ public class CertificateEnrollmentServiceImpl implements CertificateEnrollmentSe
Node userNameAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_USERNAME_POSITION);
NamedNodeMap appServerAttribute = userNameAuthPosition.getAttributes();
Node authNameNode = appServerAttribute.getNamedItem(PluginConstants.CertificateEnrolment.VALUE);
- CacheEntry cacheEntry = (CacheEntry) DeviceUtil.getCacheEntry(headerBst);
+ MobileCacheEntry cacheEntry = DeviceUtil.getTokenEntry(headerBst);
String userName = cacheEntry.getUsername();
authNameNode.setTextContent(cacheEntry.getUsername());
- DeviceUtil.removeToken(headerBst);
+ DeviceUtil.removeTokenEntry(headerBst);
String password = DeviceUtil.generateRandomToken();
Node passwordAuthPosition = wapParm.item(PluginConstants.CertificateEnrolment.APPAUTH_PASSWORD_POSITION);
NamedNodeMap appSrvPasswordAttribute = passwordAuthPosition.getAttributes();
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml
index 991d450c0..2d67a3c8e 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/pom.xml
@@ -23,13 +23,13 @@
windows-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.windows.ui
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Mobile Windows UI
pom
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml
index 442559498..0480bc714 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/pom.xml
@@ -22,7 +22,7 @@
windows-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -64,6 +64,7 @@
org.wso2.carbon.context,
org.wso2.carbon.utils.*,
org.wso2.carbon.device.mgt.common.*,
+ org.wso2.carbon.device.mgt.core.dao.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon.policy.mgt.common.*,
org.wso2.carbon.registry.core,
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java
new file mode 100644
index 000000000..851a108c0
--- /dev/null
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenService.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * you may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.wso2.carbon.device.mgt.mobile.windows.impl;
+
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
+
+public interface WindowsTokenService {
+ void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException;
+ void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException;
+ MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException;
+ MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException;
+ void removeCacheToken(String token) throws MobileDeviceManagementDAOException;
+}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java
new file mode 100644
index 000000000..68c40595f
--- /dev/null
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/WindowsTokenServiceImpl.java
@@ -0,0 +1,81 @@
+package org.wso2.carbon.device.mgt.mobile.windows.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.device.mgt.common.TransactionManagementException;
+import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsEnrollmentTokenDAOImpl;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
+
+public class WindowsTokenServiceImpl implements WindowsTokenService {
+
+ private static final Log log = LogFactory.getLog(WindowsTokenServiceImpl.class);
+ private static WindowsEnrollmentTokenDAO windowsEnrollmentTokenDAO;
+
+ public WindowsTokenServiceImpl() {
+ WindowsDAOFactory windowsDAOFactory = new WindowsDAOFactory();
+ windowsEnrollmentTokenDAO = new WindowsEnrollmentTokenDAOImpl();
+ }
+
+ @Override
+ public void saveCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException {
+ try {
+ WindowsDAOFactory.beginTransaction();
+ windowsEnrollmentTokenDAO.addCacheToken(entry);
+ WindowsDAOFactory.commitTransaction();
+ } finally {
+ WindowsDAOFactory.closeConnection();
+ }
+ }
+
+ @Override
+ public void updateCacheToken(MobileCacheEntry entry) throws MobileDeviceManagementDAOException {
+ try {
+ WindowsDAOFactory.beginTransaction();
+ windowsEnrollmentTokenDAO.updateCacheToken(entry);
+ WindowsDAOFactory.commitTransaction();
+ } finally {
+ WindowsDAOFactory.closeConnection();
+ }
+ }
+
+ @Override
+ public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
+ MobileCacheEntry cacheEntry = null;
+ try {
+ WindowsDAOFactory.beginTransaction();
+ cacheEntry = windowsEnrollmentTokenDAO.getCacheToken(token);
+ WindowsDAOFactory.commitTransaction();
+ } finally {
+ WindowsDAOFactory.closeConnection();
+ }
+ return cacheEntry;
+ }
+
+ @Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId)
+ throws MobileDeviceManagementDAOException {
+ MobileCacheEntry cacheEntry = null;
+ try {
+ WindowsDAOFactory.beginTransaction();
+ cacheEntry = windowsEnrollmentTokenDAO.getCacheTokenFromDeviceId(deviceId);
+ WindowsDAOFactory.commitTransaction();
+ } finally {
+ WindowsDAOFactory.closeConnection();
+ }
+ return cacheEntry;
+ }
+
+ @Override
+ public void removeCacheToken(String token) throws MobileDeviceManagementDAOException {
+ try {
+ WindowsDAOFactory.beginTransaction();
+ windowsEnrollmentTokenDAO.deleteCacheToken(token);
+ WindowsDAOFactory.commitTransaction();
+ } finally {
+ WindowsDAOFactory.closeConnection();
+ }
+ }
+}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java
index 6bbdf572f..760a8a5fd 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsDAOFactory.java
@@ -21,9 +21,13 @@ package org.wso2.carbon.device.mgt.mobile.windows.impl.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
+import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsDeviceDAOImpl;
import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl.WindowsFeatureDAOImpl;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
@@ -35,7 +39,18 @@ public class WindowsDAOFactory extends AbstractMobileDeviceManagementDAOFactory
private static ThreadLocal currentConnection = new ThreadLocal<>();
public WindowsDAOFactory() {
- this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
+// this.dataSource = getDataSourceMap().get(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
+ String dataSourceName = "jdbc/MobileWindowsDM_DS";
+ initDAO(dataSourceName);
+ }
+
+ public void initDAO(String datasourceName) {
+ try {
+ Context ctx = new InitialContext();
+ dataSource = (DataSource) ctx.lookup(datasourceName);
+ } catch (NamingException e) {
+
+ }
}
@Override
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java
new file mode 100644
index 000000000..9ab0a2b73
--- /dev/null
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/WindowsEnrollmentTokenDAO.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * you may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.wso2.carbon.device.mgt.mobile.windows.impl.dao;
+
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
+
+public interface WindowsEnrollmentTokenDAO {
+
+ MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException;
+
+ MobileCacheEntry getCacheTokenFromDeviceId(String deviceId) throws MobileDeviceManagementDAOException;
+
+ boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException;
+
+ boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException;
+
+ boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException;
+}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java
new file mode 100644
index 000000000..338818e79
--- /dev/null
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dao/impl/WindowsEnrollmentTokenDAOImpl.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * you may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.wso2.carbon.device.mgt.mobile.windows.impl.dao.impl;
+
+import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.MobileDeviceManagementDAOException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsDAOFactory;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.WindowsEnrollmentTokenDAO;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dao.util.MobileDeviceManagementDAOUtil;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.dto.MobileCacheEntry;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.util.WindowsPluginConstants;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public class WindowsEnrollmentTokenDAOImpl implements WindowsEnrollmentTokenDAO {
+
+ public WindowsEnrollmentTokenDAOImpl() {
+ }
+
+ @Override
+ public MobileCacheEntry getCacheToken(String token) throws MobileDeviceManagementDAOException {
+ Connection conn;
+ PreparedStatement stmt = null;
+ ResultSet rs = null;
+ MobileCacheEntry cacheEntry = null;
+ try {
+ conn = WindowsDAOFactory.getConnection();
+ String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " +
+ "FROM WINDOWS_ENROLLMENT_TOKEN WHERE ENROLLMENT_TOKEN = ?";
+ stmt = conn.prepareStatement(selectDBQuery);
+ stmt.setString(1, token);
+ rs = stmt.executeQuery();
+
+ while (rs.next()) {
+ cacheEntry = new MobileCacheEntry();
+ cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID));
+ cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN));
+ cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID));
+ cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME));
+ cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP));
+ }
+ } catch (SQLException e) {
+ throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" +
+ token + "' from the Windows db.", e);
+ }
+ return cacheEntry;
+ }
+
+ @Override public MobileCacheEntry getCacheTokenFromDeviceId(String deviceId)
+ throws MobileDeviceManagementDAOException {
+ Connection conn;
+ PreparedStatement stmt = null;
+ ResultSet rs = null;
+ MobileCacheEntry cacheEntry = null;
+ try {
+ conn = WindowsDAOFactory.getConnection();
+ String selectDBQuery = "SELECT TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, USERNAME, OWNERSHIP " +
+ "FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?";
+ stmt = conn.prepareStatement(selectDBQuery);
+ stmt.setString(1, deviceId);
+ rs = stmt.executeQuery();
+
+ while (rs.next()) {
+ cacheEntry = new MobileCacheEntry();
+ cacheEntry.setDeviceID(rs.getString(WindowsPluginConstants.DEVICE_ID));
+ cacheEntry.setTenantDomain(rs.getString(WindowsPluginConstants.TENANT_DOMAIN));
+ cacheEntry.setTenanatID(rs.getInt(WindowsPluginConstants.TENANT_ID));
+ cacheEntry.setUsername(rs.getString(WindowsPluginConstants.USER_NAME));
+ cacheEntry.setOwnership(rs.getString(WindowsPluginConstants.OWNERSHIP));
+ }
+ } catch (SQLException e) {
+ throw new MobileDeviceManagementDAOException("Error occurred while fetching the Windows device token for the enrollment token '" +
+ deviceId + "' from the Windows db.", e);
+ }
+ return cacheEntry;
+ }
+
+ @Override
+ public boolean addCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException {
+ boolean status = false;
+ Connection conn;
+ PreparedStatement stmt = null;
+ try {
+ conn = WindowsDAOFactory.getConnection();
+ String sql = "INSERT INTO WINDOWS_ENROLLMENT_TOKEN(TENANT_DOMAIN, TENANT_ID, ENROLLMENT_TOKEN, DEVICE_ID, "
+ + "USERNAME, OWNERSHIP) VALUES (?, ?, ?, ?, ?, ?)";
+ stmt = conn.prepareStatement(sql);
+ stmt.setString(1, cacheEntry.getTenantDomain());
+ stmt.setInt(2, cacheEntry.getTenanatID());
+ stmt.setString(3, cacheEntry.getCacheToken());
+ stmt.setString(4, cacheEntry.getDeviceID());
+ stmt.setString(5, cacheEntry.getUsername());
+ stmt.setString(6, cacheEntry.getOwnership());
+ int rows = stmt.executeUpdate();
+ if(rows > 0) {
+ status = true;
+ }
+ } catch (SQLException e) {
+ throw new MobileDeviceManagementDAOException("Error occurred while adding the Windows device enrollment token for'" +
+ cacheEntry.getDeviceID() + "' to the Windows db.", e);
+ } finally {
+ MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
+ }
+ return status;
+ }
+
+ @Override
+ public boolean updateCacheToken(MobileCacheEntry cacheEntry) throws MobileDeviceManagementDAOException {
+ boolean status = false;
+ Connection conn;
+ PreparedStatement stmt = null;
+ try {
+ conn = WindowsDAOFactory.getConnection();
+ String updateDBQuery =
+ "UPDATE WINDOWS_ENROLLMENT_TOKEN SET TENANT_DOMAIN = ?, TENANT_ID = ?, ENROLLMENT_TOKEN = ?, USERNAME = ?, " +
+ "DEVICE_ID = ? WHERE ENROLLMENT_TOKEN = ?";
+ stmt = conn.prepareStatement(updateDBQuery);
+ stmt.setString(1, cacheEntry.getTenantDomain());
+ stmt.setInt(2, cacheEntry.getTenanatID());
+ stmt.setString(3, cacheEntry.getCacheToken());
+ stmt.setString(4, cacheEntry.getUsername());
+ stmt.setString(5, cacheEntry.getDeviceID());
+ stmt.setString(6, cacheEntry.getCacheToken());
+ int rows = stmt.executeUpdate();
+ if(rows > 0) {
+ status = true;
+ }
+ } catch (SQLException e) {
+ throw new MobileDeviceManagementDAOException("Error occurred while updating the Windows device enrollment token for'" +
+ cacheEntry.getDeviceID() + "' to the Windows db.", e);
+ } finally {
+ MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
+ }
+ return status;
+ }
+
+ @Override
+ public boolean deleteCacheToken(String mobileDeviceId) throws MobileDeviceManagementDAOException {
+ boolean status = false;
+ Connection conn;
+ PreparedStatement stmt = null;
+ try {
+ conn = WindowsDAOFactory.getConnection();
+ String deleteDBQuery = "DELETE FROM WINDOWS_ENROLLMENT_TOKEN WHERE DEVICE_ID = ?";
+ stmt = conn.prepareStatement(deleteDBQuery);
+ stmt.setString(1, mobileDeviceId);
+ int rows = stmt.executeUpdate();
+ if (rows > 0) {
+ status = true;
+ }
+ } catch (SQLException e) {
+ throw new MobileDeviceManagementDAOException("Error occurred while deleting windows device '" +
+ mobileDeviceId + "'", e);
+ } finally {
+ MobileDeviceManagementDAOUtil.cleanupResources(stmt, null);
+ }
+ return status;
+ }
+}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java
new file mode 100644
index 000000000..6c138ec0a
--- /dev/null
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/dto/MobileCacheEntry.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * you may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.wso2.carbon.device.mgt.mobile.windows.impl.dto;
+
+public class MobileCacheEntry {
+
+ private String cacheToken;
+ private String tenantDomain;
+ private int tenanatID;
+ private String deviceID;
+ private String username;
+ private String ownership;
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public void setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ }
+
+ public int getTenanatID() {
+ return tenanatID;
+ }
+
+ public void setTenanatID(int tenanatID) {
+ this.tenanatID = tenanatID;
+ }
+
+ public String getCacheToken() {
+ return cacheToken;
+ }
+
+ public void setCacheToken(String cacheToken) {
+ this.cacheToken = cacheToken;
+ }
+
+ public String getDeviceID() {
+ return deviceID;
+ }
+
+ public void setDeviceID(String deviceID) {
+ this.deviceID = deviceID;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getOwnership() {
+ return ownership;
+ }
+
+ public void setOwnership(String ownership) {
+ this.ownership = ownership;
+ }
+}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java
index d7d516b8d..a243cc9c4 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsPluginConstants.java
@@ -52,5 +52,10 @@ public class WindowsPluginConstants {
public static final String LANGUAGE_CODE_ENGLISH_US = "en_US";
public static final String LANGUAGE_CODE_ENGLISH_UK = "en_UK";
+ //properties related to WINDOWS_ENROLLMENT_TOKEN table
+ public static final String TENANT_DOMAIN = "TENANT_DOMAIN";
+ public static final String TENANT_ID = "TENANT_ID";
+ public static final String USER_NAME = "USERNAME";
+ public static final String OWNERSHIP = "OWNERSHIP";
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java
index 7fba2f5ca..994500f89 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/impl/util/WindowsUtils.java
@@ -18,6 +18,10 @@
package org.wso2.carbon.device.mgt.mobile.windows.impl.util;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.device.mgt.mobile.windows.exception.WindowsDeviceMgtPluginException;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
+
import java.util.Map;
/**
@@ -32,4 +36,17 @@ public class WindowsUtils {
}
return deviceProperty;
}
+
+ public static WindowsTokenService getEnrollmentTokenService() throws WindowsDeviceMgtPluginException {
+
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ WindowsTokenService tokenService = (WindowsTokenService)
+ ctx.getOSGiService(WindowsTokenService.class, null);
+
+ if(tokenService == null) {
+ String msg = "WindowsTokenService is not initialized";
+ throw new WindowsDeviceMgtPluginException(msg);
+ }
+ return tokenService;
+ }
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java
index 600aecc1c..dd2ef82f1 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementDataHolder.java
@@ -18,6 +18,7 @@
package org.wso2.carbon.device.mgt.mobile.windows.internal;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
import org.wso2.carbon.registry.core.service.RegistryService;
/**
@@ -26,6 +27,7 @@ import org.wso2.carbon.registry.core.service.RegistryService;
public class WindowsDeviceManagementDataHolder {
private RegistryService registryService;
+ private WindowsTokenService tokenService;
private static WindowsDeviceManagementDataHolder thisInstance = new WindowsDeviceManagementDataHolder();
@@ -44,4 +46,19 @@ public class WindowsDeviceManagementDataHolder {
this.registryService = registryService;
}
+ public WindowsTokenService getTokenService() {
+ return tokenService;
+ }
+
+ public void setTokenService(WindowsTokenService tokenService) {
+ this.tokenService = tokenService;
+ }
+
+ public static WindowsDeviceManagementDataHolder getThisInstance() {
+ return thisInstance;
+ }
+
+ public static void setThisInstance(WindowsDeviceManagementDataHolder thisInstance) {
+ WindowsDeviceManagementDataHolder.thisInstance = thisInstance;
+ }
}
diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java
index fd1e661d3..93926a93d 100644
--- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java
+++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/internal/WindowsDeviceManagementServiceComponent.java
@@ -23,6 +23,8 @@ import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenService;
+import org.wso2.carbon.device.mgt.mobile.windows.impl.WindowsTokenServiceImpl;
import org.wso2.carbon.ndatasource.core.DataSourceService;
import org.wso2.carbon.registry.core.service.RegistryService;
@@ -65,6 +67,8 @@ public class WindowsDeviceManagementServiceComponent {
// bundleContext.registerService(PolicyMonitoringManager.class,
// new WindowsPolicyMonitoringManager(), null);
+ //Enrollment token service
+ bundleContext.registerService(WindowsTokenService.class, new WindowsTokenServiceImpl(), null);
if (log.isDebugEnabled()) {
log.debug("Android Mobile Device Management Service Component has been successfully activated");
@@ -114,4 +118,18 @@ public class WindowsDeviceManagementServiceComponent {
WindowsDeviceManagementDataHolder.getInstance().setRegistryService(null);
}
+ protected void setEnrollmentTokenService(WindowsTokenService service) {
+ if (log.isDebugEnabled()) {
+ log.debug("Setting windows enrollment token service provider");
+ }
+ WindowsDeviceManagementDataHolder.getInstance().setTokenService(service);
+ }
+
+ protected void unsetEnrollmentTokenService() {
+ if (log.isDebugEnabled()) {
+ log.debug("Removing windows enrollment token service provider");
+ }
+ WindowsDeviceManagementDataHolder.getInstance().setTokenService(null);
+ }
+
}
diff --git a/components/mobile-plugins/windows-plugin/pom.xml b/components/mobile-plugins/windows-plugin/pom.xml
index fac36bcbd..350f931fe 100644
--- a/components/mobile-plugins/windows-plugin/pom.xml
+++ b/components/mobile-plugins/windows-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
mobile-plugins
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml
index 05105447e..43001ca38 100644
--- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml
+++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
analytics-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf
index bc0253690..7e6390384 100644
--- a/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf
+++ b/features/analytics-feature/org.wso2.carbon.device.mgt.cdmf.analytics.feature/src/main/resources/p2.inf
@@ -1,4 +1,9 @@
- instructions.configure = \
+instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.cdmf.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/device_management/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\
+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.cdmf.analytics_${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.cdmf.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/device_management/,overwrite:true);\
\ No newline at end of file
diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml
index 03c2d26a5..778ba2872 100644
--- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml
+++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/pom.xml
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt-plugins
analytics-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.iot.analytics.feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - IoT Server Analytics Feature
http://wso2.org
diff --git a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf
index 09b6b2ec9..ffbc1a492 100644
--- a/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf
+++ b/features/analytics-feature/org.wso2.carbon.device.mgt.iot.analytics.feature/src/main/resources/p2.inf
@@ -1,4 +1,9 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\
+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.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\
+
+
diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml
index 5e2f9f83d..1178975dd 100644
--- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml
+++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt-plugins
analytics-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.iot.device.statistics.dashboard.feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - IoT Server Analytics Feature
http://wso2.org
diff --git a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf
index 2c241844c..ecee1af16 100644
--- a/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf
+++ b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/src/main/resources/p2.inf
@@ -1,4 +1,9 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/device_management/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/);\
+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.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/device_management/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.iot.device.statistics.dashboard_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,overwrite:true);\
\ No newline at end of file
diff --git a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml
index 81e97a623..433490e40 100644
--- a/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml
+++ b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
analytics-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/analytics-feature/pom.xml b/features/analytics-feature/pom.xml
index 127ae2631..f328795a8 100644
--- a/features/analytics-feature/pom.xml
+++ b/features/analytics-feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml
new file mode 100644
index 000000000..96c0145a2
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/pom.xml
@@ -0,0 +1,167 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ androidsense-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature
+ 3.0.37-SNAPSHOT
+ pom
+ WSO2 Carbon - IoT Server Android Sense Analytics Feature
+ http://wso2.org
+ This feature contains the Android Sense Device type specific analytics implementations for the IoT Server
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.androidsense.analytics
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+ unpack-analytics
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+ unpack-geo
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.iot.geo.dashboard
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.androidsense.analytics
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/build.properties
similarity index 100%
rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/build.properties
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/build.properties
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..f5a9c3dcc
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/p2.inf
@@ -0,0 +1,8 @@
+instructions.configure = \
+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.analytics_${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.analytics_${feature.version}/receiver/,target:${installFolder}/../../deployment/server/eventreceivers/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.analytics_${feature.version}/streams/,target:${installFolder}/../../deployment/server/eventstreams/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/carbonapps/android_sense.car);\
\ No newline at end of file
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml
similarity index 60%
rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml
index 5f7a73ce5..727aea028 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/artifact.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/receiver/android_sense_receiver-carbon.super.xml
@@ -17,6 +17,11 @@
~ under the License.
-->
-
- android_sense_receiver.xml
-
+
+
+ carbon.super/android_sense/+/data
+ android_sense_receiver-carbon.super
+
+
+
+
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json
old mode 100755
new mode 100644
similarity index 99%
rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json
index 878b4b63d..e69eb2fc0
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/org.wso2.iot.android.sense_1.0.0.json
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json
@@ -60,4 +60,4 @@
{"name": "data_sent", "type": "LONG"},
{"name": "data_received", "type": "LONG"}
]
-}
+}
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
similarity index 56%
rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
index deaa745a0..9a16d3637 100644
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/pom.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
@@ -23,17 +23,17 @@
org.wso2.carbon.devicemgt-plugins
androidsense-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
- org.wso2.carbon.device.mgt.iot.androidsense.feature
- 3.0.24-SNAPSHOT
+ org.wso2.carbon.device.mgt.iot.androidsense.backend.feature
+ 3.0.37-SNAPSHOT
pom
- WSO2 Carbon - IoT Server Android Sense Feature
+ WSO2 Carbon - IoT Server Android Sense Backend Feature
http://wso2.org
- This feature contains the Android Sense Device type specific implementations for the IoT Server
+ This feature contains the Android Sense Device type specific backend implementations for the IoT Server
@@ -42,6 +42,10 @@
org.wso2.carbon.device.mgt.iot.androidsense.api
war
+
+ com.h2database.wso2
+ h2-database-engine
+
@@ -76,40 +80,54 @@
maven-dependency-plugin
- unpack
+ copy-jaxrs-war
package
- unpack
+ copy
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.androidsense.analytics
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/carbonapps
-
- **/*
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.androidsense.ui
-
- ${project.version}
- zip
+ org.wso2.carbon.device.mgt.iot.androidsense.api
+ war
true
-
- ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
-
- **/*
+ ${project.build.directory}/maven-shared-archive-resources/webapps/
+ android_sense.war
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.androidsense.analytics
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
unpack-analytics
package
@@ -154,62 +172,8 @@
-
- copy-jaxrs-war
- package
-
- copy
-
-
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.androidsense.api
- war
- true
- ${project.build.directory}/maven-shared-archive-resources/webapps/
- android_sense.war
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
-
- create-android-sense-plugin-mgt-schema
- package
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
org.wso2.maven
@@ -223,7 +187,7 @@
p2-feature-gen
- org.wso2.carbon.device.mgt.iot.androidsense
+ org.wso2.carbon.device.mgt.iot.androidsense.backend
../../../features/etc/feature.properties
@@ -231,15 +195,6 @@
org.eclipse.equinox.p2.type.group:true
-
- org.wso2.carbon.core.server:${carbon.kernel.version}
- org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
-
-
-
- org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version}
-
-
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..93c4b1070
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml
similarity index 86%
rename from features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml
index 764aa311a..9699c5699 100644
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/devicetypes/android_sense.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/devicetypes/android_sense.xml
@@ -54,12 +54,6 @@
true
-
-
- androidsense.mqtt.adapter
- 0
- true
-
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..28b42a4e8
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/p2.inf
@@ -0,0 +1,17 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/android_sense/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/receiver/,target:${installFolder}/../../resources/devicetypes/android_sense/receiver/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/streams/,target:${installFolder}/../../resources/devicetypes/android_sense/streams/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.backend_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android_sense/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/android_sense.war);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/android_sense);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/devicetypes/android_sense.xml);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../resources/devicetypes/android_sense);\
\ No newline at end of file
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml
similarity index 80%
rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml
rename to features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml
index 706610654..3faeedaf0 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_receiver/android_sense_receiver.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/receiver/android_sense_receiver.xml
@@ -17,13 +17,11 @@
~ under the License.
-->
-
+
${tenant-domain}/android_sense/+/data
- iot-mqtt
- true
+ android_sense_receiver-${tenant-domain}
-
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json
new file mode 100644
index 000000000..e69eb2fc0
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/src/main/resources/streams/org.wso2.iot.android.sense_1.0.0.json
@@ -0,0 +1,63 @@
+{
+ "name": "org.wso2.iot.android.sense",
+ "version": "1.0.0",
+ "nickName": "android_sense_stream",
+ "description": "This hold the device type stream of android sense",
+ "metaData": [
+ {"name": "owner", "type": "STRING"},
+ {"name": "deviceId", "type": "STRING"},
+ {"name": "type", "type": "STRING"},
+ {"name": "timestamp", "type": "LONG"}
+ ],
+ "payloadData": [
+ {"name": "battery", "type": "INT"},
+ {"name": "battery_state", "type": "STRING"},
+ {"name": "battery_status", "type": "STRING"},
+ {"name": "battery_temperature", "type": "INT"},
+ {"name": "gps_lat", "type": "DOUBLE"},
+ {"name": "gps_long", "type": "DOUBLE"},
+ {"name": "accelerometer_x", "type": "FLOAT"},
+ {"name": "accelerometer_y", "type": "FLOAT"},
+ {"name": "accelerometer_z", "type": "FLOAT"},
+ {"name": "speed_limit", "type": "FLOAT"},
+ {"name": "turn_way", "type": "STRING"},
+ {"name": "magnetic_x", "type": "FLOAT"},
+ {"name": "magnetic_y", "type": "FLOAT"},
+ {"name": "magnetic_z", "type": "FLOAT"},
+ {"name": "gyroscope_x", "type": "FLOAT"},
+ {"name": "gyroscope_y", "type": "FLOAT"},
+ {"name": "gyroscope_z", "type": "FLOAT"},
+ {"name": "light", "type": "FLOAT"},
+ {"name": "pressure", "type": "FLOAT"},
+ {"name": "proximity", "type": "FLOAT"},
+ {"name": "gravity_x", "type": "FLOAT"},
+ {"name": "gravity_y", "type": "FLOAT"},
+ {"name": "gravity_z", "type": "FLOAT"},
+ {"name": "rotation_x", "type": "FLOAT"},
+ {"name": "rotation_y", "type": "FLOAT"},
+ {"name": "rotation_z", "type": "FLOAT"},
+ {"name": "word", "type": "STRING"},
+ {"name": "word_sessionId", "type": "STRING"},
+ {"name": "word_status", "type": "STRING"},
+ {"name": "beacon_major", "type": "INT"},
+ {"name": "beacon_minor", "type": "INT"},
+ {"name": "beacon_proximity", "type": "STRING"},
+ {"name": "beacon_uuid", "type": "INT"},
+ {"name": "call_number", "type": "STRING"},
+ {"name": "call_type", "type": "STRING"},
+ {"name": "call_start_time", "type": "LONG"},
+ {"name": "call_end_time", "type": "LONG"},
+ {"name": "screen_state", "type": "STRING"},
+ {"name": "audio_playing", "type": "BOOL"},
+ {"name": "headset_on", "type": "BOOL"},
+ {"name": "music_volume", "type": "INT"},
+ {"name": "activity_type", "type": "INT"},
+ {"name": "confidence", "type": "INT"},
+ {"name": "sms_number", "type": "STRING"},
+ {"name": "application_name", "type": "STRING"},
+ {"name": "action", "type": "STRING"},
+ {"name": "data_type", "type": "STRING"},
+ {"name": "data_sent", "type": "LONG"},
+ {"name": "data_received", "type": "LONG"}
+ ]
+}
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml
deleted file mode 100644
index 9a1374b09..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/datasources/androidsense-datasources.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader
-
-
-
- AndroidSenseDM_DB
- The datasource used for the Android Sense database
-
- jdbc/AndroidSenseDM_DB
-
-
-
- jdbc:h2:repository/database/AndroidSenseDM_DB;DB_CLOSE_ON_EXIT=FALSE
-
- wso2carbon
- wso2carbon
- org.h2.Driver
- 50
- 60000
- true
- SELECT 1
- 30000
-
-
-
-
-
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql
deleted file mode 100644
index ee3bfa73a..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/h2.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `ANDROID_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `ANDROID_SENSE_DEVICE` (
- `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`ANDROID_DEVICE_ID`) );
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql
deleted file mode 100644
index cf677ff07..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mssql.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `ANDROID_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS ANDROID_SENSE_DEVICE (
- ANDROID_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (ANDROID_DEVICE_ID) );
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql
deleted file mode 100644
index 4637b4daf..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/mysql.sql
+++ /dev/null
@@ -1,12 +0,0 @@
--- -----------------------------------------------------
--- Table `ANDROID_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `ANDROID_SENSE_DEVICE` (
- `ANDROID_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`ANDROID_DEVICE_ID`) )
-ENGINE = InnoDB;
-
-
-
-
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql
deleted file mode 100644
index 6f8537eb8..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/oracle.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `ANDROID_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE ANDROID_SENSE_DEVICE (
- ANDROID_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (ANDROID_DEVICE_ID) );
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql
deleted file mode 100644
index 987f4992b..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/dbscripts/postgresql.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `ANDROID_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS ANDROID_SENSE_DEVICE (
- ANDROID_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (ANDROID_DEVICE_ID));
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf
deleted file mode 100644
index ef478b729..000000000
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.feature/src/main/resources/p2.inf
+++ /dev/null
@@ -1,31 +0,0 @@
-instructions.configure = \
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/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}/../../../repository/resources/devicetypes/,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.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}/../../../repository/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}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
-
-instructions.unconfigure = \
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/android_sense.war);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/android_sense);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/android_sense);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/android_sense);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/androidsense-datasources.xml);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/AndroidSenseDM_DB.h2.db);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.realtime.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/android_sense.car);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/android_sense.xml);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/android_sense.car);\
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml
new file mode 100644
index 000000000..011dede1e
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/pom.xml
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ androidsense-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.androidsense.ui.feature
+ 3.0.37-SNAPSHOT
+ pom
+ WSO2 Carbon - IoT Server Android Sense UI Feature
+ http://wso2.org
+ This feature contains the Android Sense Device type UI specific implementations for the IoT Server
+
+
+
+
+ com.h2database.wso2
+ h2-database-engine
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.androidsense.ui
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.androidsense.ui
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..93c4b1070
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml
new file mode 100644
index 000000000..9699c5699
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/devicetypes/android_sense.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+ Add Keywords
+ Send keywords to the device
+
+
+
+
+
+
+
+ Add Threshold
+ Send Threshold to the device
+
+
+
+
+
+
+
+ Remove words
+ Remove Threshold from the device
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+ true
+
+
+
+ en_US
+ 1.0.0
+ This is license text
+
+
+
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..5f2ce03b3
--- /dev/null
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.ui.feature/src/main/resources/p2.inf
@@ -0,0 +1,12 @@
+instructions.configure = \
+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.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.androidsense.ui_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.device-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.type-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.platform.configuration);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android_sense.realtime.analytics-view);\
\ No newline at end of file
diff --git a/features/device-types-feature/androidsense-plugin-feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/pom.xml
index 2ea12c433..efec4feec 100644
--- a/features/device-types-feature/androidsense-plugin-feature/pom.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -33,7 +33,9 @@
http://wso2.org
- org.wso2.carbon.device.mgt.iot.androidsense.feature
+ org.wso2.carbon.device.mgt.iot.androidsense.ui.feature
+ org.wso2.carbon.device.mgt.iot.androidsense.backend.feature
+ org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml
new file mode 100644
index 000000000..48f89f95d
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/pom.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ arduino-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.arduino.analytics.feature
+ pom
+ WSO2 Carbon - IoT Server Arduino Analytics Feature
+ http://wso2.org
+ This feature contains the Arduino Device type specific anaytics implementations for the IoT Server
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.arduino.analytics
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+ unpack-analytics
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.arduino.analytics
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/build.properties
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/build.properties
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/build.properties
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..3e136c2e5
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.analytics.feature/src/main/resources/p2.inf
@@ -0,0 +1,6 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/arduino.car);\
\ No newline at end of file
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
similarity index 74%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
index 1b7e3c893..a2efd5675 100644
--- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/pom.xml
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
@@ -23,16 +23,16 @@
org.wso2.carbon.devicemgt-plugins
arduino-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
- org.wso2.carbon.device.mgt.iot.arduino.feature
+ org.wso2.carbon.device.mgt.iot.arduino.backend.feature
pom
- WSO2 Carbon - IoT Server Arduino Feature
+ WSO2 Carbon - IoT Server Arduino Backend Feature
http://wso2.org
- This feature contains the Arduino Device type specific implementations for the IoT Server
+ This feature contains the Arduino Device type backend specific implementations for the IoT Server
@@ -78,43 +78,36 @@
org.apache.maven.plugins
maven-dependency-plugin
-
- unpack
- package
-
- unpack
-
-
-
+
+ copy-jaxrs-war
+ package
+
+ copy
+
+
+
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.arduino.analytics
+ org.wso2.carbon.device.mgt.iot.arduino.api
- ${project.version}
- zip
+ war
true
-
- ${project.build.directory}/maven-shared-archive-resources/carbonapps
-
- **/*
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.arduino.ui
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
+ ${project.build.directory}/maven-shared-archive-resources/webapps/
- **/*
-
-
-
-
+ arduino.war
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
- unpack-analytics
+ unpack
package
unpack
@@ -123,7 +116,8 @@
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.analytics
+ org.wso2.carbon.device.mgt.iot.arduino.analytics
+
${project.version}
zip
true
@@ -136,28 +130,30 @@
- copy-jaxrs-war
+ unpack-analytics
package
- copy
+ unpack
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.arduino.api
-
- war
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
true
- ${project.build.directory}/maven-shared-archive-resources/webapps/
-
- arduino.war
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
org.wso2.maven
carbon-p2-plugin
@@ -170,7 +166,7 @@
p2-feature-gen
- org.wso2.carbon.device.mgt.iot.arduino
+ org.wso2.carbon.device.mgt.iot.arduino.backend
../../../features/etc/feature.properties
@@ -184,16 +180,10 @@
org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
-
-
- org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version}
-
-
-
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.h b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.h
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.h
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.h
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.ino
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/ArduinoBoardSketch.ino
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/ArduinoBoardSketch.ino
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/Connect.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/Connect.ino
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/Connect.ino
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/Connect.ino
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PollServer.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PollServer.ino
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PollServer.ino
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PollServer.ino
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PushData.ino b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PushData.ino
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/PushData.ino
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/PushData.ino
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/deviceType.png b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/deviceType.png
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/deviceType.png
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/deviceType.png
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/sketch.properties
similarity index 100%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/agent/sketch.properties
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/agent/sketch.properties
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/build.properties
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/build.properties
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/build.properties
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml
similarity index 94%
rename from features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml
index 7871e1d42..c651c04e7 100644
--- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/devicetypes/arduino.xml
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/devicetypes/arduino.xml
@@ -31,7 +31,7 @@
- false
+ true
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..2d9b5bc71
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/src/main/resources/p2.inf
@@ -0,0 +1,18 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/arduino/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/arduino/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.backend_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/arduino/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino.war);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/arduino);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/arduino.car);\
\ No newline at end of file
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf
deleted file mode 100644
index 081d93a64..000000000
--- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.feature/src/main/resources/p2.inf
+++ /dev/null
@@ -1,26 +0,0 @@
-instructions.configure = \
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/arduino/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/arduino/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/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}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
-
-instructions.unconfigure = \
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino.war);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/arduino);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/arduino);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/arduino.car);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\
\ No newline at end of file
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml
new file mode 100644
index 000000000..d07ae95d8
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/pom.xml
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ arduino-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.arduino.ui.feature
+ pom
+ WSO2 Carbon - IoT Server Arduino UI Feature
+ http://wso2.org
+ This feature contains the Arduino Device type UI specific implementations for the IoT Server
+
+
+
+
+ com.h2database.wso2
+ h2-database-engine
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.arduino.ui
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
+
+ **/*
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.arduino.ui
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+ org.wso2.carbon.core.server:${carbon.kernel.version}
+
+ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/build.properties b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/build.properties
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/build.properties
rename to features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/build.properties
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml
new file mode 100644
index 000000000..c651c04e7
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/devicetypes/arduino.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+ Control Bulb
+ Control Bulb on Arduino Uno
+
+
+ state
+
+
+
+
+
+
+ true
+
+
+
+ en_US
+ 1.0.0
+ This is license text
+
+
+
\ No newline at end of file
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..3ca2ec090
--- /dev/null
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.ui.feature/src/main/resources/p2.inf
@@ -0,0 +1,13 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.arduino.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.device-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.type-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.realtime.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.arduino.platform.configuration);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/arduino.xml);\
\ No newline at end of file
diff --git a/features/device-types-feature/arduino-plugin-feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/pom.xml
index af2189771..a4ac935a5 100644
--- a/features/device-types-feature/arduino-plugin-feature/pom.xml
+++ b/features/device-types-feature/arduino-plugin-feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -33,7 +33,9 @@
http://wso2.org
- org.wso2.carbon.device.mgt.iot.arduino.feature
+ org.wso2.carbon.device.mgt.iot.arduino.ui.feature
+ org.wso2.carbon.device.mgt.iot.arduino.backend.feature
+ org.wso2.carbon.device.mgt.iot.arduino.analytics.feature
diff --git a/features/device-types-feature/pom.xml b/features/device-types-feature/pom.xml
index 5af6fd5f5..06d7f09f8 100644
--- a/features/device-types-feature/pom.xml
+++ b/features/device-types-feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
device-types-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - Device Management IoT Plugins Feature
http://wso2.org
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml
new file mode 100644
index 000000000..59a8a7d56
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/pom.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ raspberrypi-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature
+ pom
+ WSO2 Carbon - IoT Server RaspberryPi Analytics Feature
+ http://wso2.org
+ This feature contains the RaspberryPi Device type specific analytics implementations for the IoT Server
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.raspberrypi.analytics
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+ unpack-analytics
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.raspberrypi.analytics
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..e37b5655c
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/p2.inf
@@ -0,0 +1,5 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/receiver/,target:${installFolder}/../../analytics/repository/deployment/server/eventreceivers/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics_${feature.version}/streams/,target:${installFolder}/../../analytics/repository/deployment/server/eventstreams/,overwrite:true);\
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml
similarity index 60%
rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml
index c9779c693..0d8b2fd7a 100644
--- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/artifact.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/receiver/raspberrypi_receiver-carbon.super.xml
@@ -16,8 +16,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-
- org.wso2.iot.raspberrypi_1.0.0.json
-
-
+
+
+ carbon.super/raspberrypi/+/temperature
+ raspberrypi_receiver-carbon.super
+
+
+
+
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/org.wso2.iot.raspberrypi_1.0.0.json b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json
similarity index 100%
rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_stream/org.wso2.iot.raspberrypi_1.0.0.json
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
similarity index 65%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
index c1d2e98e7..b058dbc68 100644
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/pom.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
@@ -23,16 +23,16 @@
org.wso2.carbon.devicemgt-plugins
raspberrypi-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
- org.wso2.carbon.device.mgt.iot.raspberrypi.feature
+ org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature
pom
- WSO2 Carbon - IoT Server RaspberryPi Feature
+ WSO2 Carbon - IoT Server RaspberryPi Backend Feature
http://wso2.org
- This feature contains the RaspberryPi Device type specific implementations for the IoT Server
+ This feature contains the RaspberryPi Device type specific backend implementations for the IoT Server
@@ -78,41 +78,6 @@
org.apache.maven.plugins
maven-dependency-plugin
-
- unpack
- package
-
- unpack
-
-
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.raspberrypi.analytics
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/carbonapps
-
- **/*
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.raspberrypi.ui
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
-
- **/*
-
-
-
-
copy-jaxrs-war
package
@@ -133,8 +98,15 @@
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
- unpack-analytics
+ unpack
package
unpack
@@ -143,7 +115,8 @@
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.analytics
+ org.wso2.carbon.device.mgt.iot.raspberrypi.analytics
+
${project.version}
zip
true
@@ -155,39 +128,26 @@
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- create-raspberrypi-plugin-mgt-schema
+ unpack-analytics
package
- run
+ unpack
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
@@ -205,7 +165,7 @@
p2-feature-gen
- org.wso2.carbon.device.mgt.iot.raspberrypi
+ org.wso2.carbon.device.mgt.iot.raspberrypi.backend
../../../features/etc/feature.properties
@@ -219,11 +179,6 @@
org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
-
-
- org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version}
-
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/Adafruit_Python_DHT.zip b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/Adafruit_Python_DHT.zip
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/Adafruit_Python_DHT.zip
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/Adafruit_Python_DHT.zip
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/README.md b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/README.md
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/README.md
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/README.md
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/RaspberryService.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/RaspberryService.sh
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/RaspberryService.sh
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/RaspberryService.sh
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/deviceConfig.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/deviceConfig.properties
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/deviceConfig.properties
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/deviceConfig.properties
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/org.eclipse.paho.mqtt.python.tar
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/sketch.properties
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/sketch.properties
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/sketch.properties
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryAgent.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryAgent.py
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryAgent.py
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryAgent.py
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryStats.log b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryStats.log
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/RaspberryStats.log
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/RaspberryStats.log
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/httpServer.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/httpServer.py
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/httpServer.py
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/httpServer.py
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/iotUtils.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/iotUtils.py
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/iotUtils.py
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/iotUtils.py
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/mqttConnector.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/mqttConnector.py
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/mqttConnector.py
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/mqttConnector.py
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/running_mode.py b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/running_mode.py
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/src/running_mode.py
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/src/running_mode.py
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/startService.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/startService.sh
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/startService.sh
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/startService.sh
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/testAgent.sh b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/testAgent.sh
similarity index 100%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/agent/testAgent.sh
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/agent/testAgent.sh
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml
similarity index 77%
rename from features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml
index 85db147c6..cc2800ea8 100644
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/devicetypes/raspberrypi.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/devicetypes/raspberrypi.xml
@@ -31,17 +31,11 @@
- false
+ true
true
-
-
- raspberrypi.mqtt.adapter
- 0
- true
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..fdca33545
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/p2.inf
@@ -0,0 +1,25 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/raspberrypi/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/receiver/,target:${installFolder}/../../resources/devicetypes/android_sense/eventreceivers/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/streams/,target:${installFolder}/../../resources/devicetypes/android_sense/eventstreams/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.backend_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android_sense/,overwrite:true);\
+
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi.war);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/raspberrypi);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi.car);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\
\ No newline at end of file
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml
similarity index 80%
rename from components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml
rename to features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml
index 1424b737e..331a954e8 100644
--- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/src/main/resources/carbonapps/raspberrypi/raspberrypi_receiver/raspberrypi_receiver.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/receiver/raspberrypi_receiver.xml
@@ -16,11 +16,10 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
${tenant-domain}/raspberrypi/+/temperature
- iot-mqtt
- true
+ raspberrypi_receiver-${tenant-domain}
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json
new file mode 100644
index 000000000..225db3d1c
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/src/main/resources/streams/org.wso2.iot.raspberrypi_1.0.0.json
@@ -0,0 +1,16 @@
+{
+ "name": "org.wso2.iot.raspberrypi",
+ "version": "1.0.0",
+ "nickName": "raspberrypi",
+ "description": "Temperature data received from the raspberrypi",
+ "metaData": [
+ {"name":"owner","type":"STRING"},
+ {"name":"deviceId","type":"STRING"},
+ {"name":"time","type":"LONG"}
+ ],
+ "payloadData": [
+ {
+ "name": "temperature","type": "FLOAT"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml
deleted file mode 100644
index 62982ef29..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/datasources/raspberrypi-datasources.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
- org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader
-
-
-
-
- RaspberryPi_DB
- The datasource used for the RaspberryPi database
-
- jdbc/RaspberryPiDM_DB
-
-
-
- jdbc:h2:repository/database/RaspberryPiDM_DB;DB_CLOSE_ON_EXIT=FALSE
-
- wso2carbon
- wso2carbon
- org.h2.Driver
- 50
- 60000
- true
- SELECT 1
- 30000
-
-
-
-
-
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql
deleted file mode 100644
index 67e702ec9..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/h2.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- -----------------------------------------------------
--- Table `RASPBERRYPI_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `RASPBERRYPI_DEVICE` (
- `RASPBERRYPI_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`RASPBERRYPI_DEVICE_ID`) );
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql
deleted file mode 100644
index a944f4cb2..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mssql.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- -----------------------------------------------------
--- Table `RASPBERRYPI_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS RASPBERRYPI_DEVICE (
- RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (RASPBERRYPI_DEVICE_ID) );
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql
deleted file mode 100644
index ad0ec54b7..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/mysql.sql
+++ /dev/null
@@ -1,12 +0,0 @@
--- -----------------------------------------------------
--- Table `RASPBERRYPI_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `RASPBERRYPI_DEVICE` (
- `RASPBERRYPI_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`RASPBERRYPI_DEVICE_ID`) )
-ENGINE = InnoDB;
-
-
-
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql
deleted file mode 100644
index b72ecb564..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/oracle.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- -----------------------------------------------------
--- Table `RASPBERRYPI_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE RASPBERRYPI_DEVICE (
- RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (RASPBERRYPI_DEVICE_ID) );
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql
deleted file mode 100644
index a944f4cb2..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/dbscripts/postgresql.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- -----------------------------------------------------
--- Table `RASPBERRYPI_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS RASPBERRYPI_DEVICE (
- RASPBERRYPI_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (RASPBERRYPI_DEVICE_ID) );
-
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf
deleted file mode 100644
index 935c08882..000000000
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.feature/src/main/resources/p2.inf
+++ /dev/null
@@ -1,34 +0,0 @@
-instructions.configure = \
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/raspberrypi/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/raspberrypi/,overwrite:true);\
-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}/../../../repository/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}/../../../repository/deployment/server/jaggeryapps/,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);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
-
-
-instructions.unconfigure = \
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi.war);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/raspberrypi);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/raspberrypi);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/raspberrypi);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/raspberrypi-datasources.xml);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/RaspberryPiDM_DB.h2.db);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/devicetypes/raspberrypi.car);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\
\ No newline at end of file
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml
new file mode 100644
index 000000000..bcfd4f750
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/pom.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ raspberrypi-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature
+ pom
+ WSO2 Carbon - IoT Server RaspberryPi UI Feature
+ http://wso2.org
+ This feature contains the RaspberryPi Device type specific UI implementations for the IoT Server
+
+
+
+
+ com.h2database.wso2
+ h2-database-engine
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.raspberrypi.ui
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.raspberrypi.ui
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+ org.wso2.carbon.core.server:${carbon.kernel.version}
+
+ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml
new file mode 100644
index 000000000..cc2800ea8
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/devicetypes/raspberrypi.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Control Bulb
+ Control Bulb on Raspberrypi
+
+
+ state
+
+
+
+
+
+
+ true
+
+
+
+ true
+
+
+
+ en_US
+ 1.0.0
+ This is license text
+
+
+
\ No newline at end of file
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..619c3134b
--- /dev/null
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature/src/main/resources/p2.inf
@@ -0,0 +1,13 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.raspberrypi.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.device-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.type-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.realtime.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.raspberrypi.platform.configuration);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/raspberrypi.xml);\
\ No newline at end of file
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml
index df0a0a9a0..7f9e91a56 100644
--- a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -33,7 +33,9 @@
http://wso2.org
- org.wso2.carbon.device.mgt.iot.raspberrypi.feature
+ org.wso2.carbon.device.mgt.iot.raspberrypi.ui.feature
+ org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature
+ org.wso2.carbon.device.mgt.iot.raspberrypi.analytics.feature
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml
new file mode 100644
index 000000000..4f76e5497
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/pom.xml
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ virtual-fire-alarm-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature
+ pom
+ WSO2 Carbon - IoT Server VirtualFireAlarm Analytics Feature
+ http://wso2.org
+ This feature contains the VirtualFireAlarm Device type specific analytics implementations for the IoT Server
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+ unpack-analytics
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..c74ad9297
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/p2.inf
@@ -0,0 +1,8 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../analytics/repository/deployment/server/carbonapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/carbonapps/,target:${installFolder}/../../analytics/repository/deployment/server/carbonapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/receiver/,target:${installFolder}/../../analytics/repository/deployment/server/eventreceivers/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics_${feature.version}/streams/,target:${installFolder}/../../analytics/repository/deployment/server/eventstreams/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/virtualfirealarm.car);\
\ No newline at end of file
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/artifact.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml
similarity index 59%
rename from components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/artifact.xml
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml
index 44f173139..efd5dde7b 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_sense_streams/artifact.xml
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/receiver/virtualfirealarm_receiver-carbon.super.xml
@@ -16,8 +16,11 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-
- org.wso2.iot.android.sense_1.0.0.json
-
-
+
+
+ carbon.super/virtual_firealarm/+/temperature
+ virtualfirealarm_receiver-carbon.super
+
+
+
+
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_stream/org.wso2.iot.virtualfirealarm_1.0.0.json b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json
similarity index 100%
rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_stream/org.wso2.iot.virtualfirealarm_1.0.0.json
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml
similarity index 74%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml
index 96680c30e..91954a21e 100644
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/pom.xml
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml
@@ -23,16 +23,16 @@
org.wso2.carbon.devicemgt-plugins
virtual-fire-alarm-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
- org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature
pom
- WSO2 Carbon - IoT Server VirtualFireAlarm Feature
+ WSO2 Carbon - IoT Server VirtualFireAlarm Backend Feature
http://wso2.org
- This feature contains the VirtualFireAlarm Device type specific implementations for the IoT Server
+ This feature contains the VirtualFireAlarm Device type specific backend implementations for the IoT Server
@@ -79,41 +79,6 @@
maven-dependency-plugin
-
- unpack
- package
-
- unpack
-
-
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/carbonapps
-
- **/*
-
-
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui
-
- ${project.version}
- zip
- true
-
- ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
-
- **/*
-
-
-
-
copy-jaxrs-war
package
@@ -134,7 +99,6 @@
-
copy-agent-jar
package
@@ -162,8 +126,14 @@
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
- unpack-analytics
+ unpack
package
unpack
@@ -172,7 +142,8 @@
org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.iot.analytics
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics
+
${project.version}
zip
true
@@ -184,40 +155,26 @@
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- create-virtual-firealarm-plugin-mgt-schema
+ unpack-analytics
package
- run
+ unpack
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.analytics
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/carbonapps
+
+ **/*
+
+
@@ -235,7 +192,7 @@
p2-feature-gen
- org.wso2.carbon.device.mgt.iot.virtualfirealarm
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend
../../../features/etc/feature.properties
@@ -249,11 +206,6 @@
org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
-
-
- org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.analytics.feature:${carbon.devicemgt.plugins.version}
-
-
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/cep_query.txt b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/cep_query.txt
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/cep_query.txt
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/deviceConfig.properties
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/deviceConfig.properties
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/deviceConfig.properties
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/sketch.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/sketch.properties
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/sketch.properties
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/sketch.properties
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.bat b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.bat
new file mode 100755
index 000000000..3b803066d
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.bat
@@ -0,0 +1,7 @@
+@echo off
+echo.
+echo.WSO2 IOT Sample
+echo.Virtual Fire Alarm
+echo.initializing agent
+echo.
+java -jar wso2-firealarm-virtual-agent-advanced.jar
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/start-device.sh b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.sh
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/advanced_agent/start-device.sh
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/advanced_agent/start-device.sh
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/deviceConfig.properties
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/deviceConfig.properties
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/deviceConfig.properties
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/sketch.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/sketch.properties
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/sketch.properties
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/sketch.properties
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.bat b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.bat
new file mode 100755
index 000000000..f19520f14
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.bat
@@ -0,0 +1,7 @@
+@echo off
+echo.
+echo.WSO2 IOT Sample
+echo.Virtual Fire Alarm
+echo.initializing agent
+echo.
+java -jar wso2-firealarm-virtual-agent.jar
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/start-device.sh b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.sh
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/start-device.sh
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/start-device.sh
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/virtual_firealarm.jks b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/virtual_firealarm.jks
similarity index 100%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/agent/virtual_firealarm.jks
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/agent/virtual_firealarm.jks
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml
new file mode 100644
index 000000000..10f1985ca
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/devicetypes/virtual_firealarm.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+ Control buzzer
+ Control buzzer on Virtual Firealarm
+
+
+ state
+
+
+
+
+
+
+ true
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ en_US
+ 1.0.0
+ This is license text
+
+
+
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..954ded23a
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/p2.inf
@@ -0,0 +1,21 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/receiver/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/receiver/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/streams/,target:${installFolder}/../../../repository/resources/devicetypes/virtual_firealarm/streams/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend_${feature.version}/advanced_agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/,overwrite:true);\
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm.war);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\
\ No newline at end of file
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml
similarity index 80%
rename from components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml
index d46fc1a56..eea9bb117 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/src/main/resources/carbonapps/virtualfirealarm/virtualfirealarm_receiver/virtualfirealarm_receiver.xml
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/receiver/virtualfirealarm_receiver.xml
@@ -16,11 +16,10 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
+
${tenant-domain}/virtual_firealarm/+/temperature
- iot-mqtt
- true
+ virtualfirealarm_receiver-${tenant-domain}
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json
new file mode 100644
index 000000000..0ba70911e
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/src/main/resources/streams/org.wso2.iot.virtualfirealarm_1.0.0.json
@@ -0,0 +1,16 @@
+{
+ "name": "org.wso2.iot.virtualfirealarm",
+ "version": "1.0.0",
+ "nickName": "virtual_firealarm",
+ "description": "Temperature data received from the virtual_firealarm",
+ "metaData": [
+ {"name":"owner","type":"STRING"},
+ {"name":"deviceId","type":"STRING"},
+ {"name":"time","type":"LONG"}
+ ],
+ "payloadData": [
+ {
+ "name": "temperature","type": "FLOAT"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks
deleted file mode 100644
index 00589cdf0..000000000
Binary files a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/certs/wso2certs.jks and /dev/null differ
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml
deleted file mode 100644
index a724d94d1..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/datasources/virtual_firealarm-datasources.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
- org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader
-
-
-
-
- VirtualFireAlarmDM_DB
- The datasource used for the Virtual-Firealarm database
-
- jdbc/VirtualFireAlarmDM_DB
-
-
-
- jdbc:h2:repository/database/VirtualFireAlarmDM_DB;DB_CLOSE_ON_EXIT=FALSE
-
- wso2carbon
- wso2carbon
- org.h2.Driver
- 50
- 60000
- true
- SELECT 1
- 30000
-
-
-
-
-
-
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql
deleted file mode 100644
index 160b437cb..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/h2.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `FIREALARM_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `VIRTUAL_FIREALARM_DEVICE` (
- `VIRTUAL_FIREALARM_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`VIRTUAL_FIREALARM_DEVICE_ID`) );
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql
deleted file mode 100644
index 41b7e4848..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mssql.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `FIREALARM_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS VIRTUAL_FIREALARM_DEVICE (
- VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) );
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql
deleted file mode 100644
index 432ecbb0e..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/mysql.sql
+++ /dev/null
@@ -1,12 +0,0 @@
--- -----------------------------------------------------
--- Table `FIREALARM_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `VIRTUAL_FIREALARM_DEVICE` (
- `VIRTUAL_FIREALARM_DEVICE_ID` VARCHAR(45) NOT NULL ,
- `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (`VIRTUAL_FIREALARM_DEVICE_ID`) )
-ENGINE = InnoDB;
-
-
-
-
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql
deleted file mode 100644
index 5583d1694..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/oracle.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `FIREALARM_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE VIRTUAL_FIREALARM_DEVICE (
- VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) );
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql
deleted file mode 100644
index 41b7e4848..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/dbscripts/postgresql.sql
+++ /dev/null
@@ -1,8 +0,0 @@
-
--- -----------------------------------------------------
--- Table `FIREALARM_DEVICE`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS VIRTUAL_FIREALARM_DEVICE (
- VIRTUAL_FIREALARM_DEVICE_ID VARCHAR(45) NOT NULL ,
- DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
- PRIMARY KEY (VIRTUAL_FIREALARM_DEVICE_ID) );
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf
deleted file mode 100644
index 1f77296c2..000000000
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf
+++ /dev/null
@@ -1,46 +0,0 @@
-instructions.configure = \
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/webapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/webapps/,target:${installFolder}/../../../repository/deployment/server/webapps/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/advanced_agent/,target:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced/,overwrite:true);\
-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}/../../../repository/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}/../../../repository/deployment/server/jaggeryapps/,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);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/database/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/security/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/certs/,target:${installFolder}/../../../repository/resources/security/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/device-types/);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/carbonapps/);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/carbonapps/,target:${installFolder}/../../../repository/resources/devicetypes/,overwrite:true);\
-
-
-instructions.unconfigure = \
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm.war);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm_scep.war);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/webapps/virtual_firealarm_scep);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/plugins/virtual_firealarm);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/sketches/virtual_firealarm_advanced);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../conf/datasources/virtual_firealarm-datasources.xml);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/database/VirtualFireAlarmDM_DB.h2.db);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-edit);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-wizard);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/resources/security/wso2certs.jks);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\
-org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/carbonapps/virtualfirealarm.car);\
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml
new file mode 100644
index 000000000..f82088c1b
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/pom.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ virtual-fire-alarm-plugin-feature
+ 3.0.37-SNAPSHOT
+ ../pom.xml
+
+
+ 4.0.0
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature
+ pom
+ WSO2 Carbon - IoT Server VirtualFireAlarm UI Feature
+ http://wso2.org
+ This feature contains the VirtualFireAlarm Device type specific UI implementations for the IoT Server
+
+
+
+
+ com.h2database.wso2
+ h2-database-engine
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ copy-resources
+ generate-resources
+
+ copy-resources
+
+
+ src/main/resources
+
+
+ resources
+
+ build.properties
+ p2.inf
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+
+ unpack
+ package
+
+ unpack
+
+
+
+
+ org.wso2.carbon.devicemgt-plugins
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui
+
+ ${project.version}
+ zip
+ true
+
+ ${project.build.directory}/maven-shared-archive-resources/jaggeryapps/devicemgt
+
+ **/*
+
+
+
+
+
+
+
+
+ org.wso2.maven
+ carbon-p2-plugin
+ ${carbon.p2.plugin.version}
+
+
+ p2-feature-generation
+ package
+
+ p2-feature-gen
+
+
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui
+ ../../../features/etc/feature.properties
+
+
+ org.wso2.carbon.p2.category.type:server
+ org.eclipse.equinox.p2.type.group:true
+
+
+
+ org.wso2.carbon.core.server:${carbon.kernel.version}
+
+ org.wso2.carbon.device.mgt.server:${carbon.devicemgt.version}
+
+
+
+
+
+
+
+
+
+
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties
new file mode 100644
index 000000000..9c86577d7
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/build.properties
@@ -0,0 +1 @@
+custom = true
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml
similarity index 90%
rename from features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml
rename to features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml
index 1fcfec4c6..145709c86 100644
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/devicetypes/virtual_firealarm.xml
@@ -37,11 +37,6 @@
true
-
- virtualfirealarm.mqtt.adapter
- 0
- true
-
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf
new file mode 100644
index 000000000..295ac3fc1
--- /dev/null
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature/src/main/resources/p2.inf
@@ -0,0 +1,17 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui_${feature.version}/jaggeryapps/,target:${installFolder}/../../../repository/deployment/server/jaggeryapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/deployment/server/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui_${feature.version}/devicetypes/,target:${installFolder}/../../../repository/deployment/server/devicetypes/,overwrite:true);\
+
+
+instructions.unconfigure = \
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.device-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.type-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-edit);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.platform.configuration);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-wizard);\
+org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../repository/deployment/server/devicetypes/virtual_firealarm.xml);\
\ No newline at end of file
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml
index 3a9b99fc1..510e8dce4 100644
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml
+++ b/features/device-types-feature/virtual-fire-alarm-plugin-feature/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
@@ -33,7 +33,9 @@
http://wso2.org
- org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui.feature
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature
+ org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics.feature
diff --git a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml
index e528d2122..a76353400 100644
--- a/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml
+++ b/features/extensions-feature/org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml
index 5cca4275b..c447cc0ce 100644
--- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml
+++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.osgiconnector.feature/pom.xml
@@ -20,13 +20,13 @@
org.wso2.carbon.devicemgt-plugins
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.carbon.appmgt.mdm.osgiconnector.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - App management MDM OSGI Connector
http://wso2.org
This feature contains the core bundles required for APP management OSGI MDM connection
@@ -36,7 +36,7 @@
org.wso2.carbon.devicemgt-plugins
org.wso2.carbon.appmgt.mdm.osgiconnector
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
org.apache.ws.commons.axiom
diff --git a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml
index da8e13ad2..dfb999b64 100644
--- a/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml
+++ b/features/extensions-feature/org.wso2.carbon.appmgt.mdm.restconnector.feature/pom.xml
@@ -20,13 +20,13 @@
org.wso2.carbon.devicemgt-plugins
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.carbon.appmgt.mdm.restconnector.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - App management MDM REST Connector
http://wso2.org
This feature contains the core bundles required for APP management MDM REST connection
@@ -36,7 +36,7 @@
org.wso2.carbon.devicemgt-plugins
org.wso2.carbon.appmgt.mdm.restconnector
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
org.apache.ws.commons.axiom
diff --git a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml
index 873d791dc..762ec3961 100644
--- a/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml
+++ b/features/extensions-feature/org.wso2.carbon.device.mgt.adapter.feature/pom.xml
@@ -23,14 +23,14 @@
org.wso2.carbon.devicemgt-plugins
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.adapter.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Device Management Adapters Feature
http://wso2.org
This feature contains the adapter bundles required for IoT Server
@@ -208,17 +208,6 @@
org.wso2.carbon.identity.carbon.auth.jwt:org.wso2.carbon.identity.authenticator.signedjwt:${identity.carbon.auth.jwt.version}
-
-
- org.wso2.carbon.event.output.adapter.server:${carbon.analytics.common.version}
-
-
- org.wso2.carbon.event.input.adapter.server:${carbon.analytics.common.version}
-
-
- org.wso2.carbon.identity.jwt.client.extension:${carbon.devicemgt.version}
-
-
diff --git a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml
index e0df33ea8..d3e9cabd3 100644
--- a/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml
+++ b/features/extensions-feature/org.wso2.extension.siddhi.execution.json.feature/pom.xml
@@ -20,13 +20,13 @@
org.wso2.carbon.devicemgt-plugins
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.extension.siddhi.execution.json.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Siddhi Execution Extension - Json Feature
http://wso2.org
This feature contains Siddhi extension feature for changing a json string to individual properties.
diff --git a/features/extensions-feature/pom.xml b/features/extensions-feature/pom.xml
index 07176fa4a..0f2b2d996 100644
--- a/features/extensions-feature/pom.xml
+++ b/features/extensions-feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
extensions-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - Device Management Extensions
http://wso2.org
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml
index 9d1491b39..4a05880a4 100644
--- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt-plugins
android-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.android.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Android Device Management Feature
http://wso2.org
This feature contains the core bundles required for Android Device Management
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml
new file mode 100644
index 000000000..41596567a
--- /dev/null
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Configuration-Management.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml
new file mode 100644
index 000000000..d7fa119de
--- /dev/null
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Device-Management.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml
new file mode 100644
index 000000000..e39eb25e9
--- /dev/null
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/apis/admin--Android-Mutual-SSL-Event-Receiver.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml
index c18d18304..f36a7e3a3 100644
--- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/devicetypes/android.xml
@@ -51,9 +51,13 @@
true
-
+
-
+
diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf
index 838bf97d3..6a5b0d2f3 100644
--- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf
+++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/p2.inf
@@ -1,8 +1,9 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/devicetypes/android/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/android/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/webapps/api#device-mgt#android#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#device-mgt#android#v1.0.war,overwrite:true);\
-org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/carbonapps/,target:${installFolder}/../../resources/devicetypes/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/devicemgt,target:${installFolder}/../../deployment/server/jaggeryapps/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/android-web-agent,target:${installFolder}/../../deployment/server/jaggeryapps/android-web-agent,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\
@@ -13,6 +14,9 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Configuration-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Configuration-Management.xml,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Device-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Device-Management.xml,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Event-Receiver.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Event-Receiver.xml,overwrite:true);\
instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent.war);\
diff --git a/features/mobile-plugins-feature/android-plugin-feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/pom.xml
index 90ce58dc7..74887ed56 100644
--- a/features/mobile-plugins-feature/android-plugin-feature/pom.xml
+++ b/features/mobile-plugins-feature/android-plugin-feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt-plugins
mobile-plugins-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
android-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - Device Management Android Plugin Feature
http://wso2.org
diff --git a/features/mobile-plugins-feature/pom.xml b/features/mobile-plugins-feature/pom.xml
index 569d7ba26..565625851 100644
--- a/features/mobile-plugins-feature/pom.xml
+++ b/features/mobile-plugins-feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
mobile-plugins-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - Device Management EMM Plugins Feature
http://wso2.org
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml
index a961f99dc..20bc184a7 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml
@@ -22,14 +22,14 @@
org.wso2.carbon.devicemgt-plugins
windows-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.windows.feature
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Windows Device Management Feature
http://wso2.org
This feature contains the core bundles required for Windows Device Management
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql
index f1749a8a8..7841ec87c 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/h2.sql
@@ -28,3 +28,17 @@ CREATE TABLE IF NOT EXISTS `WIN_FEATURE` (
`DESCRIPTION` VARCHAR(200) NULL,
PRIMARY KEY (`ID`)
);
+
+-- -----------------------------------------------------
+-- Table `WINDOWS_ENROLLMENT_TOKEN`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `WINDOWS_ENROLLMENT_TOKEN` (
+ `ID` INT NOT NULL AUTO_INCREMENT,
+ `TENANT_DOMAIN` VARCHAR(45) NOT NULL,
+ `TENANT_ID` INTEGER DEFAULT 0,
+ `ENROLLMENT_TOKEN` VARCHAR(100) NULL,
+ `DEVICE_ID` VARCHAR(100) NULL,
+ `USERNAME` VARCHAR(45) NULL,
+ `OWNERSHIP` VARCHAR(45) NULL,
+ PRIMARY KEY (`ID`)
+);
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql
index 524a483c7..54a7dc720 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql
@@ -30,3 +30,17 @@ CREATE TABLE WIN_DEVICE (
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (DEVICE_ID)
);
+
+-- -----------------------------------------------------
+-- Table `WINDOWS_ENROLLMENT_TOKEN`
+-- -----------------------------------------------------
+IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WINDOWS_ENROLLMENT_TOKEN]') AND TYPE IN (N'U'))
+CREATE TABLE WINDOWS_ENROLLMENT_TOKEN (
+ ID INT NOT NULL IDENTITY,
+ TENANT_DOMAIN VARCHAR(45) NOT NULL,
+ ENROLLMENT_TOKEN VARCHAR (100) NULL DEFAULT NULL,
+ DEVICE_ID VARCHAR (100) NOT NULL,
+ USERNAME VARCHAR (45) NOT NULL,
+ OWNERSHIP VARCHAR (45) NULL DEFAULT NULL,
+ PRIMARY KEY (ID);
+);
\ No newline at end of file
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql
index 2ebcc80f7..378d516da 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mysql.sql
@@ -30,5 +30,18 @@ CREATE TABLE IF NOT EXISTS `WIN_FEATURE` (
PRIMARY KEY (`ID`))
ENGINE = InnoDB;
+-- -----------------------------------------------------
+-- Table `WINDOWS_ENROLLMENT_TOKEN`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `WINDOWS_ENROLLMENT_TOKEN` (
+ `ID` INT NOT NULL AUTO_INCREMENT,
+ `TENANT_DOMAIN` VARCHAR(45) NOT NULL,
+ `ENROLLMENT_TOKEN` VARCHAR(100) NULL,
+ `DEVICE_ID` VARCHAR(100) NULL,
+ `USERNAME` VARCHAR(45) NULL,
+ `OWNERSHIP` VARCHAR(45) NULL,
+ PRIMARY KEY (`ID`))
+ENGINE = InnoDB;
+
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql
index a7a389264..3371fab89 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/oracle.sql
@@ -31,6 +31,20 @@ CREATE TABLE WIN_FEATURE (
)
/
+-- -----------------------------------------------------
+-- Table `WINDOWS_ENROLLMENT_TOKEN`
+-- -----------------------------------------------------
+CREATE TABLE WINDOWS_ENROLLMENT_TOKEN (
+ ID INT NOT NULL,
+ TENANT_DOMAIN VARCHAR(45) NOT NULL,
+ ENROLLMENT_TOKEN VARCHAR(100) NULL,
+ DEVICE_ID VARCHAR(100) NULL,
+ USERNAME VARCHAR(45) NULL,
+ OWNERSHIP VARCHAR(45) NULL,
+ PRIMARY KEY (ID)
+)
+/
+
-- -----------------------------------------------------
-- Sequence `WIN_FEATURE_ID_INC_SEQ`
-- -----------------------------------------------------
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql
index d7444757d..c8af94cd6 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/postgresql.sql
@@ -29,3 +29,15 @@ CREATE TABLE IF NOT EXISTS WIN_FEATURE (
PRIMARY KEY (ID)
);
+-- -----------------------------------------------------
+-- Table `WINDOWS_ENROLLMENT_TOKEN`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS WINDOWS_ENROLLMENT_TOKEN (
+ ID SERIAL NOT NULL,
+ TENANT_DOMAIN VARCHAR(45) NOT NULL,
+ ENROLLMENT_TOKEN VARCHAR(100) NULL,
+ DEVICE_ID VARCHAR(100) NULL,
+ USERNAME VARCHAR(45) NULL,
+ OWNERSHIP VARCHAR(45) NULL,
+ PRIMARY KEY (ID)
+);
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml
index 3c7782517..2efa4203e 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml
+++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/devicetypes/windows.xml
@@ -166,6 +166,14 @@
+
+ DEVICE_INFO
+ 1
+
+
+ DEVICE_LOCATION
+ 1
+
diff --git a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml
index b7ad9c1fa..c0adf763d 100644
--- a/features/mobile-plugins-feature/windows-plugin-feature/pom.xml
+++ b/features/mobile-plugins-feature/windows-plugin-feature/pom.xml
@@ -22,13 +22,13 @@
org.wso2.carbon.devicemgt-plugins
mobile-plugins-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
windows-plugin-feature
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - Device Management Windows Plugin Feature
http://wso2.org
diff --git a/pom.xml b/pom.xml
index 5f53b7cac..3c5d5b531 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
pom
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Device Management Plugins Parent
http://wso2.org
WSO2 Carbon - Device Management Plugins Parent
@@ -1128,14 +1128,14 @@
1.1.1
- 2.0.42
+ 2.0.58
[2.0.0, 3.0.0)
- 1.2.15
+ 1.2.25
- 3.0.24-SNAPSHOT
+ 3.0.37-SNAPSHOT
4.4.8
@@ -1173,7 +1173,7 @@
1.5.8
- 5.1.3
+ 5.1.17
[5.1.3,6.0.0)
1.3.3
[1.3.0,2.0.0)
@@ -1215,6 +1215,7 @@
3.0.0.wso2v1
(3.0.0, 4.0.0]
+ [2.0.0,4.0.0)
0.9.1
1.1.wso2v1
3.2.2
@@ -1337,7 +1338,7 @@
-->
-
+
maven-assembly-plugin
2.2-beta-2