refactored code issues

revert-dabc3590
hasuniea 9 years ago
parent 023d019864
commit b644edd5b0

@ -25,12 +25,14 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager; import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManager;
import org.wso2.carbon.device.mgt.extensions.license.mgt.registry.RegistryBasedLicenseManager;
import org.wso2.carbon.device.mgt.mobile.common.MobileDeviceMgtPluginException; import org.wso2.carbon.device.mgt.mobile.common.MobileDeviceMgtPluginException;
import org.wso2.carbon.device.mgt.mobile.common.MobilePluginConstants; import org.wso2.carbon.device.mgt.mobile.common.MobilePluginConstants;
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice; import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice;
import org.wso2.carbon.device.mgt.mobile.impl.windows.dao.WindowsDAOFactory; import org.wso2.carbon.device.mgt.mobile.impl.windows.dao.WindowsDAOFactory;
import org.wso2.carbon.device.mgt.mobile.impl.windows.util.WindowsPluginUtils;
import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil; import org.wso2.carbon.device.mgt.mobile.util.MobileDeviceManagementUtil;
import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.RegistryException;
import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.api.Resource;
@ -54,13 +56,13 @@ public class WindowsDeviceManager implements DeviceManager {
public WindowsDeviceManager() { public WindowsDeviceManager() {
this.daoFactory = new WindowsDAOFactory(); this.daoFactory = new WindowsDAOFactory();
//this.licenseManager = new RegistryBasedLicenseManager(); this.licenseManager = new RegistryBasedLicenseManager();
// License defaultLicense = WindowsPluginUtils.getDefaultLicense(); License defaultLicense = WindowsPluginUtils.getDefaultLicense();
// try { try {
// licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense); licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense);
// } catch (LicenseManagementException e) { } catch (LicenseManagementException e) {
// log.error("Error occurred while adding default license for Windows devices", e); log.error("Error occurred while adding default license for Windows devices", e);
// } }
} }
@Override @Override
@ -245,8 +247,7 @@ public class WindowsDeviceManager implements DeviceManager {
@Override @Override
public License getLicense(String languageCode) throws LicenseManagementException { public License getLicense(String languageCode) throws LicenseManagementException {
// return licenseManager.getLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, languageCode); return licenseManager.getLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, languageCode);
return null;
} }
@Override @Override

@ -53,7 +53,8 @@ public class WindowsDeviceDAOImpl implements MobileDeviceDAO {
conn = WindowsDAOFactory.getConnection(); conn = WindowsDAOFactory.getConnection();
String selectDBQuery = String selectDBQuery =
"SELECT MOBILE_DEVICE_ID, CHANNEL_URI, DEVICE_INFO, IMEI, IMSI, " + "SELECT MOBILE_DEVICE_ID, CHANNEL_URI, DEVICE_INFO, IMEI, IMSI, " +
"OS_VERSION, DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE, SERIAL, MAC_ADDRESS, OS_VERSION, DEVICE_NAME " + "OS_VERSION, DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE, SERIAL, MAC_ADDRESS," +
" OS_VERSION, DEVICE_NAME " +
"FROM WINDOWS_DEVICE WHERE MOBILE_DEVICE_ID = ?"; "FROM WINDOWS_DEVICE WHERE MOBILE_DEVICE_ID = ?";
stmt = conn.prepareStatement(selectDBQuery); stmt = conn.prepareStatement(selectDBQuery);
stmt.setString(1, mblDeviceId); stmt.setString(1, mblDeviceId);
@ -214,7 +215,8 @@ public class WindowsDeviceDAOImpl implements MobileDeviceDAO {
conn = WindowsDAOFactory.getConnection(); conn = WindowsDAOFactory.getConnection();
String selectDBQuery = String selectDBQuery =
"SELECT MOBILE_DEVICE_ID, CHANNEL_URI, DEVICE_INFO, IMEI, IMSI, " + "SELECT MOBILE_DEVICE_ID, CHANNEL_URI, DEVICE_INFO, IMEI, IMSI, " +
"OS_VERSION, DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE, SERIAL, MAC_ADDRESS, OS_VERSION, DEVICE_NAME " + "OS_VERSION, DEVICE_MODEL, VENDOR, LATITUDE, LONGITUDE, SERIAL, MAC_ADDRESS," +
" OS_VERSION, DEVICE_NAME " +
"FROM WINDOWS_DEVICE"; "FROM WINDOWS_DEVICE";
stmt = conn.prepareStatement(selectDBQuery); stmt = conn.prepareStatement(selectDBQuery);
rs = stmt.executeQuery(); rs = stmt.executeQuery();

@ -1,3 +1,22 @@
/*
* 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.util; package org.wso2.carbon.device.mgt.mobile.impl.windows.util;
import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.License;

Loading…
Cancel
Save