From 46b3a8fd83e6e0716a39fab32411098fb0975799 Mon Sep 17 00:00:00 2001 From: manoj Date: Tue, 31 Mar 2015 19:56:55 +0530 Subject: [PATCH] Refractor Plugin DAO factories --- ...leDeviceManagementDAOFactoryInterface.java | 37 ++++++++++++ .../impl/windows/dao/WindowsDAOFactory.java | 60 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/MobileDeviceManagementDAOFactoryInterface.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/dao/WindowsDAOFactory.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/MobileDeviceManagementDAOFactoryInterface.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/MobileDeviceManagementDAOFactoryInterface.java new file mode 100644 index 000000000..3dd2336ef --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/dao/MobileDeviceManagementDAOFactoryInterface.java @@ -0,0 +1,37 @@ +/* + * 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.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig; + +public interface MobileDeviceManagementDAOFactoryInterface { + + public MobileDeviceDAO getMobileDeviceDAO(); + + public MobileOperationDAO getMobileOperationDAO(); + + public MobileOperationPropertyDAO getMobileOperationPropertyDAO(); + + public MobileDeviceOperationMappingDAO getMobileDeviceOperationDAO(); + + public MobileFeatureDAO getMobileFeatureDao(); + + public MobileFeaturePropertyDAO getFeaturePropertyDAO(); + +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/dao/WindowsDAOFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/dao/WindowsDAOFactory.java new file mode 100644 index 000000000..27417a6d7 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/dao/WindowsDAOFactory.java @@ -0,0 +1,60 @@ +/* + * 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.impl.windows.dao; + +import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig; +import org.wso2.carbon.device.mgt.mobile.dao.*; + +public class WindowsDAOFactory extends MobileDeviceManagementDAOFactory + implements MobileDeviceManagementDAOFactoryInterface { + + public static void init(MobileDataSourceConfig config) { + dataSource = resolveDataSource(config); + } + + @Override + public MobileDeviceDAO getMobileDeviceDAO() { + return null; + } + + @Override + public MobileOperationDAO getMobileOperationDAO() { + return null; + } + + @Override + public MobileOperationPropertyDAO getMobileOperationPropertyDAO() { + return null; + } + + @Override + public MobileDeviceOperationMappingDAO getMobileDeviceOperationDAO() { + return null; + } + + @Override + public MobileFeatureDAO getMobileFeatureDao() { + return null; + } + + @Override + public MobileFeaturePropertyDAO getFeaturePropertyDAO() { + return null; + } +}