diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml
index b81e9cb2a..29b716c34 100644
--- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml
+++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.cdmf.analytics/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
iot-analytics
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml
index 3c9529172..4993f5fd6 100644
--- a/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml
+++ b/components/analytics/iot-analytics/org.wso2.carbon.device.mgt.iot.analytics/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
iot-analytics
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml
index f07828721..bb154bca0 100644
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml
+++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.device.statistics.dashboard/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
iot-analytics
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml
index a8bf9b53e..76dfe1333 100644
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml
+++ b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/pom.xml
@@ -21,7 +21,7 @@
org.wso2.carbon.devicemgt-plugins
iot-analytics
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/analytics/iot-analytics/pom.xml b/components/analytics/iot-analytics/pom.xml
index 504882044..97846bf69 100644
--- a/components/analytics/iot-analytics/pom.xml
+++ b/components/analytics/iot-analytics/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
analytics
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/analytics/pom.xml b/components/analytics/pom.xml
index 797f382ba..ad80273df 100644
--- a/components/analytics/pom.xml
+++ b/components/analytics/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml
index a7e4e540d..450d8948f 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml
+++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/pom.xml
@@ -21,7 +21,7 @@
androidsense-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml
index dbc4e3b66..ccafcd41a 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml
+++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/pom.xml
@@ -3,7 +3,7 @@
androidsense-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml
index 34e28e886..e7f213af5 100644
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml
+++ b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.ui/pom.xml
@@ -22,7 +22,7 @@
androidsense-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/androidsense-plugin/pom.xml b/components/device-types/androidsense-plugin/pom.xml
index 824d53667..fadc871b8 100644
--- a/components/device-types/androidsense-plugin/pom.xml
+++ b/components/device-types/androidsense-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml
index 53efaa221..c49b00c77 100644
--- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml
+++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.analytics/pom.xml
@@ -21,7 +21,7 @@
arduino-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml
index 8d0a80771..35ee5ffcc 100644
--- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml
+++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/pom.xml
@@ -21,7 +21,7 @@
arduino-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml
index 0ead43816..d1ccf280f 100644
--- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml
+++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.ui/pom.xml
@@ -23,7 +23,7 @@
arduino-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/arduino-plugin/pom.xml b/components/device-types/arduino-plugin/pom.xml
index 6c22b62c6..f80c90f15 100644
--- a/components/device-types/arduino-plugin/pom.xml
+++ b/components/device-types/arduino-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/pom.xml b/components/device-types/pom.xml
index f7ae7f88b..995f38ecf 100644
--- a/components/device-types/pom.xml
+++ b/components/device-types/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
carbon-device-mgt-plugins-parent
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml
index efc0b4f4a..f2efffe36 100644
--- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml
+++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.analytics/pom.xml
@@ -21,7 +21,7 @@
raspberrypi-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml
index 57de977b0..f52e7cddd 100644
--- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml
+++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/pom.xml
@@ -21,7 +21,7 @@
raspberrypi-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml
index 1cc87f4a5..b9dd850c5 100644
--- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml
+++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.ui/pom.xml
@@ -23,7 +23,7 @@
raspberrypi-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/raspberrypi-plugin/pom.xml b/components/device-types/raspberrypi-plugin/pom.xml
index fd31857ad..574e6cc48 100644
--- a/components/device-types/raspberrypi-plugin/pom.xml
+++ b/components/device-types/raspberrypi-plugin/pom.xml
@@ -22,7 +22,7 @@
org.wso2.carbon.devicemgt-plugins
device-types
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml
index 38513db7b..c65961dbc 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/pom.xml
@@ -23,7 +23,7 @@
virtual-fire-alarm-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java
index 9123c5fac..4ce5d5188 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java
@@ -29,6 +29,7 @@ import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.transport.
import java.io.*;
import java.net.URL;
+import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -67,15 +68,14 @@ public class AgentUtilOperations {
try {
ClassLoader loader = AgentUtilOperations.class.getClassLoader();
URL path = loader.getResource(propertiesFileName);
- System.out.println(path);
- String root = path.getPath().replace(
- "wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig.properties",
- "").replace("jar:", "").replace("file:", "");
-
- agentManager.setRootPath(root);
-
- propertiesInputStream = new FileInputStream(
- root + AgentConstants.AGENT_PROPERTIES_FILE_NAME);
+ log.info(AgentConstants.LOG_APPENDER + path);
+ String rootPath = path.getPath().replace("wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig"
+ + ".properties", "").replace("jar:", "").replace("file:", "");
+
+ rootPath = URLDecoder.decode(rootPath, StandardCharsets.UTF_8.toString());
+ agentManager.setRootPath(rootPath);
+ String deviceConfigFilePath = rootPath + AgentConstants.AGENT_PROPERTIES_FILE_NAME;
+ propertiesInputStream = new FileInputStream(deviceConfigFilePath);
//load a properties file from class path, inside static method
properties.load(propertiesInputStream);
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml
index 243ea2568..1486ccd49 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/pom.xml
@@ -23,7 +23,7 @@
virtual-fire-alarm-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml
index fb708d875..3d9c59a31 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.analytics/pom.xml
@@ -21,7 +21,7 @@
virtual-fire-alarm-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml
index d61ee7026..6cbab4c7d 100644
--- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml
+++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/pom.xml
@@ -21,7 +21,7 @@
virtual-fire-alarm-plugin
org.wso2.carbon.devicemgt-plugins
- 3.0.35-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/pom.xml b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/pom.xml
index 111840187..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/device-types/virtual-fire-alarm-plugin/pom.xml b/components/device-types/virtual-fire-alarm-plugin/pom.xml
index 20cf70338..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.35-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 b9f8c34cb..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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 cdf66f048..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/appm-connector/pom.xml b/components/extensions/appm-connector/pom.xml
index b08b2e69e..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.35-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 bc128149b..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.35-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.http/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.http/pom.xml
index e067da805..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
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 c11a8d7f6..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.35-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.xmpp/pom.xml b/components/extensions/cdmf-transport-adapters/input/org.wso2.carbon.device.mgt.input.adapter.xmpp/pom.xml
index c9986510e..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.35-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 675013af2..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.35-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.websocket.endpoint/pom.xml b/components/extensions/cdmf-transport-adapters/output/org.wso2.carbon.device.mgt.output.adapter.websocket.endpoint/pom.xml
index a99364ce7..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
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 34227c1e3..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
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 3455cae01..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.35-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 e13f5d840..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.35-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 a59701281..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/mb-extensions/pom.xml b/components/extensions/mb-extensions/pom.xml
index 7aa0caefa..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/pom.xml b/components/extensions/pom.xml
index c51f02ac3..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.35-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 c58b30ded..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/extensions/siddhi-extensions/pom.xml b/components/extensions/siddhi-extensions/pom.xml
index c6cb531c7..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.35-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 2c78bc454..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.35-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 5e1d789b7..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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 0e92b29fe..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.android.ui
- 3.0.35-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/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml
index bc13b1bfd..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml
index 5b6e8c8e0..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/components/mobile-plugins/pom.xml b/components/mobile-plugins/pom.xml
index 1ce4c0487..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.35-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 400534fdb..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.35-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 ae8edf1a1..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.windows.ui
- 3.0.35-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 60387832e..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.35-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 1a178f3a4..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.35-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 82eb58d1a..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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 c1a724ab0..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.iot.analytics.feature
- 3.0.35-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/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.device.statistics.dashboard.feature/pom.xml
index 7701a10a5..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.iot.device.statistics.dashboard.feature
- 3.0.35-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.geo.dashboard.feature/pom.xml b/features/analytics-feature/org.wso2.carbon.iot.geo.dashboard.feature/pom.xml
index f306afa44..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/analytics-feature/pom.xml b/features/analytics-feature/pom.xml
index 94a1e2eb0..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.35-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
index b0a03ca58..96c0145a2 100644
--- 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
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt-plugins
androidsense-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.iot.androidsense.analytics.feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - IoT Server Android Sense Analytics Feature
http://wso2.org
diff --git a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
index 6b865e194..9a16d3637 100644
--- a/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
+++ b/features/device-types-feature/androidsense-plugin-feature/org.wso2.carbon.device.mgt.iot.androidsense.backend.feature/pom.xml
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt-plugins
androidsense-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.iot.androidsense.backend.feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - IoT Server Android Sense Backend Feature
http://wso2.org
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
index 6b46909b9..011dede1e 100644
--- 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
@@ -23,13 +23,13 @@
org.wso2.carbon.devicemgt-plugins
androidsense-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.iot.androidsense.ui.feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
pom
WSO2 Carbon - IoT Server Android Sense UI Feature
http://wso2.org
diff --git a/features/device-types-feature/androidsense-plugin-feature/pom.xml b/features/device-types-feature/androidsense-plugin-feature/pom.xml
index 7b3f65223..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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
index 6241d72c2..48f89f95d 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
arduino-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
index 4c5f33d9d..a2efd5675 100644
--- a/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
+++ b/features/device-types-feature/arduino-plugin-feature/org.wso2.carbon.device.mgt.iot.arduino.backend.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
arduino-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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
index e204a9092..d07ae95d8 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
arduino-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/arduino-plugin-feature/pom.xml b/features/device-types-feature/arduino-plugin-feature/pom.xml
index e16d7d30f..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/pom.xml b/features/device-types-feature/pom.xml
index 36d739a1a..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
device-types-feature
- 3.0.35-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
index 73216e92c..59a8a7d56 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
raspberrypi-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
index 19e561219..b058dbc68 100644
--- a/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
+++ b/features/device-types-feature/raspberrypi-plugin-feature/org.wso2.carbon.device.mgt.iot.raspberrypi.backend.feature/pom.xml
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
raspberrypi-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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
index cd944571e..bcfd4f750 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
raspberrypi-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/raspberrypi-plugin-feature/pom.xml b/features/device-types-feature/raspberrypi-plugin-feature/pom.xml
index 68dc28f37..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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
index 683d9ccee..4f76e5497 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
virtual-fire-alarm-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
diff --git a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml b/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.feature/pom.xml
index 47ddc98d6..91954a21e 100644
--- a/features/device-types-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.backend.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,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
virtual-fire-alarm-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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.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.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
index b9461776c..f82088c1b 100644
--- 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
@@ -23,7 +23,7 @@
org.wso2.carbon.devicemgt-plugins
virtual-fire-alarm-plugin-feature
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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 ac16ca71c..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
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 953945cab..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.35-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 6df9e7c9a..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.carbon.appmgt.mdm.osgiconnector.feature
pom
- 3.0.35-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.35-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 c3bfd2a95..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.carbon.appmgt.mdm.restconnector.feature
pom
- 3.0.35-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.35-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 fb7055f31..526334471 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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.adapter.feature
pom
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Device Management Adapters Feature
http://wso2.org
This feature contains the adapter bundles required for IoT Server
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 bf423b8fe..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
org.wso2.extension.siddhi.execution.json.feature
pom
- 3.0.35-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 74f874ee9..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
extensions-feature
- 3.0.35-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 e7c763f73..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.android.feature
pom
- 3.0.35-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/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/pom.xml
index c7affd085..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
android-plugin-feature
- 3.0.35-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 eebfac129..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../../pom.xml
4.0.0
mobile-plugins-feature
- 3.0.35-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 c61a54f51..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
org.wso2.carbon.device.mgt.mobile.windows.feature
pom
- 3.0.35-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 d7c6ed49b..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
../pom.xml
4.0.0
windows-plugin-feature
- 3.0.35-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 a9712c3d8..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.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
WSO2 Carbon - Device Management Plugins Parent
http://wso2.org
WSO2 Carbon - Device Management Plugins Parent
@@ -1132,10 +1132,10 @@
[2.0.0, 3.0.0)
- 1.2.15
+ 1.2.25
- 3.0.35-SNAPSHOT
+ 3.0.37-SNAPSHOT
4.4.8