mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Move IOS plugin to ios proprietary repo
This commit is contained in:
parent
c070c0c599
commit
e3f3753e7e
@ -63,7 +63,7 @@ public abstract class MobileDeviceManagementDAOFactory implements MobileDeviceMa
|
|||||||
* @param config Mobile data source configuration
|
* @param config Mobile data source configuration
|
||||||
* @return data source resolved from the data source definition
|
* @return data source resolved from the data source definition
|
||||||
*/
|
*/
|
||||||
protected static DataSource resolveDataSource(MobileDataSourceConfig config) {
|
public static DataSource resolveDataSource(MobileDataSourceConfig config) {
|
||||||
DataSource dataSource = null;
|
DataSource dataSource = null;
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
throw new RuntimeException("Device Management Repository data source configuration " +
|
throw new RuntimeException("Device Management Repository data source configuration " +
|
||||||
@ -111,7 +111,7 @@ public abstract class MobileDeviceManagementDAOFactory implements MobileDeviceMa
|
|||||||
|
|
||||||
private static void assertDataSourceInitialization() {
|
private static void assertDataSourceInitialization() {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
throw new DataSourceNotAvailableException("Mobile device management metadata repository datasource " +
|
throw new DataSourceNotAvailableException("Mobile device management metadata repository data source " +
|
||||||
"is not initialized");
|
"is not initialized");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ public abstract class MobileDeviceManagementDAOFactory implements MobileDeviceMa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new MobileDeviceManagementDAOException("Error occurred while rollbacking the transaction", e);
|
throw new MobileDeviceManagementDAOException("Error occurred while rollback the transaction", e);
|
||||||
} finally {
|
} finally {
|
||||||
closeConnection();
|
closeConnection();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.mobile.impl.android.dao;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
|
import org.wso2.carbon.device.mgt.mobile.config.datasource.MobileDataSourceConfig;
|
||||||
import org.wso2.carbon.device.mgt.mobile.dao.*;
|
import org.wso2.carbon.device.mgt.mobile.dao.*;
|
||||||
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.impl.AndroidDeviceDAOImpl;
|
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.impl.AndroidDeviceDAOImpl;
|
||||||
@ -33,8 +34,9 @@ public class AndroidDAOFactory extends MobileDeviceManagementDAOFactory
|
|||||||
private static final Log log = LogFactory.getLog(AndroidDAOFactory.class);
|
private static final Log log = LogFactory.getLog(AndroidDAOFactory.class);
|
||||||
private static DataSource dataSource;
|
private static DataSource dataSource;
|
||||||
|
|
||||||
public static void init(MobileDataSourceConfig config) {
|
public static void init() {
|
||||||
dataSource = resolveDataSource(config);
|
dataSource = MobileDeviceManagementDAOFactory.getDataSource(DeviceManagementConstants.MobileDeviceTypes.
|
||||||
|
MOBILE_DEVICE_TYPE_ANDROID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import org.osgi.framework.BundleContext;
|
|||||||
import org.osgi.framework.ServiceRegistration;
|
import org.osgi.framework.ServiceRegistration;
|
||||||
import org.osgi.service.component.ComponentContext;
|
import org.osgi.service.component.ComponentContext;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
|
|
||||||
import org.wso2.carbon.device.mgt.common.spi.DeviceMgtService;
|
import org.wso2.carbon.device.mgt.common.spi.DeviceMgtService;
|
||||||
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.config.MobileDeviceConfigurationManager;
|
import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceConfigurationManager;
|
||||||
@ -76,10 +75,9 @@ public class MobileDeviceManagementServiceComponent {
|
|||||||
Map<String, MobileDataSourceConfig> dsConfigMap =
|
Map<String, MobileDataSourceConfig> dsConfigMap =
|
||||||
config.getMobileDeviceMgtRepository().getMobileDataSourceConfigMap();
|
config.getMobileDeviceMgtRepository().getMobileDataSourceConfigMap();
|
||||||
MobileDeviceManagementDAOFactory.setMobileDataSourceConfigMap(dsConfigMap);
|
MobileDeviceManagementDAOFactory.setMobileDataSourceConfigMap(dsConfigMap);
|
||||||
|
MobileDeviceManagementDAOFactory.init();
|
||||||
|
|
||||||
AndroidDAOFactory
|
AndroidDAOFactory.init();
|
||||||
.init(dsConfigMap.get(DeviceManagementConstants.MobileDeviceTypes.
|
|
||||||
MOBILE_DEVICE_TYPE_ANDROID));
|
|
||||||
|
|
||||||
String setupOption = System.getProperty("setup");
|
String setupOption = System.getProperty("setup");
|
||||||
if (setupOption != null) {
|
if (setupOption != null) {
|
||||||
@ -89,8 +87,7 @@ public class MobileDeviceManagementServiceComponent {
|
|||||||
"to begin");
|
"to begin");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Map<String, DataSource> dataSourceMap = MobileDeviceManagementDAOFactory.
|
Map<String, DataSource> dataSourceMap = MobileDeviceManagementDAOFactory.getDataSourceMap();
|
||||||
getDataSourceMap();
|
|
||||||
for (DataSource dataSource : dataSourceMap.values()) {
|
for (DataSource dataSource : dataSourceMap.values()) {
|
||||||
MobileDeviceManagementDAOUtil
|
MobileDeviceManagementDAOUtil
|
||||||
.setupMobileDeviceManagementSchema(dataSource);
|
.setupMobileDeviceManagementSchema(dataSource);
|
||||||
|
|||||||
@ -20,11 +20,6 @@
|
|||||||
<MobileDeviceMgtConfiguration>
|
<MobileDeviceMgtConfiguration>
|
||||||
<ManagementRepository>
|
<ManagementRepository>
|
||||||
<DataSourceConfigurations>
|
<DataSourceConfigurations>
|
||||||
<DataSourceConfiguration type="ios">
|
|
||||||
<JndiLookupDefinition>
|
|
||||||
<Name>jdbc/MobileIOSDM_DS</Name>
|
|
||||||
</JndiLookupDefinition>
|
|
||||||
</DataSourceConfiguration>
|
|
||||||
<DataSourceConfiguration type="android">
|
<DataSourceConfiguration type="android">
|
||||||
<JndiLookupDefinition>
|
<JndiLookupDefinition>
|
||||||
<Name>jdbc/MobileAndroidDM_DS</Name>
|
<Name>jdbc/MobileAndroidDM_DS</Name>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user