APP Manager integration and move IOS related functionality to IOS plugin

revert-dabc3590
manoj 10 years ago
parent 028241f518
commit 18d3b0d20d

@ -70,6 +70,7 @@
</Import-Package> </Import-Package>
<Export-Package> <Export-Package>
!org.wso2.carbon.device.mgt.mobile.internal, !org.wso2.carbon.device.mgt.mobile.internal,
!org.wso2.carbon.device.mgt.mobile.impl,
org.wso2.carbon.device.mgt.mobile.*, org.wso2.carbon.device.mgt.mobile.*,
</Export-Package> </Export-Package>
</instructions> </instructions>

@ -25,8 +25,6 @@ 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.JNDILookupDefinition;
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.util.MobileDeviceManagementDAOUtil; import org.wso2.carbon.device.mgt.mobile.dao.util.MobileDeviceManagementDAOUtil;
import org.wso2.carbon.device.mgt.mobile.impl.ios.dao.FeatureManagementDAOException;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;

@ -21,7 +21,10 @@ package org.wso2.carbon.device.mgt.mobile.impl.android;
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.*; import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnectorException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
import org.wso2.carbon.device.mgt.common.spi.DeviceMgtService;
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;
@ -34,7 +37,7 @@ import java.util.List;
/** /**
* This represents the Android implementation of DeviceManagerService. * This represents the Android implementation of DeviceManagerService.
*/ */
public class AndroidDeviceManager implements DeviceManager { public class AndroidDeviceManager implements DeviceMgtService {
private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory; private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory;
private static final Log log = LogFactory.getLog(AndroidDeviceManager.class); private static final Log log = LogFactory.getLog(AndroidDeviceManager.class);
@ -209,4 +212,9 @@ public class AndroidDeviceManager implements DeviceManager {
return devices; return devices;
} }
@Override
public void installApplication(Operation operation, List<DeviceIdentifier> deviceIdentifiers)
throws AppManagerConnectorException {
}
} }

@ -46,8 +46,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO {
} }
@Override @Override
public boolean addFeature(MobileFeature mobileFeature) throws public boolean addFeature(MobileFeature mobileFeature) throws MobileDeviceManagementDAOException {
MobileDeviceManagementDAOException {
PreparedStatement stmt = null; PreparedStatement stmt = null;
boolean status = false; boolean status = false;
Connection conn = null; Connection conn = null;
@ -73,8 +72,7 @@ public class AndroidFeatureDAOImpl implements MobileFeatureDAO {
} }
@Override @Override
public boolean updateFeature(MobileFeature mobileFeature) throws public boolean updateFeature(MobileFeature mobileFeature) throws MobileDeviceManagementDAOException {
MobileDeviceManagementDAOException {
boolean status = false; boolean status = false;
Connection conn = null; Connection conn = null;
PreparedStatement stmt = null; PreparedStatement stmt = null;

@ -21,7 +21,10 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows;
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.*; import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.app.mgt.AppManagerConnectorException;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import org.wso2.carbon.device.mgt.common.spi.DeviceManager;
import org.wso2.carbon.device.mgt.common.spi.DeviceMgtService;
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;
@ -33,7 +36,7 @@ import java.util.List;
/** /**
* This represents the Windows implementation of DeviceManagerService. * This represents the Windows implementation of DeviceManagerService.
*/ */
public class WindowsDeviceManager implements DeviceManager { public class WindowsDeviceManager implements DeviceMgtService {
private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory; private MobileDeviceManagementDAOFactory mobileDeviceManagementDAOFactory;
@ -114,4 +117,9 @@ public class WindowsDeviceManager implements DeviceManager {
return status; return status;
} }
@Override
public void installApplication(Operation operation, List<DeviceIdentifier> deviceIdentifiers)
throws AppManagerConnectorException {
}
} }

@ -28,7 +28,6 @@ import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceManagementConfig;
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.MobileDeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManager; import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManager;
import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManager;
import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManager; import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManager;
import java.util.ArrayList; import java.util.ArrayList;
@ -41,7 +40,6 @@ import java.util.Map;
public class MobileDeviceManagementBundleActivator implements BundleActivator, BundleListener { public class MobileDeviceManagementBundleActivator implements BundleActivator, BundleListener {
private ServiceRegistration androidServiceRegRef; private ServiceRegistration androidServiceRegRef;
private ServiceRegistration iOSServiceRegRef;
private ServiceRegistration windowsServiceRegRef; private ServiceRegistration windowsServiceRegRef;
private static List<DataSourceListener> dataSourceListeners = private static List<DataSourceListener> dataSourceListeners =
@ -70,9 +68,6 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
androidServiceRegRef = androidServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(), bundleContext.registerService(DeviceManager.class.getName(),
new AndroidDeviceManager(), null); new AndroidDeviceManager(), null);
iOSServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(),
new IOSDeviceManager(), null);
windowsServiceRegRef = windowsServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(), bundleContext.registerService(DeviceManager.class.getName(),
new WindowsDeviceManager(), null); new WindowsDeviceManager(), null);
@ -92,7 +87,6 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
} }
try { try {
androidServiceRegRef.unregister(); androidServiceRegRef.unregister();
iOSServiceRegRef.unregister();
windowsServiceRegRef.unregister(); windowsServiceRegRef.unregister();
bundleContext.removeBundleListener(this); bundleContext.removeBundleListener(this);

@ -33,8 +33,6 @@ import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.mobile.dao.util.MobileDeviceManagementDAOUtil; import org.wso2.carbon.device.mgt.mobile.dao.util.MobileDeviceManagementDAOUtil;
import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManager; import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManager;
import org.wso2.carbon.device.mgt.mobile.impl.android.dao.AndroidDAOFactory; import org.wso2.carbon.device.mgt.mobile.impl.android.dao.AndroidDAOFactory;
import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManager;
import org.wso2.carbon.device.mgt.mobile.impl.ios.dao.IOSDAOFactory;
import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManager; import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManager;
import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.ndatasource.core.DataSourceService;
@ -59,7 +57,6 @@ public class MobileDeviceManagementServiceComponent {
private ServiceRegistration serverStartupObserverRef; private ServiceRegistration serverStartupObserverRef;
private ServiceRegistration androidServiceRegRef; private ServiceRegistration androidServiceRegRef;
private ServiceRegistration iOSServiceRegRef;
private ServiceRegistration windowsServiceRegRef; private ServiceRegistration windowsServiceRegRef;
private static final Log log = LogFactory.getLog(MobileDeviceManagementServiceComponent.class); private static final Log log = LogFactory.getLog(MobileDeviceManagementServiceComponent.class);
@ -78,8 +75,7 @@ public class MobileDeviceManagementServiceComponent {
Map<String, MobileDataSourceConfig> dsConfigMap = Map<String, MobileDataSourceConfig> dsConfigMap =
config.getMobileDeviceMgtRepository().getMobileDataSourceConfigMap(); config.getMobileDeviceMgtRepository().getMobileDataSourceConfigMap();
MobileDeviceManagementDAOFactory.setMobileDataSourceConfigMap(dsConfigMap); MobileDeviceManagementDAOFactory.setMobileDataSourceConfigMap(dsConfigMap);
IOSDAOFactory.init(dsConfigMap.get(DeviceManagementConstants.MobileDeviceTypes.
MOBILE_DEVICE_TYPE_IOS));
AndroidDAOFactory AndroidDAOFactory
.init(dsConfigMap.get(DeviceManagementConstants.MobileDeviceTypes. .init(dsConfigMap.get(DeviceManagementConstants.MobileDeviceTypes.
MOBILE_DEVICE_TYPE_ANDROID)); MOBILE_DEVICE_TYPE_ANDROID));
@ -105,8 +101,6 @@ public class MobileDeviceManagementServiceComponent {
androidServiceRegRef = androidServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(), new AndroidDeviceManager(), null); bundleContext.registerService(DeviceManager.class.getName(), new AndroidDeviceManager(), null);
iOSServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(), new IOSDeviceManager(), null);
windowsServiceRegRef = windowsServiceRegRef =
bundleContext.registerService(DeviceManager.class.getName(), new WindowsDeviceManager(), null); bundleContext.registerService(DeviceManager.class.getName(), new WindowsDeviceManager(), null);
@ -126,9 +120,6 @@ public class MobileDeviceManagementServiceComponent {
if (androidServiceRegRef != null) { if (androidServiceRegRef != null) {
androidServiceRegRef.unregister(); androidServiceRegRef.unregister();
} }
if (iOSServiceRegRef != null) {
iOSServiceRegRef.unregister();
}
if (windowsServiceRegRef != null) { if (windowsServiceRegRef != null) {
windowsServiceRegRef.unregister(); windowsServiceRegRef.unregister();
} }

Loading…
Cancel
Save