diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml
deleted file mode 100644
index c91d9b7df..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/pom.xml
+++ /dev/null
@@ -1,173 +0,0 @@
-
-
-
-
-
-
- device-mgt
- org.wso2.carbon.devicemgt-plugins
- 2.1.0-SNAPSHOT
- ../pom.xml
-
-
- 4.0.0
- org.wso2.carbon.devicemgt-plugins
- org.wso2.carbon.device.mgt.mobile.impl
- 2.1.0-SNAPSHOT
- bundle
- WSO2 Carbon - Mobile Device Management Impl
- WSO2 Carbon - Mobile Device Management Impl
- http://wso2.org
-
-
-
-
- org.apache.felix
- maven-scr-plugin
-
-
- org.apache.felix
- maven-bundle-plugin
- 1.4.0
- true
-
-
- ${project.artifactId}
- ${project.artifactId}
- ${carbon.mobile.device.mgt.version}
- Device Management Mobile Impl Bundle
- org.wso2.carbon.device.mgt.mobile.internal
-
- org.osgi.framework,
- org.osgi.service.component,
- org.apache.commons.logging,
- javax.xml.bind.*,
- javax.naming,
- javax.sql,
- javax.xml.parsers,
- org.w3c.dom,
- org.wso2.carbon.context,
- org.wso2.carbon.utils.*,
- org.wso2.carbon.device.mgt.common.*,
- org.wso2.carbon.ndatasource.core,
- org.wso2.carbon.policy.mgt.common.*,
- org.wso2.carbon.registry.core,
- org.wso2.carbon.registry.core.service,
- org.wso2.carbon.registry.core.session,
- org.wso2.carbon.registry.api,
- org.wso2.carbon.device.mgt.extensions.license.mgt.registry,
- com.google.gson.*,
-
-
- !org.wso2.carbon.device.mgt.mobile.internal,
- !org.wso2.carbon.device.mgt.mobile.impl,
- org.wso2.carbon.device.mgt.mobile.*,
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.18
-
-
- file:src/test/resources/log4j.properties
-
-
-
- src/test/resources/testng.xml
-
-
-
-
-
-
-
-
- org.eclipse.osgi
- org.eclipse.osgi
-
-
- org.eclipse.osgi
- org.eclipse.osgi.services
-
-
- org.wso2.carbon
- org.wso2.carbon.core
-
-
- org.wso2.carbon
- org.wso2.carbon.logging
-
-
- org.wso2.carbon
- org.wso2.carbon.utils
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.common
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.device.mgt.extensions
-
-
- org.wso2.carbon
- org.wso2.carbon.ndatasource.core
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.policy.mgt.common
-
-
- org.wso2.carbon.devicemgt
- org.wso2.carbon.policy.mgt.core
-
-
- org.wso2.carbon
- org.wso2.carbon.registry.api
-
-
- org.wso2.carbon
- org.wso2.carbon.registry.core
-
-
- org.testng
- testng
-
-
- org.apache.tomcat.wso2
- jdbc-pool
-
-
- com.h2database.wso2
- h2-database-engine
- test
-
-
- com.google.code.gson
- gson
-
-
- com.google.android.gcm
- gcm-server
-
-
-
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java
deleted file mode 100644
index 1bf5322da..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.wso2.carbon.device.mgt.mobile;
-
-import org.wso2.carbon.device.mgt.common.*;
-import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
-import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
-import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager;
-
-import java.util.List;
-
-public abstract class AbstractMobileOperationManager implements OperationManager {
-
- @Override
- public List getOperations(DeviceIdentifier deviceIdentifier) throws OperationManagementException {
- return null;
- }
-
- @Override
- public int addOperation(Operation operation, List devices) throws
- OperationManagementException {
- return 1;
- }
-
-}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/DataSourceNotAvailableException.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/DataSourceNotAvailableException.java
deleted file mode 100644
index 5a9e5b8f4..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/DataSourceNotAvailableException.java
+++ /dev/null
@@ -1,52 +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.mobile;
-
-public class DataSourceNotAvailableException extends RuntimeException {
-
- private String message;
- private static final long serialVersionUID = 2021891706072918866L;
-
- public DataSourceNotAvailableException(String message, Exception nestedException) {
- super(message, nestedException);
- setErrorMessage(message);
- }
-
- public DataSourceNotAvailableException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public DataSourceNotAvailableException(String message) {
- super(message);
- setErrorMessage(message);
- }
-
- public DataSourceNotAvailableException(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.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobileDeviceMgtPluginException.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobileDeviceMgtPluginException.java
deleted file mode 100644
index ef2871c28..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobileDeviceMgtPluginException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-package org.wso2.carbon.device.mgt.mobile.common;
-
-
-public class MobileDeviceMgtPluginException extends Exception{
-
- private static final long serialVersionUID = -2297311387874900305L;
- private String errorMessage;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
- public MobileDeviceMgtPluginException(String msg, Exception nestedEx) {
- super(msg, nestedEx);
- setErrorMessage(msg);
- }
-
- public MobileDeviceMgtPluginException(String message, Throwable cause) {
- super(message, cause);
- setErrorMessage(message);
- }
-
- public MobileDeviceMgtPluginException(String msg) {
- super(msg);
- setErrorMessage(msg);
- }
-
- public MobileDeviceMgtPluginException() {
- super();
- }
-
- public MobileDeviceMgtPluginException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobilePluginConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobilePluginConstants.java
deleted file mode 100644
index 67e793fa5..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/common/MobilePluginConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.wso2.carbon.device.mgt.mobile.common;
-
-public class MobilePluginConstants {
- public static final String MOBILE_DB_SCRIPTS_FOLDER = "cdm";
- public static final String MOBILE_CONFIG_REGISTRY_ROOT = "/_system/config";
-
- public static final String MEDIA_TYPE_XML = "application/xml";
- public static final String CHARSET_UTF8 = "UTF8";
- public static final String LANGUAGE_CODE_ENGLISH_US = "en_US";
- public static final String LANGUAGE_CODE_ENGLISH_UK = "en_UK";
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceConfigurationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceConfigurationManager.java
deleted file mode 100644
index 07123434d..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceConfigurationManager.java
+++ /dev/null
@@ -1,79 +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.mobile.config;
-
-import org.w3c.dom.Document;
-import org.wso2.carbon.device.mgt.common.DeviceManagementException;
-import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil;
-import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
-import org.wso2.carbon.utils.CarbonUtils;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import java.io.File;
-
-/**
- * Class responsible for the mobile device manager configuration initialization.
- */
-public class MobileDeviceConfigurationManager {
-
- private static final String MOBILE_DEVICE_CONFIG_XML_NAME = "mobile-config.xml";
- private static final String MOBILE_DEVICE_PLUGIN_DIRECTORY = "mobile";
- private static final String DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY = "device-mgt-plugin-configs";
- private MobileDeviceManagementConfig currentMobileDeviceConfig;
- private static MobileDeviceConfigurationManager mobileDeviceConfigManager;
-
- private final String mobileDeviceMgtConfigXMLPath =
- CarbonUtils.getEtcCarbonConfigDirPath() + File.separator +
- DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY +
- File.separator +
- MOBILE_DEVICE_PLUGIN_DIRECTORY + File.separator + MOBILE_DEVICE_CONFIG_XML_NAME;
-
- public static MobileDeviceConfigurationManager getInstance() {
- if (mobileDeviceConfigManager == null) {
- synchronized (MobileDeviceConfigurationManager.class) {
- if (mobileDeviceConfigManager == null) {
- mobileDeviceConfigManager = new MobileDeviceConfigurationManager();
- }
- }
- }
- return mobileDeviceConfigManager;
- }
-
- public synchronized void initConfig() throws DeviceManagementException {
- try {
- File mobileDeviceMgtConfig = new File(mobileDeviceMgtConfigXMLPath);
- Document doc = MobileDeviceManagementUtil.convertToDocument(mobileDeviceMgtConfig);
- JAXBContext mobileDeviceMgmtContext =
- JAXBContext.newInstance(MobileDeviceManagementConfig.class);
- Unmarshaller unmarshaller = mobileDeviceMgmtContext.createUnmarshaller();
- this.currentMobileDeviceConfig =
- (MobileDeviceManagementConfig) unmarshaller.unmarshal(doc);
- } catch (Exception e) {
- throw new DeviceManagementException(
- "Error occurred while initializing Mobile Device Management config", e);
- }
- }
-
- public MobileDeviceManagementConfig getMobileDeviceManagementConfig() {
- return currentMobileDeviceConfig;
- }
-
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementConfig.java
deleted file mode 100644
index ced99f955..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementConfig.java
+++ /dev/null
@@ -1,42 +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.mobile.config;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Represents Mobile Device Mgt configuration.
- */
-@XmlRootElement(name = "MobileDeviceMgtConfiguration")
-public final class MobileDeviceManagementConfig {
-
- private MobileDeviceManagementRepository mobileDeviceMgtRepository;
-
- @XmlElement(name = "ManagementRepository", nillable = false)
- public MobileDeviceManagementRepository getMobileDeviceMgtRepository() {
- return mobileDeviceMgtRepository;
- }
-
- public void setMobileDeviceMgtRepository(
- MobileDeviceManagementRepository mobileDeviceMgtRepository) {
- this.mobileDeviceMgtRepository = mobileDeviceMgtRepository;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementRepository.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementRepository.java
deleted file mode 100644
index 88369dd84..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/MobileDeviceManagementRepository.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.mobile.config;
-
-import org.wso2.carbon.device.mgt.mobile.config.datasource.DataSourceConfigAdapter;
-import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Class for holding management repository data.
- */
-@XmlRootElement(name = "ManagementRepository")
-public class MobileDeviceManagementRepository {
-
- private Map mobileDataSourceConfigMap;
- private List mobileDataSourceConfigs;
-
- public MobileDataSourceConfig getMobileDataSourceConfig(String provider) {
- return mobileDataSourceConfigMap.get(provider);
- }
-
- @XmlElement(name = "DataSourceConfigurations")
- @XmlJavaTypeAdapter(DataSourceConfigAdapter.class)
- public Map getMobileDataSourceConfigMap() {
- return mobileDataSourceConfigMap;
- }
-
- public void setMobileDataSourceConfigMap(Map mobileDataSourceConfigMap) {
- this.mobileDataSourceConfigMap = mobileDataSourceConfigMap;
- }
-
- public List getMobileDataSourceConfigs() {
- return (List) mobileDataSourceConfigMap.values();
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/DataSourceConfigAdapter.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/DataSourceConfigAdapter.java
deleted file mode 100644
index 71675785c..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/DataSourceConfigAdapter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.wso2.carbon.device.mgt.mobile.config.datasource;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DataSourceConfigAdapter
- extends XmlAdapter> {
-
- @Override
- public Map unmarshal(MobileDataSourceConfigurations mobileDataSourceConfigurations)
- throws Exception {
-
- Map mobileDataSourceConfigMap = new HashMap();
- for (MobileDataSourceConfig mobileDataSourceConfig : mobileDataSourceConfigurations
- .getMobileDataSourceConfigs()) {
- mobileDataSourceConfigMap.put(mobileDataSourceConfig.getType(), mobileDataSourceConfig);
- }
- return mobileDataSourceConfigMap;
- }
-
- @Override
- public MobileDataSourceConfigurations marshal(Map mobileDataSourceConfigMap)
- throws Exception {
-
- MobileDataSourceConfigurations mobileDataSourceConfigurations = new MobileDataSourceConfigurations();
- mobileDataSourceConfigurations.setMobileDataSourceConfigs(
- (List) mobileDataSourceConfigMap.values());
-
- return mobileDataSourceConfigurations;
- }
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/JNDILookupDefinition.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/JNDILookupDefinition.java
deleted file mode 100644
index 603adcedd..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/JNDILookupDefinition.java
+++ /dev/null
@@ -1,79 +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.mobile.config.datasource;
-
-import javax.xml.bind.annotation.*;
-import java.util.List;
-
-/**
- * Class for hold JndiLookupDefinition of mobile-config.xml at parsing with JAXB.
- */
-@XmlRootElement(name = "JndiLookupDefinition")
-public class JNDILookupDefinition {
-
- private String jndiName;
- private List jndiProperties;
-
- @XmlElement(name = "Name", nillable = false)
- public String getJndiName() {
- return jndiName;
- }
-
- public void setJndiName(String jndiName) {
- this.jndiName = jndiName;
- }
-
- @XmlElementWrapper(name = "Environment", nillable = 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.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfig.java
deleted file mode 100644
index 869aaf12e..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfig.java
+++ /dev/null
@@ -1,51 +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.mobile.config.datasource;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Class for holding data source configuration in mobile-config.xml at parsing with JAXB.
- */
-@XmlRootElement(name = "DataSourceConfiguration")
-public class MobileDataSourceConfig {
-
- private JNDILookupDefinition jndiLookupDefinition;
- private String type;
-
- @XmlElement(name = "JndiLookupDefinition", nillable = true)
- public JNDILookupDefinition getJndiLookupDefinition() {
- return jndiLookupDefinition;
- }
-
- public void setJndiLookupDefinition(JNDILookupDefinition jndiLookupDefinition) {
- this.jndiLookupDefinition = jndiLookupDefinition;
- }
-
- @XmlAttribute(name = "type")
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfigurations.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfigurations.java
deleted file mode 100644
index 17e80f5bf..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/datasource/MobileDataSourceConfigurations.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.wso2.carbon.device.mgt.mobile.config.datasource;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement(name = "DataSourceConfigurations")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class MobileDataSourceConfigurations {
-
- @XmlElement(name = "DataSourceConfiguration", nillable = true)
- private List mobileDataSourceConfigs;
-
- public List getMobileDataSourceConfigs() {
- return mobileDataSourceConfigs;
- }
-
- public void setMobileDataSourceConfigs(List mobileDataSourceConfigs) {
- this.mobileDataSourceConfigs = mobileDataSourceConfigs;
- }
-
-}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/AbstractMobileDeviceManagementDAOFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/AbstractMobileDeviceManagementDAOFactory.java
deleted file mode 100644
index 32bcb8de7..000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/AbstractMobileDeviceManagementDAOFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * you may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.wso2.carbon.device.mgt.mobile.dao;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.device.mgt.mobile.common.MobileDeviceMgtPluginException;
-import org.wso2.carbon.device.mgt.mobile.config.datasource.JNDILookupDefinition;
-import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
-import org.wso2.carbon.device.mgt.mobile.dao.util.MobileDeviceManagementDAOUtil;
-
-import javax.sql.DataSource;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Factory class used to create MobileDeviceManagement related DAO objects.
- */
-public abstract class AbstractMobileDeviceManagementDAOFactory implements MobileDeviceManagementDAOFactory {
-
- private static final Log log = LogFactory.getLog(AbstractMobileDeviceManagementDAOFactory.class);
- private static Map dataSourceMap = new HashMap<>();
- private static boolean isInitialized;
-
- public static void init(Map mobileDataSourceConfigMap)
- throws MobileDeviceMgtPluginException {
- DataSource dataSource;
- for (String pluginType : mobileDataSourceConfigMap.keySet()) {
- if (dataSourceMap.get(pluginType) == null) {
- dataSource = AbstractMobileDeviceManagementDAOFactory.resolveDataSource(mobileDataSourceConfigMap.get
- (pluginType));
- dataSourceMap.put(pluginType, dataSource);
- }
- }
- isInitialized = true;
- }
-
- public static void init(String key, MobileDataSourceConfig mobileDataSourceConfig) throws
- MobileDeviceMgtPluginException {
- DataSource dataSource = AbstractMobileDeviceManagementDAOFactory.resolveDataSource(mobileDataSourceConfig);
- dataSourceMap.put(key, dataSource);
- }
-
- /**
- * Resolve data source from the data source definition.
- *
- * @param config Mobile data source configuration
- * @return data source resolved from the data source definition
- */
- public static DataSource resolveDataSource(MobileDataSourceConfig 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.getJndiLookupDefinition();
- 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