diff --git a/README.md b/README.md
index 9e552c224c..0789eca2b4 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
product-cdm
===========
-WSO2 CONNECTED DEVICE MANAGER
+WSO2 MOBILE DEVICE MANAGER
-WSO2 Enterprise Mobility Manager (WSO2 EMM) is a comprehensive platform that helps solve mobile computing challenges enterprises face today when dealing with both corporate owned, personally enabled (COPE) devices and employee owned devices as part of a bring your own device (BYOD) program.
+WSO2 Mobile Device Manager (WSO2 MDM) is a comprehensive platform that helps solve mobile computing challenges enterprises face today when dealing with both corporate owned, personally enabled (COPE) devices and employee owned devices as part of a bring your own device (BYOD) program.
Whether it is device provisioning, device configuration management, policy enforcement, mobile application management, device data security, or compliance monitoring, WSO2 EMM offers a single enterprise-grade platform.
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
deleted file mode 100644
index ad7e005500..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
- device-mgt
- org.wso2.carbon
- 2.0.0-SNAPSHOT
- ../pom.xml
-
-
- 4.0.0
- org.wso2.carbon.device.mgt.common
- 2.0.0-SNAPSHOT
- bundle
- WSO2 Carbon - Device Management Commons
- WSO2 Carbon - Device Management Commons
- http://wso2.org
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 1.4.0
- true
-
-
- ${project.artifactId}
- ${project.artifactId}
- ${project.version}
- Device Management Common Bundle
- org.wso2.carbon.device.mgt.common
-
- org.apache.commons.logging
-
-
- org.wso2.carbon.device.mgt.common.*
-
- *
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java
deleted file mode 100644
index 94786b4191..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Device.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class Device {
-
- private int id;
- private String type;
- private String description;
- private String name;
- private Long dateOfEnrolment;
- private Long dateOfLastUpdate;
- private String ownership;
- private boolean status;
- private int deviceTypeId;
- private String deviceIdentifier;
- private String owner;
- private List features;
- private List properties;
-
- @XmlElement
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- @XmlElement
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @XmlElement
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @XmlElement
- public Long getDateOfEnrolment() {
- return dateOfEnrolment;
- }
-
- public void setDateOfEnrolment(Long dateOfEnrolment) {
- this.dateOfEnrolment = dateOfEnrolment;
- }
-
- @XmlElement
- public Long getDateOfLastUpdate() {
- return dateOfLastUpdate;
- }
-
- public void setDateOfLastUpdate(Long dateOfLastUpdate) {
- this.dateOfLastUpdate = dateOfLastUpdate;
- }
-
- @XmlElement
- public String getOwnership() {
- return ownership;
- }
-
- public void setOwnership(String ownership) {
- this.ownership = ownership;
- }
-
- @XmlElement
- public boolean isStatus() {
- return status;
- }
-
- public void setStatus(boolean status) {
- this.status = status;
- }
-
- @XmlElement
- public int getDeviceTypeId() {
- return deviceTypeId;
- }
-
- public void setDeviceTypeId(int deviceTypeId) {
- this.deviceTypeId = deviceTypeId;
- }
-
- @XmlElement
- public String getDeviceIdentifier() {
- return deviceIdentifier;
- }
-
- public void setDeviceIdentifier(String deviceIdentifier) {
- this.deviceIdentifier = deviceIdentifier;
- }
-
- @XmlElement
- public String getOwner() {
- return owner;
- }
-
- public void setOwner(String owner) {
- this.owner = owner;
- }
-
- @XmlElement
- public List getFeatures() {
- return features;
- }
-
- public void setFeatures(List features) {
- this.features = features;
- }
-
- @XmlElement
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @XmlElement
- public List getProperties() {
- return properties;
- }
-
- public void setProperties(List properties) {
- this.properties = properties;
- }
-
- public static class Property {
-
- private String name;
- private String value;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceIdentifier.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceIdentifier.java
deleted file mode 100644
index e9f7ca5110..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceIdentifier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-public class DeviceIdentifier {
-
- private String type;
-
- private String id;
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementConstants.java
deleted file mode 100644
index 9802fe30fe..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-public final class DeviceManagementConstants {
-
- public static final class DataSourceProperties {
- private DataSourceProperties() {
- throw new AssertionError();
- }
- public static final String DB_CHECK_QUERY = "SELECT * FROM DM_DEVICE";
- public static final String SECURE_VAULT_NS = "http://org.wso2.securevault/configuration";
- public static final String DEVICE_CONFIG_XML_NAME = "cdm-config.xml";
- }
-
- public static final class SecureValueProperties {
- private SecureValueProperties() {
- throw new AssertionError();
- }
- public static final String SECRET_ALIAS_ATTRIBUTE_NAME_WITH_NAMESPACE = "secretAlias";
- public static final String SECURE_VAULT_NS = "http://org.wso2.securevault/configuration";
- }
-
- public static final class MobileDeviceTypes {
- private MobileDeviceTypes() {
- throw new AssertionError();
- }
- public final static String MOBILE_DEVICE_TYPE_ANDROID = "android";
- public final static String MOBILE_DEVICE_TYPE_IOS = "ios";
- public final static String MOBILE_DEVICE_TYPE_WINDOWS = "windows";
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementException.java
deleted file mode 100644
index 48c409b894..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementException.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-@SuppressWarnings("unused")
-public class DeviceManagementException extends Exception {
-
- private static final long serialVersionUID = -3151279311929070297L;
-
- private String errorMessage;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
- public DeviceManagementException(String msg, Exception nestedEx) {
- super(msg, nestedEx);
- setErrorMessage(msg);
- }
-
- public DeviceManagementException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public DeviceManagementException(String msg) {
- super(msg);
- setErrorMessage(msg);
- }
-
- public DeviceManagementException() {
- super();
- }
-
- public DeviceManagementException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java
deleted file mode 100644
index d350a13910..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManagementServiceException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014, 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.common;
-
-public class DeviceManagementServiceException extends Exception {
-
- private static final long serialVersionUID = -8933146283800122640L;
- private String errorMessage;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
- public DeviceManagementServiceException(String msg, Exception nestedEx) {
- super(msg, nestedEx);
- setErrorMessage(msg);
- }
-
- public DeviceManagementServiceException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public DeviceManagementServiceException(String msg) {
- super(msg);
- setErrorMessage(msg);
- }
-
- public DeviceManagementServiceException() {
- super();
- }
-
- public DeviceManagementServiceException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Feature.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Feature.java
deleted file mode 100644
index 388edbb402..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Feature.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-import java.util.List;
-
-public class Feature {
-
- private int id;
- private String name;
- private List metadataEntries;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List getMetadataEntries() {
- return metadataEntries;
- }
-
- public void setMetadataEntries(List metadataEntries) {
- this.metadataEntries = metadataEntries;
- }
-
- public static class MetadataEntry {
-
- private int id;
- private Object value;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/License.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/License.java
deleted file mode 100644
index b72605baed..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/License.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * * Copyright (c) 2014, 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.common;
-
-public class License {
-
- private String licenseName;
- private String licenseText;
- private String licenseVersion;
-
- public String getLicenseName() {
- return licenseName;
- }
-
- public void setLicenseName(String licenseName) {
- this.licenseName = licenseName;
- }
-
- public String getLicenseText() {
- return licenseText;
- }
-
- public void setLicenseText(String licenseText) {
- this.licenseText = licenseText;
- }
-
- public String getLicenseVersion() {
- return licenseVersion;
- }
-
- public void setLicenseVersion(String licenseVersion) {
- this.licenseVersion = licenseVersion;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Operation.java
deleted file mode 100644
index 755be0b5cc..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/Operation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-
-@XmlRootElement
-public class Operation {
-
- public enum Type {
- CONFIG, MESSAGE, INFO
- }
-
- private String code;
- private Properties properties;
- private Type type;
-
- @XmlElement
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- @XmlElement
- public Properties getProperties() {
- return properties;
- }
-
- public void setProperties(Properties properties) {
- this.properties = properties;
- }
-
- @XmlElement
- public Type getType() {
- return type;
- }
-
- public void setType(Type type) {
- this.type = type;
- }
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationExecutionException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationExecutionException.java
deleted file mode 100644
index 5090a33922..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationExecutionException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-public class OperationExecutionException extends Exception {
-
- private static final long serialVersionUID = -3151279311929070299L;
-
- private String errorMessage;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
- public OperationExecutionException(String msg, Exception nestedEx) {
- super(msg, nestedEx);
- setErrorMessage(msg);
- }
-
- public OperationExecutionException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public OperationExecutionException(String msg) {
- super(msg);
- setErrorMessage(msg);
- }
-
- public OperationExecutionException() {
- super();
- }
-
- public OperationExecutionException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManagementException.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManagementException.java
deleted file mode 100644
index 0ed2f9585c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManagementException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (c) 2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-public class OperationManagementException extends Exception {
-
- private static final long serialVersionUID = -3151279311929070298L;
-
- private String errorMessage;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
- public OperationManagementException(String msg, Exception nestedEx) {
- super(msg, nestedEx);
- setErrorMessage(msg);
- }
-
- public OperationManagementException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public OperationManagementException(String msg) {
- super(msg);
- setErrorMessage(msg);
- }
-
- public OperationManagementException() {
- super();
- }
-
- public OperationManagementException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManager.java
deleted file mode 100644
index e11f5740a3..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/OperationManager.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common;
-
-import java.util.List;
-
-/**
- * This represents the Device Operation management functionality which should be implemented by
- * the device type plugins.
- */
-public interface OperationManager {
-
- /**
- * Method to add a operation to a device or a set of devices.
- *
- * @param operation Operation to be added
- * @param devices List of DeviceIdentifiers to execute the operation
- * @throws OperationManagementException If some unusual behaviour is observed while adding the
- * operation
- */
- public boolean addOperation(Operation operation, List devices)
- throws OperationManagementException;
-
- /**
- * Method to retrieve the list of available operations to a device.
- *
- * @param deviceId DeviceIdentifier of the device
- * @throws OperationManagementException If some unusual behaviour is observed while fetching the
- * operation list.
- */
- public List getOperations(DeviceIdentifier deviceId)
- throws OperationManagementException;
-
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java
deleted file mode 100644
index bfbc43922e..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/spi/DeviceManagerService.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.common.spi;
-
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.OperationManager;
-
-import java.util.List;
-
-/**
- * This represents the service provider interface that has to be implemented by any of new
- * device type plugin implementation intended to be managed through CDM.
- */
-public interface DeviceManagerService {
-
- /**
- * Method to retrieve the provider type that implements DeviceManagerService interface.
- *
- * @return Returns provider type
- */
- String getProviderType();
-
- /**
- * Method to enrolling a particular device of type mobile, IoT, etc within CDM.
- *
- * @param device Metadata corresponding to the device being enrolled
- * @throws DeviceManagementException If some unusual behaviour is observed while enrolling a device
- */
- boolean enrollDevice(Device device) throws DeviceManagementException;
-
- /**
- * Method to modify the metadata corresponding to device enrollment.
- *
- * @param device Modified device enrollment related metadata
- * @throws DeviceManagementException If some unusual behaviour is observed while modify the enrollment of a
- * device
- */
- boolean modifyEnrollment(Device device) throws DeviceManagementException;
-
- /**
- * Method to disenroll a particular device from CDM.
- *
- * @param deviceId Fully qualified device identifier
- * @throws DeviceManagementException If some unusual behaviour is observed while disenrolling a device
- */
- boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- /**
- * Method to retrieve the status of the registration process of a particular device.
- *
- * @param deviceId Fully qualified device identifier
- * @return Status of enrollment
- * @throws DeviceManagementException If some unusual behaviour is observed while checking the enrollment
- * status of the device
- */
- boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- /**
- * Method to retrieve the status of a particular device.
- *
- * @param deviceId Fully qualified device identifier
- * @return Returns if the device is active
- * @throws DeviceManagementException If some unusual behaviour is observed while checking the status
- * of the device
- */
- boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- /**
- * Method to set the status indicating whether a particular device registered within CDM is enabled at a given
- * moment.
- *
- * @param deviceId Fully qualified device identifier
- * @param status Indicates whether the device is active
- * @throws DeviceManagementException If some unusual behaviour is observed while updating the active status
- * of the device
- */
- boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException;
-
- /**
- * Method to retrieve metadata of all devices registered within CDM corresponding to a particular device type.
- *
- * @return List of metadata corresponding to all devices registered within CDM
- * @throws DeviceManagementException If some unusual behaviour is observed while obtaining the enrolled device list
- */
- List getAllDevices() throws DeviceManagementException;
-
- /**
- * Method to retrieve metadata of a device corresponding to a particular type that carries a specific identifier.
- *
- * @param deviceId Fully qualified device identifier
- * @return Metadata corresponding to a particular device
- * @throws DeviceManagementException If some unusual behaviour is observed obtaining the device object
- */
- Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- /**
- * Method to update device information.
- *
- * @param device Updated device information related data
- * @throws DeviceManagementException If some unusual behaviour is observed while updating the device info
- */
- boolean updateDeviceInfo(Device device) throws DeviceManagementException;
-
- /**
- * Method to set the ownership type of a particular device. i.e. BYOD, COPE.
- *
- * @param deviceId Fully qualified device identifier
- * @param ownershipType Type of ownership
- * @throws DeviceManagementException If some unusual behaviour is observed while setting the ownership
- * of the device
- */
- boolean setOwnership(DeviceIdentifier deviceId, String ownershipType) throws DeviceManagementException;
-
- /**
- * Method to retrieve the Operation manager implementation associated with a given plugin.
- *
- * @return An appropriate instance of the underlying operation management implementation
- * @throws DeviceManagementException
- */
- OperationManager getOperationManager() throws DeviceManagementException;
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
deleted file mode 100644
index f5406926b3..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
- org.wso2.carbon
- device-mgt
- 2.0.0-SNAPSHOT
- ../pom.xml
-
-
- 4.0.0
- org.wso2.carbon
- org.wso2.carbon.device.mgt.core
- 2.0.0-SNAPSHOT
- bundle
- WSO2 Carbon - Device Management Core
- WSO2 Carbon - Device Management Core
- http://wso2.org
-
-
-
-
- org.apache.felix
- maven-scr-plugin
-
-
- org.apache.felix
- maven-bundle-plugin
- 1.4.0
- true
-
-
- ${project.artifactId}
- ${project.artifactId}
- ${project.version}
- Device Management Core Bundle
- org.wso2.carbon.device.mgt.core.internal
-
- org.apache.axis2.*;version="${axis2.osgi.version.range}",
- org.osgi.framework,
- org.osgi.service.component,
- org.apache.commons.logging,
- javax.transaction.*,
-
-
- !org.wso2.carbon.device.mgt.core.internal,
- org.wso2.carbon.device.mgt.core.*
-
- *
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.18
-
-
- src/test/resources/testng.xml
-
-
-
-
-
-
-
-
-
- org.eclipse.osgi
- org.eclipse.osgi
-
-
- org.wso2.carbon
- org.wso2.carbon.device.mgt.common
-
-
- org.wso2.carbon
- org.wso2.carbon.logging
-
-
- org.wso2.carbon
- org.wso2.carbon.utils
-
-
- org.wso2.carbon
- org.wso2.carbon.core
-
-
- com.h2database.wso2
- h2-database-engine
- test
-
-
- org.testng
- testng
-
-
- org.wso2.carbon
- org.wso2.carbon.user.core
-
-
- org.wso2.carbon
- org.wso2.carbon.user.api
-
-
-
-
-
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java
deleted file mode 100644
index 8af1724de7..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.core;
-
-public final class DeviceManagementConstants {
-
- public static final class Common {
- private Common() {
- throw new AssertionError();
- }
- public static final String PROPERTY_SETUP = "setup";
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java
deleted file mode 100644
index d3caebb963..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementRepository.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.core;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
-import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class DeviceManagementRepository {
-
- private static final Log log = LogFactory.getLog(DeviceManagerUtil.class);
- private Map providers;
-
- public DeviceManagementRepository() {
- providers = new HashMap();
- }
-
- public void addDeviceManagementProvider(DeviceManagerService provider) {
- String deviceType = provider.getProviderType();
- try {
- DeviceManagerUtil.registerDeviceType(deviceType);
- } catch (DeviceManagementException e) {
- log.error("Exception occurred while registering the device type.", e);
- }
- providers.put(deviceType, provider);
- }
-
- public void removeDeviceManagementProvider(DeviceManagerService provider) {
- String deviceType = provider.getProviderType();
-
- try {
- DeviceManagerUtil.unregisterDeviceType(deviceType);
- } catch (DeviceManagementException e) {
- log.error("Exception occurred while registering the device type.", e);
- }
- providers.remove(deviceType);
- }
-
- public DeviceManagerService getDeviceManagementProvider(String type) {
- return providers.get(type);
- }
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManager.java
deleted file mode 100644
index ad95758d32..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManager.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core;
-
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.OperationManager;
-import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
-
-import java.util.List;
-
-/**
- * Proxy class for all Device Management related operations that take the corresponding plugin type in
- * and resolve the appropriate plugin implementation
- */
-public interface DeviceManager {
-
- public boolean enrollDevice(Device device) throws DeviceManagementException;
-
- public boolean modifyEnrollment(Device device) throws DeviceManagementException;
-
- public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- public boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- public boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException;
-
- public List getAllDevices(String type) throws DeviceManagementException;
-
- public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
-
- public boolean updateDeviceInfo(Device device) throws DeviceManagementException;
-
- public boolean setOwnership(DeviceIdentifier deviceId, String ownershipType) throws DeviceManagementException;
-
- public OperationManager getOperationManager(String type) throws DeviceManagementException;
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagerImpl.java
deleted file mode 100644
index 37b49b32b0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagerImpl.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core;
-
-import org.wso2.carbon.device.mgt.common.Device;
-import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.common.OperationManager;
-import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
-import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
-import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
-import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
-import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
-import org.wso2.carbon.device.mgt.core.dao.DeviceTypeDAO;
-import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DeviceManagerImpl implements DeviceManager {
-
- private DeviceDAO deviceDAO;
- private DeviceTypeDAO deviceTypeDAO;
- private DeviceManagementConfig config;
- private DeviceManagementRepository pluginRepository;
-
- public DeviceManagerImpl(DeviceManagementConfig config, DeviceManagementRepository pluginRepository) {
- this.config = config;
- this.pluginRepository = pluginRepository;
- this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
- this.deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
- }
-
- @Override
- public boolean enrollDevice(Device device) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(device.getType());
- boolean status = dms.enrollDevice(device);
-
- try {
- org.wso2.carbon.device.mgt.core.dto.Device deviceDto = DeviceManagementDAOUtil.convertDevice(device);
- Integer deviceTypeId = this.getDeviceTypeDAO().getDeviceTypeIdByDeviceTypeName(device.getType());
- deviceDto.setDeviceTypeId(deviceTypeId);
- this.getDeviceDAO().addDevice(deviceDto);
-
- } catch (DeviceManagementDAOException e) {
- throw new DeviceManagementException("Error occurred while enrolling the device '" + device.getId() + "'", e);
- }
- return status;
- }
-
- @Override
- public boolean modifyEnrollment(Device device) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(device.getType());
- boolean status = dms.modifyEnrollment(device);
- try {
- this.getDeviceDAO().updateDevice(DeviceManagementDAOUtil.convertDevice(device));
- } catch (DeviceManagementDAOException e) {
- throw new DeviceManagementException("Error occurred while modifying the device '" + device.getId() + "'",
- e);
- }
- return status;
- }
-
- @Override
- public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.disenrollDevice(deviceId);
- }
-
- @Override
- public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.isEnrolled(deviceId);
- }
-
- @Override
- public boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.isActive(deviceId);
- }
-
- @Override
- public boolean setActive(DeviceIdentifier deviceId, boolean status)
- throws DeviceManagementException {
- DeviceManagerService dms =
- this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.setActive(deviceId, status);
- }
-
- @Override
- public List getAllDevices(String type) throws DeviceManagementException {
- DeviceManagerService dms =
- this.getPluginRepository().getDeviceManagementProvider(type);
- List devicesList = new ArrayList();
- try {
- Integer deviceTypeId = this.getDeviceTypeDAO().getDeviceTypeIdByDeviceTypeName(type);
- List devices =
- this.getDeviceDAO().getDevices(deviceTypeId);
-
- for (org.wso2.carbon.device.mgt.core.dto.Device device : devices) {
- Device convertedDevice = DeviceManagementDAOUtil.convertDevice(device);
- DeviceIdentifier deviceIdentifier = DeviceManagementDAOUtil
- .createDeviceIdentifier(device, this.deviceTypeDAO
- .getDeviceType(device.getDeviceTypeId()));
- Device dmsDevice = dms.getDevice(deviceIdentifier);
- convertedDevice.setProperties(dmsDevice.getProperties());
- convertedDevice.setFeatures(dmsDevice.getFeatures());
- devicesList.add(convertedDevice);
- }
- } catch (DeviceManagementDAOException e) {
- throw new DeviceManagementException("Error occurred while obtaining the device for type '" + type + "'",
- e);
- }
- return devicesList;
- }
-
- @Override
- public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.getDevice(deviceId);
- }
-
- @Override
- public boolean updateDeviceInfo(Device device) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(device.getType());
- return dms.updateDeviceInfo(device);
- }
-
- @Override
- public boolean setOwnership(DeviceIdentifier deviceId, String ownershipType) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(deviceId.getType());
- return dms.setOwnership(deviceId, ownershipType);
- }
-
- public OperationManager getOperationManager(String type) throws DeviceManagementException {
- DeviceManagerService dms = this.getPluginRepository().getDeviceManagementProvider(type);
- return dms.getOperationManager();
- }
-
- public DeviceDAO getDeviceDAO() {
- return deviceDAO;
- }
-
- public DeviceTypeDAO getDeviceTypeDAO() {
- return deviceTypeDAO;
- }
-
- public DeviceManagementRepository getPluginRepository() {
- return pluginRepository;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/LicenseManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/LicenseManager.java
deleted file mode 100644
index 0275a1bc20..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/LicenseManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * * Copyright (c) 2014, 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.core;
-
-import org.wso2.carbon.device.mgt.core.dto.DeviceType;
-
-public class LicenseManager {
-
-/* public void addLicense(DeviceType deviceType,String langCode, String
- );*/
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceConfigurationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceConfigurationManager.java
deleted file mode 100644
index f9f99ffba9..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceConfigurationManager.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.config;
-
-import org.w3c.dom.Document;
-import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
-import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
-import org.wso2.carbon.utils.CarbonUtils;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import java.io.File;
-
-/**
- * Class responsible for the cdm manager configuration initialization
- */
-public class DeviceConfigurationManager {
-
- private DeviceManagementConfig currentDeviceConfig;
- private static DeviceConfigurationManager deviceConfigManager;
-
- private static final String deviceMgtConfigXMLPath = CarbonUtils.getCarbonConfigDirPath() + File.separator +
- DeviceManagementConstants.DataSourceProperties.DEVICE_CONFIG_XML_NAME;
-
- public static DeviceConfigurationManager getInstance() {
- if (deviceConfigManager == null) {
- synchronized (DeviceConfigurationManager.class) {
- if (deviceConfigManager == null) {
- deviceConfigManager = new DeviceConfigurationManager();
- }
- }
- }
- return deviceConfigManager;
- }
-
- public synchronized void initConfig() throws DeviceManagementException {
-
- //catch generic exception.if any exception occurs wrap and throw DeviceManagementException
- try {
- File deviceMgtConfig = new File(deviceMgtConfigXMLPath);
- Document doc = DeviceManagerUtil.convertToDocument(deviceMgtConfig);
-
- /* Un-marshaling Device Management configuration */
- JAXBContext cdmContext = JAXBContext.newInstance(DeviceManagementConfig.class);
- Unmarshaller unmarshaller = cdmContext.createUnmarshaller();
- this.currentDeviceConfig = (DeviceManagementConfig) unmarshaller.unmarshal(doc);
- } catch (Exception e) {
- throw new DeviceManagementException("Error occurred while initializing RSS config", e);
- }
- }
-
- public DeviceManagementConfig getDeviceManagementConfig() {
- return currentDeviceConfig;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java
deleted file mode 100644
index 678f20d8f0..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementConfig.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.config;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Represents Device Mgt configuration.
- */
-@XmlRootElement(name = "DeviceMgtConfiguration")
-public final class DeviceManagementConfig {
-
- private DeviceManagementRepository deviceMgtRepository;
-
- @XmlElement(name = "ManagementRepository", required = true)
- public DeviceManagementRepository getDeviceMgtRepository() {
- return deviceMgtRepository;
- }
-
- public void setDeviceMgtRepository(DeviceManagementRepository deviceMgtRepository) {
- this.deviceMgtRepository = deviceMgtRepository;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementRepository.java
deleted file mode 100644
index a6bd91a519..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/DeviceManagementRepository.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.config;
-
-import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Class for holding management repository data
- */
-@XmlRootElement(name = "ManagementRepository")
-public class DeviceManagementRepository {
-
- private DataSourceConfig dataSourceConfig;
-
- @XmlElement(name = "DataSourceConfiguration", required = false)
- public DataSourceConfig getDataSourceConfig() {
- return dataSourceConfig;
- }
-
- public void setDataSourceConfig(DataSourceConfig dataSourceConfig) {
- this.dataSourceConfig = dataSourceConfig;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java
deleted file mode 100644
index bc7f98e925..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/DataSourceConfig.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.config.datasource;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Class for holding data source configuration in malformed-cdm-config-no-mgt-repo.xml at parsing with JAXB
- */
-@XmlRootElement(name = "DataSourceConfiguration")
-public class DataSourceConfig {
-
- private JNDILookupDefinition jndiLookupDefintion;
-
- @XmlElement(name = "JndiLookupDefinition", required = true)
- public JNDILookupDefinition getJndiLookupDefintion() {
- return jndiLookupDefintion;
- }
-
- public void setJndiLookupDefintion(JNDILookupDefinition jndiLookupDefintion) {
- this.jndiLookupDefintion = jndiLookupDefintion;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java
deleted file mode 100644
index bc85ffb143..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/datasource/JNDILookupDefinition.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- * 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.core.config.datasource;
-
-import javax.xml.bind.annotation.*;
-import java.util.List;
-
-/**
- * Class for hold JndiLookupDefinition of rss-manager.xml at parsing with JAXB
- */
-@XmlRootElement(name = "JndiLookupDefinition")
-public class JNDILookupDefinition {
-
- private String jndiName;
- private List jndiProperties;
-
- @XmlElement(name = "Name", required = false)
- public String getJndiName() {
- return jndiName;
- }
-
- public void setJndiName(String jndiName) {
- this.jndiName = jndiName;
- }
-
- @XmlElementWrapper(name = "Environment", required = false)
- @XmlElement(name = "Property", nillable = false)
- public List getJndiProperties() {
- return jndiProperties;
- }
-
- public void setJndiProperties(List jndiProperties) {
- this.jndiProperties = jndiProperties;
- }
-
- @XmlRootElement(name = "Property")
- public static class JNDIProperty {
-
- private String name;
-
- private String value;
-
- @XmlAttribute(name = "Name")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @XmlValue
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
- }
-
-}
-
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java
deleted file mode 100644
index d99db291a2..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceDAO.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.dao;
-
-import org.wso2.carbon.device.mgt.core.dto.Device;
-import org.wso2.carbon.device.mgt.core.dto.Status;
-
-import java.util.List;
-
-/**
- * This class represents the key operations associated with persisting device related information
- */
-public interface DeviceDAO {
-
- void addDevice(Device device) throws DeviceManagementDAOException;
-
- void updateDevice(Device device) throws DeviceManagementDAOException;
-
- void updateDeviceStatus(Long deviceId, Status status) throws DeviceManagementDAOException;
-
- void deleteDevice(Long deviceId) throws DeviceManagementDAOException;
-
- Device getDeviceByDeviceId(Long deviceId) throws DeviceManagementDAOException;
-
- List getDevices() throws DeviceManagementDAOException;
-
- /**
- * @param type - The device type id.
- * @return a list of devices based on the type id.
- * @throws DeviceManagementDAOException
- */
- List getDevices(Integer type) throws DeviceManagementDAOException;
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOException.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOException.java
deleted file mode 100644
index cb48c3320c..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.dao;
-
-/**
- * Custom exception class for data access related exceptions
- */
-public class DeviceManagementDAOException extends Exception {
-
- private String message;
- private static final long serialVersionUID = 2021891706072918864L;
-
- /**
- * Constructs a new exception with the specified detail message and nested exception.
- *
- * @param message error message
- * @param nestedException exception
- */
- public DeviceManagementDAOException(String message, Exception nestedException) {
- super(message, nestedException);
- setErrorMessage(message);
- }
-
- /**
- * Constructs a new exception with the specified detail message and cause.
- *
- * @param message the detail message.
- * @param cause the cause of this exception.
- */
- public DeviceManagementDAOException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- /**
- * Constructs a new exception with the specified detail message
- *
- * @param message the detail message.
- */
- public DeviceManagementDAOException(String message) {
- super(message);
- setErrorMessage(message);
- }
-
- /**
- * Constructs a new exception with the specified and cause.
- *
- * @param cause the cause of this exception.
- */
- public DeviceManagementDAOException(Throwable cause) {
- super(cause);
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.message = errorMessage;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOFactory.java
deleted file mode 100644
index ae12417d62..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/DeviceManagementDAOFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2014, 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.core.dao;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
-import org.wso2.carbon.device.mgt.core.config.datasource.JNDILookupDefinition;
-import org.wso2.carbon.device.mgt.core.dao.impl.DeviceDAOImpl;
-import org.wso2.carbon.device.mgt.core.dao.impl.DeviceTypeDAOImpl;
-import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
-import javax.sql.DataSource;
-import java.util.Hashtable;
-import java.util.List;
-
-public class DeviceManagementDAOFactory {
-
- private static DataSource dataSource;
- private static final Log log = LogFactory.getLog(DeviceManagementDAOFactory.class);
-
- public static DeviceDAO getDeviceDAO() {
- return new DeviceDAOImpl(dataSource);
- }
-
- public static DeviceTypeDAO getDeviceTypeDAO() {
- return new DeviceTypeDAOImpl(dataSource);
- }
-
- public static void init(DataSourceConfig config) {
- dataSource = resolveDataSource(config);
- }
-
- public static void init(DataSource dtSource) {
- dataSource = dtSource;
- }
-
- /**
- * Resolve data source from the data source definition
- *
- * @param config data source configuration
- * @return data source resolved from the data source definition
- */
- private static DataSource resolveDataSource(DataSourceConfig config) {
- DataSource dataSource = null;
- if (config == null) {
- throw new RuntimeException("Device Management Repository data source configuration " + "is null and " +
- "thus, is not initialized");
- }
- JNDILookupDefinition jndiConfig = config.getJndiLookupDefintion();
- if (jndiConfig != null) {
- if (log.isDebugEnabled()) {
- log.debug("Initializing Device Management Repository data source using the JNDI " +
- "Lookup Definition");
- }
- List jndiPropertyList = jndiConfig.getJndiProperties();
- if (jndiPropertyList != null) {
- Hashtable