mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
refactored code issues
This commit is contained in:
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.LicenseManagementException;
|
||||
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.MobilePluginConstants;
|
||||
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.dto.MobileDevice;
|
||||
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.registry.api.RegistryException;
|
||||
import org.wso2.carbon.registry.api.Resource;
|
||||
@ -54,13 +56,13 @@ public class WindowsDeviceManager implements DeviceManager {
|
||||
|
||||
public WindowsDeviceManager() {
|
||||
this.daoFactory = new WindowsDAOFactory();
|
||||
//this.licenseManager = new RegistryBasedLicenseManager();
|
||||
// License defaultLicense = WindowsPluginUtils.getDefaultLicense();
|
||||
// try {
|
||||
// licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense);
|
||||
// } catch (LicenseManagementException e) {
|
||||
// log.error("Error occurred while adding default license for Windows devices", e);
|
||||
// }
|
||||
this.licenseManager = new RegistryBasedLicenseManager();
|
||||
License defaultLicense = WindowsPluginUtils.getDefaultLicense();
|
||||
try {
|
||||
licenseManager.addLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, defaultLicense);
|
||||
} catch (LicenseManagementException e) {
|
||||
log.error("Error occurred while adding default license for Windows devices", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -245,8 +247,7 @@ public class WindowsDeviceManager implements DeviceManager {
|
||||
|
||||
@Override
|
||||
public License getLicense(String languageCode) throws LicenseManagementException {
|
||||
// return licenseManager.getLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, languageCode);
|
||||
return null;
|
||||
return licenseManager.getLicense(WindowsDeviceManagementService.DEVICE_TYPE_WINDOWS, languageCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -53,7 +53,8 @@ public class WindowsDeviceDAOImpl implements MobileDeviceDAO {
|
||||
conn = WindowsDAOFactory.getConnection();
|
||||
String selectDBQuery =
|
||||
"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 = ?";
|
||||
stmt = conn.prepareStatement(selectDBQuery);
|
||||
stmt.setString(1, mblDeviceId);
|
||||
@ -214,7 +215,8 @@ public class WindowsDeviceDAOImpl implements MobileDeviceDAO {
|
||||
conn = WindowsDAOFactory.getConnection();
|
||||
String selectDBQuery =
|
||||
"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";
|
||||
stmt = conn.prepareStatement(selectDBQuery);
|
||||
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;
|
||||
|
||||
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user