From fd7ab1aa54ff5e963418e12d59870cd4a876d4ca Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 18 Mar 2015 15:49:34 +0530 Subject: [PATCH] Incorporating API changes introduced into the device management core --- .../AbstractMobileOperationManager.java | 3 + .../android/AndroidDeviceManagerService.java | 23 +- .../AndroidMobileOperationManager.java | 302 +++++++++--------- .../impl/ios/IOSDeviceManagerService.java | 14 +- .../windows/WindowsDeviceManagerService.java | 14 +- ...MobileDeviceManagementBundleActivator.java | 12 +- ...obileDeviceManagementServiceComponent.java | 12 +- .../util/MobileDeviceManagementUtil.java | 4 +- features/device-mgt/pom.xml | 5 +- pom.xml | 16 +- 10 files changed, 197 insertions(+), 208 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java index 0bf268ef94..83bf6179ae 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/AbstractMobileOperationManager.java @@ -19,6 +19,9 @@ package org.wso2.carbon.device.mgt.mobile; import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManager; import java.util.List; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java index 0b83e1f8e1..e901a5ca43 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidDeviceManagerService.java @@ -20,12 +20,12 @@ package org.wso2.carbon.device.mgt.mobile.impl.android; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.*; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.common.spi.DeviceManager; 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.util.MobileDeviceManagementUtil; +import org.wso2.carbon.device.mgt.common.*; import java.util.ArrayList; import java.util.List; @@ -33,21 +33,21 @@ import java.util.List; /** * This represents the Android implementation of DeviceManagerService. */ -public class AndroidDeviceManagerService implements DeviceManagerService { +public class AndroidDeviceManagerService implements DeviceManager { private static final Log log = LogFactory.getLog(AndroidDeviceManagerService.class); - private OperationManager operationManager; - - public AndroidDeviceManagerService() { - this.operationManager = new AndroidMobileOperationManager(); - } @Override public String getProviderType() { return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID; } - @Override + @Override + public FeatureManager getFeatureManager() { + return null; + } + + @Override public boolean enrollDevice(Device device) throws DeviceManagementException { boolean status; MobileDevice mobileDevice = MobileDeviceManagementUtil.convertToMobileDevice(device); @@ -180,9 +180,4 @@ public class AndroidDeviceManagerService implements DeviceManagerService { return devices; } - @Override - public OperationManager getOperationManager() throws DeviceManagementException { - return operationManager; - } - } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidMobileOperationManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidMobileOperationManager.java index 82cfec148e..861931eb5d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidMobileOperationManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/AndroidMobileOperationManager.java @@ -21,6 +21,8 @@ package org.wso2.carbon.device.mgt.mobile.impl.android; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.*; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.mobile.AbstractMobileOperationManager; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOException; import org.wso2.carbon.device.mgt.mobile.dao.MobileDeviceManagementDAOFactory; @@ -35,160 +37,156 @@ import java.util.List; public class AndroidMobileOperationManager extends AbstractMobileOperationManager { - private static final Log log = LogFactory.getLog(AndroidMobileOperationManager.class); + private static final Log log = LogFactory.getLog(AndroidMobileOperationManager.class); - @Override - public boolean addOperation(Operation operation, List devices) throws - OperationManagementException { - boolean status = false; - try { - MobileDeviceOperationMapping mobileDeviceOperationMapping = null; - MobileOperation mobileOperation = - MobileDeviceManagementUtil.convertToMobileOperation(operation); - int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO() - .addMobileOperation(mobileOperation); - if (operationId > 0) { - for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) { - operationProperty.setOperationId(operationId); - status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() - .addMobileOperationProperty( - operationProperty); - } - for (DeviceIdentifier deviceIdentifier : devices) { - mobileDeviceOperationMapping = new MobileDeviceOperationMapping(); - mobileDeviceOperationMapping.setOperationId(operationId); - mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId()); - mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW); - status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() - .addMobileDeviceOperationMapping( - mobileDeviceOperationMapping); - } - } - } catch (MobileDeviceManagementDAOException e) { - String msg = - "Error while adding an operation " + operation.getCode() + "to Android devices"; - log.error(msg, e); - throw new OperationManagementException(msg, e); - } - return status; - } + @Override + public boolean addOperation(Operation operation, + List devices) throws OperationManagementException { + boolean status = false; + try { + MobileDeviceOperationMapping mobileDeviceOperationMapping = null; + MobileOperation mobileOperation = + MobileDeviceManagementUtil.convertToMobileOperation(operation); + int operationId = MobileDeviceManagementDAOFactory.getMobileOperationDAO() + .addMobileOperation(mobileOperation); + if (operationId > 0) { + for (MobileOperationProperty operationProperty : mobileOperation.getProperties()) { + operationProperty.setOperationId(operationId); + status = MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() + .addMobileOperationProperty( + operationProperty); + } + for (DeviceIdentifier deviceIdentifier : devices) { + mobileDeviceOperationMapping = new MobileDeviceOperationMapping(); + mobileDeviceOperationMapping.setOperationId(operationId); + mobileDeviceOperationMapping.setDeviceId(deviceIdentifier.getId()); + mobileDeviceOperationMapping.setStatus(MobileDeviceOperationMapping.Status.NEW); + status = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() + .addMobileDeviceOperationMapping( + mobileDeviceOperationMapping); + } + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while adding an operation " + operation.getCode() + "to Android devices"; + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + return status; + } - @Override - public List getOperations(DeviceIdentifier deviceIdentifier) - throws OperationManagementException { - List operations = new ArrayList(); - List mobileDeviceOperationMappings = null; - List operationProperties = null; - MobileOperation mobileOperation = null; - try { - mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() - .getAllMobileDeviceOperationMappingsOfDevice( - deviceIdentifier - .getId()); - if (mobileDeviceOperationMappings.size() > 0) { - List operationIds = MobileDeviceManagementUtil - .getMobileOperationIdsFromMobileDeviceOperations( - mobileDeviceOperationMappings); - for (Integer operationId : operationIds) { - mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO() - .getMobileOperation( - operationId); - operationProperties = - MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() - .getAllMobileOperationPropertiesOfOperation( - operationId); - mobileOperation.setProperties(operationProperties); - operations.add(MobileDeviceManagementUtil - .convertMobileOperationToOperation(mobileOperation)); - } - } - } catch (MobileDeviceManagementDAOException e) { - String msg = - "Error while fetching the operations for the android device " + - deviceIdentifier.getId(); - log.error(msg, e); - throw new OperationManagementException(msg, e); - } - return operations; - } + @Override + public List getOperations(DeviceIdentifier deviceIdentifier) + throws OperationManagementException { + List operations = new ArrayList(); + List mobileDeviceOperationMappings = null; + List operationProperties = null; + MobileOperation mobileOperation = null; + try { + mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() + .getAllMobileDeviceOperationMappingsOfDevice( + deviceIdentifier + .getId()); + if (mobileDeviceOperationMappings.size() > 0) { + List operationIds = MobileDeviceManagementUtil + .getMobileOperationIdsFromMobileDeviceOperations( + mobileDeviceOperationMappings); + for (Integer operationId : operationIds) { + mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO().getMobileOperation( + operationId); + operationProperties = + MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() + .getAllMobileOperationPropertiesOfOperation( + operationId); + mobileOperation.setProperties(operationProperties); + operations.add(MobileDeviceManagementUtil.convertMobileOperationToOperation(mobileOperation)); + } + } + } catch (MobileDeviceManagementDAOException e) { + String msg = + "Error while fetching the operations for the android device " + + deviceIdentifier.getId(); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + return operations; + } - @Override - public List getPendingOperations(DeviceIdentifier deviceIdentifier) - throws OperationManagementException { - List operations = new ArrayList(); - List mobileDeviceOperationMappings = null; - List operationProperties = null; - MobileOperation mobileOperation = null; - try { - //Get the list of pending operations for the given device - mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() - .getAllPendingOperationMappingsOfMobileDevice( - deviceIdentifier - .getId()); - //Go through each operation mapping for retrieving the data corresponding to each operation - for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) { - //Get the MobileOperation data - mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO() - .getMobileOperation(operation - .getOperationId()); - //Get properties of the operation - operationProperties = - MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() - .getAllMobileOperationPropertiesOfOperation( - operation.getOperationId()); - mobileOperation.setProperties(operationProperties); - operations.add(MobileDeviceManagementUtil - .convertMobileOperationToOperation(mobileOperation)); - //Update the MobileDeviceOperationMapping data to the In-Progress state - operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS); - operation.setSentDate(new Date().getTime()); - MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() - .updateMobileDeviceOperationMappingToInProgress( - operation.getDeviceId(), - operation.getOperationId()); - } - } catch (MobileDeviceManagementDAOException e) { - String msg = - "Error while fetching the operations for the android device " + - deviceIdentifier.getId(); - log.error(msg, e); - throw new OperationManagementException(msg, e); - } - return operations; - } + @Override + public List getPendingOperations(DeviceIdentifier deviceIdentifier) + throws OperationManagementException { + List operations = new ArrayList(); + List mobileDeviceOperationMappings = null; + List operationProperties = null; + MobileOperation mobileOperation = null; + try { + //Get the list of pending operations for the given device + mobileDeviceOperationMappings = MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() + .getAllPendingOperationMappingsOfMobileDevice( + deviceIdentifier + .getId()); + //Go through each operation mapping for retrieving the data corresponding to each operation + for (MobileDeviceOperationMapping operation : mobileDeviceOperationMappings) { + //Get the MobileOperation data + mobileOperation = MobileDeviceManagementDAOFactory.getMobileOperationDAO() + .getMobileOperation(operation + .getOperationId()); + //Get properties of the operation + operationProperties = + MobileDeviceManagementDAOFactory.getMobileOperationPropertyDAO() + .getAllMobileOperationPropertiesOfOperation( + operation.getOperationId()); + mobileOperation.setProperties(operationProperties); + operations.add(MobileDeviceManagementUtil + .convertMobileOperationToOperation(mobileOperation)); + //Update the MobileDeviceOperationMapping data to the In-Progress state + operation.setStatus(MobileDeviceOperationMapping.Status.INPROGRESS); + operation.setSentDate(new Date().getTime()); + MobileDeviceManagementDAOFactory.getMobileDeviceOperationDAO() + .updateMobileDeviceOperationMappingToInProgress( + operation.getDeviceId(), + operation.getOperationId()); + } + } catch (MobileDeviceManagementDAOException e) { + String msg = + "Error while fetching the operations for the android device " + + deviceIdentifier.getId(); + log.error(msg, e); + throw new OperationManagementException(msg, e); + } + return operations; + } + + @Override + public List getFeatures(String deviceType) throws FeatureManagementException { + MobileFeatureDAO featureDAO = MobileDeviceManagementDAOFactory.getFeatureDAO(); + MobileFeaturePropertyDAO featurePropertyDAO = MobileDeviceManagementDAOFactory.getFeaturePropertyDAO(); + List features = new ArrayList(); + try { + List mobileFeatures = featureDAO.getMobileFeatureByDeviceType(deviceType); + for (MobileFeature mobileFeature : mobileFeatures) { + Feature feature = new Feature(); + feature.setId(mobileFeature.getId()); + feature.setDeviceType(mobileFeature.getDeviceType()); + feature.setName(mobileFeature.getName()); + feature.setDescription(mobileFeature.getDescription()); + List metadataEntries = new ArrayList(); + List properties = + featurePropertyDAO.getFeaturePropertiesOfFeature(mobileFeature.getId()); + for (MobileFeatureProperty property : properties) { + Feature.MetadataEntry metaEntry = new Feature.MetadataEntry(); + metaEntry.setId(property.getFeatureID()); + metaEntry.setValue(property.getProperty()); + metadataEntries.add(metaEntry); + } + feature.setMetadataEntries(metadataEntries); + features.add(feature); + } + } catch (MobileDeviceManagementDAOException e) { + String msg = "Error while fetching the features for the device type " + deviceType; + log.error(msg, e); + throw new FeatureManagementException(msg, e); + } + return features; + } - @Override - public List getFeaturesForDeviceType(String deviceType) throws FeatureManagementException { - MobileFeatureDAO featureDAO = MobileDeviceManagementDAOFactory.getFeatureDAO(); - MobileFeaturePropertyDAO featurePropertyDAO = MobileDeviceManagementDAOFactory.getFeaturePropertyDAO(); - List features = new ArrayList(); - try { - List mobileFeatures = featureDAO.getMobileFeatureByDeviceType(deviceType); - for (MobileFeature mobileFeature : mobileFeatures) { - Feature feature = new Feature(); - feature.setId(mobileFeature.getId()); - feature.setDeviceType(mobileFeature.getDeviceType()); - feature.setName(mobileFeature.getName()); - feature.setDescription(mobileFeature.getDescription()); - List metadataEntries = new ArrayList(); - List properties = - featurePropertyDAO.getFeaturePropertiesOfFeature(mobileFeature.getId()); - for (MobileFeatureProperty property : properties) { - Feature.MetadataEntry metaEntry = new Feature.MetadataEntry(); - metaEntry.setId(property.getFeatureID()); - metaEntry.setValue(property.getProperty()); - metadataEntries.add(metaEntry); - } - feature.setMetadataEntries(metadataEntries); - features.add(feature); - } - } catch (MobileDeviceManagementDAOException e) { - String msg = - "Error while fetching the features for the device type " + - deviceType; - log.error(msg, e); - throw new FeatureManagementException(msg, e); - } - return features; - } } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java index 0a2f4172fe..c83ece6b65 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/ios/IOSDeviceManagerService.java @@ -19,20 +19,25 @@ package org.wso2.carbon.device.mgt.mobile.impl.ios; import org.wso2.carbon.device.mgt.common.*; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import java.util.List; /** * This represents the iOS implementation of DeviceManagerService. */ -public class IOSDeviceManagerService implements DeviceManagerService { +public class IOSDeviceManagerService implements DeviceManager { @Override public String getProviderType() { return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS; } + @Override + public FeatureManager getFeatureManager() { + return null; + } + @Override public boolean enrollDevice(Device device) throws DeviceManagementException { return true; @@ -80,11 +85,6 @@ public class IOSDeviceManagerService implements DeviceManagerService { return true; } - @Override - public OperationManager getOperationManager() throws DeviceManagementException { - return null; - } - @Override public boolean updateDeviceInfo(Device device) throws DeviceManagementException { return true; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java index ecbfb6dafc..57f4992369 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsDeviceManagerService.java @@ -19,20 +19,25 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows; import org.wso2.carbon.device.mgt.common.*; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import java.util.List; /** * This represents the Windows implementation of DeviceManagerService. */ -public class WindowsDeviceManagerService implements DeviceManagerService { +public class WindowsDeviceManagerService implements DeviceManager { @Override public String getProviderType() { return DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS; } + @Override + public FeatureManager getFeatureManager() { + return null; + } + @Override public boolean enrollDevice(Device device) throws DeviceManagementException { return true; @@ -79,11 +84,6 @@ public class WindowsDeviceManagerService implements DeviceManagerService { return true; } - @Override - public OperationManager getOperationManager() throws DeviceManagementException { - return null; - } - @Override public boolean updateDeviceInfo(Device device) throws DeviceManagementException { return true; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java index 3c0142f026..89d105af42 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java @@ -25,17 +25,17 @@ import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import org.wso2.carbon.device.mgt.mobile.DataSourceListener; -import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerService; import org.wso2.carbon.device.mgt.mobile.config.APIConfig; import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceConfigurationManager; 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.dao.MobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.impl.android.AndroidDeviceManagerService; import org.wso2.carbon.device.mgt.mobile.impl.ios.IOSDeviceManagerService; -import org.wso2.carbon.device.mgt.mobile.util.DeviceManagementAPIPublisherUtil; import org.wso2.carbon.device.mgt.mobile.impl.windows.WindowsDeviceManagerService; +import org.wso2.carbon.device.mgt.mobile.util.DeviceManagementAPIPublisherUtil; import java.util.ArrayList; import java.util.List; @@ -69,13 +69,13 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B MobileDeviceManagementDAOFactory.setMobileDataSourceConfig(dsConfig); androidServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new AndroidDeviceManagerService(), null); iOSServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new IOSDeviceManagerService(), null); windowsServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new WindowsDeviceManagerService(), null); /* Initialize all API configurations with corresponding API Providers */ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementServiceComponent.java index 8d54387308..193fbbcc72 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementServiceComponent.java @@ -23,14 +23,10 @@ import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.apimgt.api.APIManagementException; -import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService; -import org.wso2.carbon.apimgt.impl.APIManagerFactory; -import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil; import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService; +import org.wso2.carbon.device.mgt.common.spi.DeviceManager; import org.wso2.carbon.device.mgt.mobile.MobileDeviceManagementStartupObserver; import org.wso2.carbon.device.mgt.mobile.config.APIConfig; import org.wso2.carbon.device.mgt.mobile.config.MobileDeviceConfigurationManager; @@ -100,13 +96,13 @@ public class MobileDeviceManagementServiceComponent { } androidServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new AndroidDeviceManagerService(), null); iOSServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new IOSDeviceManagerService(), null); windowsServiceRegRef = - bundleContext.registerService(DeviceManagerService.class.getName(), + bundleContext.registerService(DeviceManager.class.getName(), new WindowsDeviceManagerService(), null); serverStartupObserverRef = bundleContext.registerService(ServerStartupObserver.class, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java index 0996edfa31..0215afc6a6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.Operation; +import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.mobile.dto.MobileDevice; import org.wso2.carbon.device.mgt.mobile.dto.MobileDeviceOperationMapping; import org.wso2.carbon.device.mgt.mobile.dto.MobileOperation; @@ -117,7 +117,7 @@ public class MobileDeviceManagementUtil { return device; } - public static MobileOperation convertToMobileOperation(org.wso2.carbon.device.mgt.common.Operation operation) { + public static MobileOperation convertToMobileOperation(Operation operation) { MobileOperation mobileOperation = new MobileOperation(); MobileOperationProperty operationProperty = null; List properties = new LinkedList(); diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index fb77ecbffb..032523e833 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> - + org.wso2.carbon.devicemgt-plugins @@ -35,7 +36,7 @@ http://wso2.org - org.wso2.carbon.device.mgt.mobile.feature + org.wso2.carbon.device.mgt.mobile.feature diff --git a/pom.xml b/pom.xml index 1db632ba71..db4afcc0f6 100644 --- a/pom.xml +++ b/pom.xml @@ -201,22 +201,22 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.core - ${cdm.core.version} + ${carbon.device.mgt.version} org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - ${cdm.core.version} + ${carbon.device.mgt.version} org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - ${cdm.core.version} + ${carbon.device.mgt.version} org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core - ${cdm.core.version} + ${carbon.device.mgt.version} @@ -422,10 +422,6 @@ 4.3.0 [4.3.0, 4.4.0) - - 0.9.0 - [0.8.0, 2.0.0) - 1.5.4 @@ -445,7 +441,6 @@ 7.0.52.wso2v5 7.0.34.wso2v2 - 2.6.1 1.9.0 @@ -470,7 +465,8 @@ 4.3.0 - 0.9.0 + 0.9.2-SNAPSHOT + 0.9.2-SNAPSHOT 1.9.1-SNAPSHOT