From e3c6bb319b5e448028a40027fb5aa09e8f624269 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 27 Nov 2019 20:05:46 +0530 Subject: [PATCH] Format Android plugin source --- .../pom.xml | 97 +++++ .../android/addons}/ApiOriginFilter.java | 9 +- .../addons}/ValidationInterceptor.java | 8 +- .../pom.xml | 195 ++-------- .../android/api/AndroidEnterpriseAPI.java} | 73 ++-- .../android/api/DeviceManagementAPI.java} | 24 +- .../api/DeviceManagementAdminAPI.java} | 78 ++-- .../api/DeviceTypeConfigurationAPI.java} | 20 +- .../mobile/android/api/EventReceiverAPI.java} | 22 +- .../api}/exception/GlobalThrowableMapper.java | 9 +- .../ParameterValidationException.java | 6 +- .../api/impl/AndroidEnterpriseAPIImpl.java} | 57 ++- .../api/impl/DeviceManagementAPIImpl.java} | 38 +- .../impl/DeviceManagementAdminAPIImpl.java} | 99 +++--- .../impl/DeviceTypeConfigurationAPIImpl.java | 130 +++++++ .../api/impl/EventReceiverAPIImpl.java} | 28 +- .../mdm/services/android/bean/ProxyType.java | 5 - .../DeviceTypeConfigurationServiceImpl.java | 238 ------------- .../services/android/util/DeviceIDHolder.java | 48 --- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 18 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../DeviceManagementAdminServiceTests.java | 312 ---------------- .../android/DeviceManagementServiceTests.java | 334 ------------------ .../pom.xml | 117 ++++++ .../android/common}/AndroidConstants.java | 2 +- .../common}/AndroidPluginConstants.java | 2 +- .../mobile}/android/common/ErrorHandler.java | 4 +- .../mobile}/android/common/ErrorMessage.java | 2 +- .../android/common/GoogleAPIInvoker.java | 12 +- .../common/GsonMessageBodyHandler.java | 2 +- .../mgt/mobile/android/common}/Message.java | 3 +- .../common}/bean/AndroidOperation.java | 2 +- .../bean/AndroidPlatformConfiguration.java | 3 +- .../common}/bean/ApiRegistrationProfile.java | 2 +- .../android/common}/bean/AppRestriction.java | 2 +- .../common}/bean/ApplicationInstallation.java | 2 +- .../common}/bean/ApplicationRestriction.java | 2 +- .../bean/ApplicationUninstallation.java | 2 +- .../common}/bean/ApplicationUpdate.java | 2 +- .../android/common}/bean/BasicUserInfo.java | 2 +- .../common}/bean/BlacklistApplications.java | 2 +- .../mobile/android/common}/bean/Camera.java | 2 +- .../common}/bean/DeviceEncryption.java | 2 +- .../android/common}/bean/DeviceLock.java | 2 +- .../android/common}/bean/DeviceState.java | 2 +- .../android/common}/bean/Disenrollment.java | 4 +- .../android/common}/bean/DisplayMessage.java | 2 +- .../common}/bean/EnterpriseConfigs.java | 2 +- .../common}/bean/EnterpriseStoreCluster.java | 2 +- .../common}/bean/EnterpriseStorePackages.java | 2 +- .../common}/bean/EnterpriseStorePage.java | 2 +- .../bean/EnterpriseStorePageLinks.java | 2 +- .../common}/bean/EnterpriseTokenUrl.java | 2 +- .../android/common}/bean/ErrorListItem.java | 2 +- .../android/common}/bean/ErrorResponse.java | 2 +- .../android/common}/bean/FileTransfer.java | 3 +- .../android/common}/bean/GlobalProxy.java | 2 +- .../common}/bean/GoogleAppSyncResponse.java | 2 +- .../mobile/android/common}/bean/LockCode.java | 2 +- .../android/common}/bean/Notification.java | 2 +- .../common}/bean/NotifierFrequency.java | 2 +- .../android/common}/bean/PasscodePolicy.java | 2 +- .../mobile/android/common/bean/ProxyType.java | 5 + .../android/common}/bean/UpgradeFirmware.java | 2 +- .../mgt/mobile/android/common}/bean/Vpn.java | 2 +- .../mobile/android/common}/bean/WebClip.java | 2 +- .../mgt/mobile/android/common}/bean/Wifi.java | 2 +- .../mobile/android/common}/bean/WipeData.java | 2 +- .../bean/wrapper/AndroidApplication.java | 2 +- .../common}/bean/wrapper/AndroidDevice.java | 2 +- .../bean/wrapper/AndroidDeviceInfo.java | 2 +- .../wrapper/AppRestrictionBeanWrapper.java | 4 +- .../ApplicationInstallationBeanWrapper.java | 4 +- .../ApplicationRestrictionBeanWrapper.java | 4 +- .../ApplicationUninstallationBeanWrapper.java | 4 +- .../wrapper/ApplicationUpdateBeanWrapper.java | 4 +- .../BlacklistApplicationsBeanWrapper.java | 4 +- .../bean/wrapper/CameraBeanWrapper.java | 4 +- .../bean/wrapper/DeviceEnrollmentInfo.java | 2 +- .../bean/wrapper/DeviceLockBeanWrapper.java | 4 +- .../wrapper/DisenrollmentBeanWrapper.java | 4 +- .../wrapper/DisplayMessageBeanWrapper.java | 4 +- .../bean/wrapper/EncryptionBeanWrapper.java | 4 +- .../common}/bean/wrapper/EnterpriseApp.java | 2 +- .../bean/wrapper/EnterpriseInstallPolicy.java | 2 +- .../common}/bean/wrapper/EnterpriseUser.java | 2 +- .../bean/wrapper/EventBeanWrapper.java | 2 +- .../bean/wrapper/FileTransferBeanWrapper.java | 4 +- .../bean/wrapper/GlobalProxyBeanWrapper.java | 4 +- .../bean/wrapper/LockCodeBeanWrapper.java | 4 +- .../bean/wrapper/NotificationBeanWrapper.java | 4 +- .../wrapper/PasswordPolicyBeanWrapper.java | 4 +- .../common}/bean/wrapper/TokenWrapper.java | 2 +- .../wrapper/UpgradeFirmwareBeanWrapper.java | 4 +- .../common}/bean/wrapper/VpnBeanWrapper.java | 4 +- .../bean/wrapper/WebClipBeanWrapper.java | 4 +- .../common}/bean/wrapper/WifiBeanWrapper.java | 4 +- .../bean/wrapper/WipeDataBeanWrapper.java | 4 +- .../AndroidDataSourceConfigurations.java | 2 +- .../datasource/DataSourceConfigAdapter.java | 2 +- .../datasource/JNDILookupDefinition.java | 2 +- .../datasource/MobileDataSourceConfig.java | 2 +- .../MobileDataSourceConfigurations.java | 2 +- .../config/task/TaskConfiguration.java | 2 +- .../dto/AndroidEnterpriseManagedConfig.java | 2 +- .../common}/dto/AndroidEnterpriseUser.java | 2 +- .../mobile/android/common/dto}/ErrorDTO.java | 2 +- .../android/common}/dto/MobileDevice.java | 3 +- .../dto/MobileDeviceOperationMapping.java | 2 +- .../android/common}/dto/MobileFeature.java | 2 +- .../android/common}/dto/MobileOperation.java | 2 +- .../common}/dto/MobileOperationProperty.java | 2 +- .../exception/AndroidAgentException.java | 2 +- .../AndroidDeviceMgtPluginException.java | 2 +- .../exception/AndroidOperationException.java | 4 +- .../exception/BadRequestException.java | 4 +- .../exception/BadRequestExceptionDup.java | 32 ++ .../EnterpriseManagementDAOException.java | 2 +- .../EnterpriseServiceException.java | 2 +- .../common}/exception/ForbiddenException.java | 5 +- .../MobileDeviceManagementDAOException.java | 2 +- .../common}/exception/NotFoundException.java | 7 +- .../OperationConfigurationException.java | 2 +- .../UnexpectedServerErrorException.java | 7 +- .../spi/AndroidGoogleEnterpriseService.java} | 10 +- .../android/common/spi/AndroidService.java | 31 ++ .../pom.xml | 114 +++++- ...tractMobileDeviceManagementDAOFactory.java | 10 +- .../android/core}/dao/AndroidDAOFactory.java | 5 +- .../android/core}/dao/EnterpriseDAO.java | 7 +- .../dao/MobileDeviceManagementDAOFactory.java | 2 +- .../core}/dao/impl/EnterpriseDAOImpl.java | 19 +- .../util/MobileDeviceManagementDAOUtil.java | 2 +- .../AndroidGoogleEnterpriseServiceImpl.java} | 21 +- .../core/impl/AndroidPluginServiceImpl.java | 75 ++++ .../android/core/impl/AndroidServiceImpl.java | 184 ++++++++++ .../AndroidDeviceManagementDataHolder.java | 20 +- .../AndroidPluginServiceComponent.java | 24 +- .../android/core}/util/AndroidAPIUtils.java | 27 +- .../core}/util/AndroidDeviceUtils.java | 69 ++-- .../core}/util/AndroidEnterpriseUtils.java | 26 +- .../util/MobileDeviceManagementUtil.java | 21 +- .../mobile/android/core}/util/OAuthUtils.java | 5 +- .../DeviceManagementAdminServiceTests.java | 311 ++++++++++++++++ .../core/DeviceManagementServiceTests.java | 333 +++++++++++++++++ ...licationManagementProviderServiceMock.java | 2 +- .../DeviceInformationManagerServiceMock.java | 3 +- .../DeviceManagementProviderServiceMock.java | 4 +- .../NotificationManagementServiceMock.java | 2 +- .../core/mokcs}/PolicyManagerServiceMock.java | 2 +- .../android/core/mokcs}/utils/TestUtils.java | 86 ++--- .../src/test/resources/log4j.properties | 0 .../src/test/resources/testng.xml | 4 +- .../MobileDeviceConfigurationManager.java | 78 ---- .../config/MobileDeviceManagementConfig.java | 42 --- .../MobileDeviceManagementRepository.java | 57 --- .../mobile-plugins/android-plugin/pom.xml | 4 +- .../pom.xml | 11 +- pom.xml | 12 +- 159 files changed, 2033 insertions(+), 1867 deletions(-) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/ApiOriginFilter.java (84%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common => org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons}/ValidationInterceptor.java (94%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/AndroidEnterpriseService.java => device/mgt/mobile/android/api/AndroidEnterpriseAPI.java} (96%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/DeviceManagementService.java => device/mgt/mobile/android/api/DeviceManagementAPI.java} (97%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/DeviceManagementAdminService.java => device/mgt/mobile/android/api/DeviceManagementAdminAPI.java} (96%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/DeviceTypeConfigurationService.java => device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java} (95%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/EventReceiverService.java => device/mgt/mobile/android/api/EventReceiverAPI.java} (92%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android => device/mgt/mobile/android/api}/exception/GlobalThrowableMapper.java (88%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android => device/mgt/mobile/android/api}/exception/ParameterValidationException.java (89%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/impl/AndroidEnterpriseServiceImpl.java => device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java} (95%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/impl/DeviceManagementServiceImpl.java => device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java} (95%) rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java => device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java} (93%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java rename components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/{mdm/services/android/services/impl/EventReceiverServiceImpl.java => device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java} (91%) delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/DeviceIDHolder.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/AndroidConstants.java (99%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/AndroidPluginConstants.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile}/android/common/ErrorHandler.java (89%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile}/android/common/ErrorMessage.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile}/android/common/GoogleAPIInvoker.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile}/android/common/GsonMessageBodyHandler.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/Message.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/AndroidOperation.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/AndroidPlatformConfiguration.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ApiRegistrationProfile.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/AppRestriction.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ApplicationInstallation.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ApplicationRestriction.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ApplicationUninstallation.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ApplicationUpdate.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/BasicUserInfo.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/BlacklistApplications.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/Camera.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/DeviceEncryption.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/DeviceLock.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/DeviceState.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/Disenrollment.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/DisplayMessage.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseConfigs.java (90%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseStoreCluster.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseStorePackages.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseStorePage.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseStorePageLinks.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/EnterpriseTokenUrl.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ErrorListItem.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/ErrorResponse.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/FileTransfer.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/GlobalProxy.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/GoogleAppSyncResponse.java (77%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/LockCode.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/Notification.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/NotifierFrequency.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/PasscodePolicy.java (98%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/UpgradeFirmware.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/Vpn.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/WebClip.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/Wifi.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/WipeData.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/AndroidApplication.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/AndroidDevice.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/AndroidDeviceInfo.java (99%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/AppRestrictionBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/ApplicationInstallationBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/ApplicationRestrictionBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/ApplicationUninstallationBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/ApplicationUpdateBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/BlacklistApplicationsBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/CameraBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/DeviceEnrollmentInfo.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/DeviceLockBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/DisenrollmentBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/DisplayMessageBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/EncryptionBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/EnterpriseApp.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/EnterpriseInstallPolicy.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/EnterpriseUser.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/EventBeanWrapper.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/FileTransferBeanWrapper.java (93%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/GlobalProxyBeanWrapper.java (92%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/LockCodeBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/NotificationBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/PasswordPolicyBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/TokenWrapper.java (72%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/UpgradeFirmwareBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/VpnBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/WebClipBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/WifiBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/bean/wrapper/WipeDataBeanWrapper.java (91%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/datasource/AndroidDataSourceConfigurations.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/datasource/DataSourceConfigAdapter.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/datasource/JNDILookupDefinition.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/datasource/MobileDataSourceConfig.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/datasource/MobileDataSourceConfigurations.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/config/task/TaskConfiguration.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/AndroidEnterpriseManagedConfig.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/AndroidEnterpriseUser.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto}/ErrorDTO.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/MobileDevice.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/MobileDeviceOperationMapping.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/MobileFeature.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/MobileOperation.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/dto/MobileOperationProperty.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/AndroidAgentException.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception}/AndroidDeviceMgtPluginException.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/AndroidOperationException.java (89%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/BadRequestException.java (87%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception}/EnterpriseManagementDAOException.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception}/EnterpriseServiceException.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/ForbiddenException.java (87%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception}/MobileDeviceManagementDAOException.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/NotFoundException.java (83%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/OperationConfigurationException.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common}/exception/UnexpectedServerErrorException.java (84%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java => org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java} (79%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android => org.wso2.carbon.device.mgt.mobile.android.core}/pom.xml (69%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/AbstractMobileDeviceManagementDAOFactory.java (90%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/AndroidDAOFactory.java (95%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/EnterpriseDAO.java (84%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/MobileDeviceManagementDAOFactory.java (92%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/impl/EnterpriseDAOImpl.java (93%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/dao/util/MobileDeviceManagementDAOUtil.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidPluginServiceImpl.java => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java} (90%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/internal/AndroidDeviceManagementDataHolder.java (69%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/internal/AndroidPluginServiceComponent.java (80%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/util/AndroidAPIUtils.java (87%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/util/AndroidDeviceUtils.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/util/AndroidEnterpriseUtils.java (96%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/util/MobileDeviceManagementUtil.java (94%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core}/util/OAuthUtils.java (95%) create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java create mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/ApplicationManagementProviderServiceMock.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/DeviceInformationManagerServiceMock.java (93%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/DeviceManagementProviderServiceMock.java (99%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/NotificationManagementServiceMock.java (97%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/PolicyManagerServiceMock.java (98%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android => org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs}/utils/TestUtils.java (86%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api => org.wso2.carbon.device.mgt.mobile.android.core}/src/test/resources/log4j.properties (100%) rename components/mobile-plugins/android-plugin/{org.wso2.carbon.device.mgt.mobile.android.api => org.wso2.carbon.device.mgt.mobile.android.core}/src/test/resources/testng.xml (80%) delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceConfigurationManager.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementConfig.java delete mode 100644 components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementRepository.java diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml new file mode 100644 index 000000000..3f658001d --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/pom.xml @@ -0,0 +1,97 @@ + + + + + + android-plugin + org.wso2.carbon.devicemgt-plugins + 5.0.5-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.mobile.android.addons + bundle + WSO2 Carbon - Mobile Device Management Android Addons Impl + WSO2 Carbon - Mobile Device Management Android Addons Implementation + https://entgra.io/ + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.felix + maven-scr-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.artifactId} + ${project.artifactId} + ${carbon.devicemgt.plugins.version} + Device Management Mobile Android addons Impl Bundle + + com.google.gson.* + + + org.wso2.carbon.device.mgt.mobile.android.addons.* + + + + + + + + + + javax.servlet + servlet-api + provided + + + org.apache.cxf + cxf-rt-frontend-jaxws + provided + + + org.apache.cxf + cxf-rt-frontend-jaxrs + provided + + + org.apache.cxf + cxf-rt-transports-http + provided + + + org.hibernate + hibernate-validator + + + org.wso2.carbon + org.wso2.carbon.logging + + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/ApiOriginFilter.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/ApiOriginFilter.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java index 455d582bb..e9c4c69da 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/ApiOriginFilter.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ApiOriginFilter.java @@ -16,9 +16,14 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.addons; -import javax.servlet.*; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import java.io.IOException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ValidationInterceptor.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ValidationInterceptor.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java index a563f09d1..adc298e18 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ValidationInterceptor.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.addons/src/main/java/org/wso2/carbon/device/mgt/mobile/android/addons/ValidationInterceptor.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.addons; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -29,7 +29,11 @@ import org.apache.cxf.message.MessageContentsList; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; -import javax.validation.*; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.validation.Validation; +import javax.validation.Validator; +import javax.validation.ValidatorFactory; import javax.validation.executable.ExecutableValidator; import java.lang.reflect.Method; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml index 1855a35d4..d902ed524 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml @@ -49,44 +49,6 @@ api#device-mgt#android#v1.0 - - org.jacoco - jacoco-maven-plugin - - ${basedir}/target/coverage-reports/jacoco-unit.exec - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/site - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - file:src/test/resources/log4j.properties - - - src/test/resources/testng.xml - - - @@ -99,7 +61,7 @@ org.apache.maven.plugins maven-antrun-plugin - 1.7 + 1.8 compile @@ -118,54 +80,6 @@ - - org.jacoco - jacoco-maven-plugin - - ${basedir}/target/coverage-reports/jacoco-unit.exec - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/site - - - - - - - - - - client - - test - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - - java - - - - @@ -212,32 +126,6 @@ org.wso2.carbon.apimgt.annotations provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.core - provided - - - org.slf4j - slf4j-api - - - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.common - provided - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.core - provided - - - org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android - provided - commons-httpclient.wso2 commons-httpclient @@ -287,11 +175,7 @@ - - javax.servlet - servlet-api - provided - + org.hibernate hibernate-validator @@ -300,78 +184,49 @@ javax.ws.rs javax.ws.rs-api + - org.testng - testng - test - - - org.powermock - powermock-module-testng - test - - - org.powermock - powermock-api-mockito - test - - - com.h2database.wso2 - h2-database-engine - test - - - org.wso2.carbon - org.wso2.carbon.queuing - test - - - org.wso2.carbon - org.wso2.carbon.ndatasource.core - test - - - commons-dbcp.wso2 - commons-dbcp - test + org.codehaus.jackson + jackson-core-asl - commons-pool.wso2 - commons-pool - test + com.google.apis + google-api-services-androidenterprise + v1-rev186-1.25.0 - org.wso2.carbon - javax.cache.wso2 - test + org.wso2.carbon.devicemgt + org.wso2.carbon.device.application.mgt.common + provided - javassist - javassist - test + org.apache.httpcomponents + httpclient + - org.codehaus.jackson - jackson-core-asl + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + provided - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.application.extension + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.addons provided - com.google.apis - google-api-services-androidenterprise - v1-rev186-1.25.0 + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.core + provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + org.wso2.carbon.policy.mgt.common provided - org.apache.httpcomponents - httpclient + org.wso2.carbon.devicemgt + org.wso2.carbon.policy.mgt.core diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/AndroidEnterpriseService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/AndroidEnterpriseService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java index a76a57ada..3ffd40654 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/AndroidEnterpriseService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/AndroidEnterpriseAPI.java @@ -15,9 +15,8 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; -import com.google.api.services.androidenterprise.model.Device; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -32,22 +31,17 @@ import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationPolicyDTO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePageLinks; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; - -import javax.validation.Valid; -import javax.validation.constraints.Size; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePageLinks; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; + import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; @@ -69,10 +63,11 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Service") } ) -@Api(value = "Android Enterprise Service", description = "Android Enterprise Service ") + +@Api(value = "Android Enterprise Service") @Path("/enterprise") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -92,7 +87,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface AndroidEnterpriseService { +public interface AndroidEnterpriseAPI { @POST @Path("/user") @@ -148,8 +143,7 @@ public interface AndroidEnterpriseService { }) Response addUser(@ApiParam( name = "user", - value = "Enterprise user and device data.") - EnterpriseUser enterpriseUser); + value = "Enterprise user and device data.") EnterpriseUser enterpriseUser); //###################################################################################################################### //###################################################################################################################### @@ -209,8 +203,7 @@ public interface AndroidEnterpriseService { }) Response updateUser(@ApiParam( name = "device", - value = "Enterprise user and device data.") - EnterpriseInstallPolicy device); + value = "Enterprise user and device data.") EnterpriseInstallPolicy device); //###################################################################################################################### //###################################################################################################################### @@ -269,43 +262,38 @@ public interface AndroidEnterpriseService { Response getStoreUrl( @ApiParam( name = "approveApps", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) + value = "Boolean flag indicating whether to permanently delete the device.") @QueryParam("approveApps") boolean approveApps, @ApiParam( name = "searchEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) + value = "Boolean flag indicating whether to permanently delete the device.") @QueryParam("searchEnabled") boolean searchEnabled, @ApiParam( name = "isPrivateAppsEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isPrivateAppsEnabled") boolean isPrivateAppsEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isPrivateAppsEnabled") boolean isPrivateAppsEnabled, @ApiParam( name = "isWebAppEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isWebAppEnabled") boolean isWebAppEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isWebAppEnabled") boolean isWebAppEnabled, @ApiParam( name = "isOrganizeAppPageVisible", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isOrganizeAppPageVisible") boolean isOrganizeAppPageVisible, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isOrganizeAppPageVisible") boolean isOrganizeAppPageVisible, @ApiParam( name = "isManagedConfigEnabled", - value = "Boolean flag indicating whether to permanently delete the device.", - required = false) @QueryParam("isManagedConfigEnabled") boolean isManagedConfigEnabled, + value = "Boolean flag indicating whether to permanently delete the device.") + @QueryParam("isManagedConfigEnabled") boolean isManagedConfigEnabled, @ApiParam(name = "host", value = "Boolean flag indicating whether to permanently delete the device.", required = true) @QueryParam("host") String host); - - - @GET @Path("/products/sync") @ApiOperation( @@ -416,8 +404,7 @@ public interface AndroidEnterpriseService { }) Response addPage(@ApiParam( name = "page", - value = "Enterprise page.") - EnterpriseStorePage page); + value = "Enterprise page.") EnterpriseStorePage page); //###################################################################################################################### //###################################################################################################################### @@ -777,8 +764,7 @@ public interface AndroidEnterpriseService { }) Response addCluster(@ApiParam( name = "storeCluster", - value = "Enterprise cluster.") - EnterpriseStoreCluster storeCluster); + value = "Enterprise cluster.") EnterpriseStoreCluster storeCluster); //###################################################################################################################### //###################################################################################################################### @@ -965,7 +951,7 @@ public interface AndroidEnterpriseService { @ApiParam( name = "pageId", value = "The unique page pageId") - @PathParam("pageId") String pageId); + @PathParam("id") String pageId); //###################################################################################################################### //###################################################################################################################### @@ -1025,8 +1011,7 @@ public interface AndroidEnterpriseService { }) Response updateLinks(@ApiParam( name = "links", - value = "Enterprise page links.") - EnterpriseStorePageLinks links); + value = "Enterprise page links.") EnterpriseStorePageLinks links); //###################################################################################################################### //###################################################################################################################### diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java index a3910c870..73db4dd71 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAPI.java @@ -32,16 +32,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.*; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; import javax.validation.Valid; import javax.validation.constraints.NotNull; @@ -73,11 +73,10 @@ import java.util.List; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Service") } ) -@Api(value = "Android Device Management", - description = "This carries all the resources related to the Android device management functionalities.") +@Api(value = "Android Device Management") @Path("/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -97,7 +96,7 @@ import java.util.List; ) } ) -public interface DeviceManagementService { +public interface DeviceManagementAPI { @PUT @Path("/{id}/applications") @@ -211,8 +210,7 @@ public interface DeviceManagementService { Response getPendingOperations( @ApiParam( name = "disableGoogleApps", - value = "Specifically disable having Google apps installed.", - required = false) + value = "Specifically disable having Google apps installed.") @QueryParam("disableGoogleApps") boolean disableGoogleApps, @ApiParam( name = "id", @@ -223,8 +221,7 @@ public interface DeviceManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200.", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200.") @HeaderParam("If-Modified-Since") String ifModifiedSince, @ApiParam( name = "resultOperations", @@ -339,8 +336,7 @@ public interface DeviceManagementService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); @PUT diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java index 89787ea68..118874bec 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceManagementAdminAPI.java @@ -33,7 +33,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -49,8 +49,26 @@ import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; -import org.wso2.carbon.mdm.services.android.bean.wrapper.*; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationRestrictionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DisplayMessageBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.FileTransferBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.GlobalProxyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; import javax.validation.Valid; import javax.ws.rs.Consumes; @@ -75,11 +93,11 @@ import java.util.List; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Device Management Admin Service") } ) @Path("/admin/devices") -@Api(value = "Android Device Management Administrative Service", description = "Device management related admin APIs.") +@Api(value = "Android Device Management Administrative Service") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Scopes( @@ -266,7 +284,7 @@ import java.util.List; ) } ) -public interface DeviceManagementAdminService { +public interface DeviceManagementAdminAPI { @POST @Path("/file-transfer") @@ -632,8 +650,7 @@ public interface DeviceManagementAdminService { "Disable the camera on the device by assigning true as the value or enable the " + "camera on the device to function by defining false as the value and the ID of the Android device. " + "Multiple device IDs can be added by using comma separated values. ", - required = true) - CameraBeanWrapper cameraBeanWrapper); + required = true) CameraBeanWrapper cameraBeanWrapper); @POST @Path("/info") @@ -880,8 +897,7 @@ public interface DeviceManagementAdminService { name = "wipeData", value = "Provide the the passcode, which is the passcode that the Android agent prompts the device owner to set at the time of device enrollment, " + "to enable the factory reset operation, and the ID of the Android device. Multiple device IDs can be added by using comma separated values. ", - required = true) - WipeDataBeanWrapper wipeDataBeanWrapper); + required = true) WipeDataBeanWrapper wipeDataBeanWrapper); @POST @Path("/applications") @@ -1248,8 +1264,7 @@ public interface DeviceManagementAdminService { value = "Properties required to install an application on Android devices. Provide the the package name, type," + " URL and name of the application, the date and time for the scheduled installation, and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); + required = true) ApplicationInstallationBeanWrapper applicationInstallationBeanWrapper); @POST @Path("/update-application") @@ -1313,8 +1328,7 @@ public interface DeviceManagementAdminService { value = "Properties required to update an application on Android devices. Provide the the package name, type," + "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); + required = true) ApplicationUpdateBeanWrapper applicationUpdateBeanWrapper); @POST @Path("/uninstall-application") @@ -1375,8 +1389,7 @@ public interface DeviceManagementAdminService { value = "Properties required to uninstall an application. Provide the the package name, type," + "URL and name of the application, the date and time for the scheduled installation, and the ID of the" + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); + required = true) ApplicationUninstallationBeanWrapper applicationUninstallationBeanWrapper); @POST @Path("/blacklist-applications") @@ -1504,8 +1517,7 @@ public interface DeviceManagementAdminService { "yyyy-MM-dd'T'HH:mm:ss.SSSXXX format, the OTA upgrade server URL in one of the following formats " + "(example: http//abc.com, http://abc.com/ota), " + "and the ID of the Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); + required = true) UpgradeFirmwareBeanWrapper upgradeFirmwareBeanWrapper); @POST @Path("/configure-vpn") @@ -1565,8 +1577,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "vpnBean", value = "VPN configuration and DeviceIds", - required = true) - VpnBeanWrapper vpnBeanWrapper); + required = true) VpnBeanWrapper vpnBeanWrapper); @POST @Path("/send-notification") @@ -1626,8 +1637,7 @@ public interface DeviceManagementAdminService { name = "notification", value = "The properties required to send a notification. Provide the message you wish to send and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - NotificationBeanWrapper notificationBeanWrapper); + required = true) NotificationBeanWrapper notificationBeanWrapper); @POST @Path("/configure-wifi") @@ -1688,8 +1698,7 @@ public interface DeviceManagementAdminService { value = "The properties required to configure Wi-Fi. Provide the password to connect to the specified Wi-Fi network," + "the ssid or the name of the Wi-Fi network that you wish to configure and the ID of the Android device." + " Multiple device IDs can be added by using comma separated values.", - required = true) - WifiBeanWrapper wifiBeanWrapper); + required = true) WifiBeanWrapper wifiBeanWrapper); @POST @Path("/encrypt-storage") @@ -1750,8 +1759,7 @@ public interface DeviceManagementAdminService { value = "Properties required to encrypt the storage. Encrypt the storage on the device by assigning " + "true as the value or do not encrypt the storage on the device by assigning false as the value and " + "provide the ID of the Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - EncryptionBeanWrapper encryptionBeanWrapper); + required = true) EncryptionBeanWrapper encryptionBeanWrapper); @POST @Path("/change-lock-code") @@ -1812,8 +1820,7 @@ public interface DeviceManagementAdminService { value = "The properties to change th lock code. Provide the lock code that will replace the current lock code on Android devices and " + "the ID of the Android device. Multiple device IDs can be added by using comma separated values. " + "If a passcode policy has been set in EMM, the lock code should comply to the passcode policy.\t", - required = true) - LockCodeBeanWrapper lockCodeBeanWrapper); + required = true) LockCodeBeanWrapper lockCodeBeanWrapper); @POST @Path("/set-password-policy") @@ -1872,8 +1879,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "passwordPolicy", value = "The properties required to set a password policy.", - required = true) - PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); + required = true) PasswordPolicyBeanWrapper passwordPolicyBeanWrapper); @POST @Path("/set-webclip") @@ -1932,8 +1938,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "webClip", value = "The properties to set the web clip.", - required = true) - WebClipBeanWrapper webClipBeanWrapper); + required = true) WebClipBeanWrapper webClipBeanWrapper); @POST @Path("/send-app-conf") @ApiOperation( @@ -1994,8 +1999,7 @@ public interface DeviceManagementAdminService { value = "The properties required to send application restrictions. Provide the restriction you " + "wish to send and the ID of the Android device. Multiple device IDs can be added by using" + " comma separated values.", - required = true) - ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper); + required = true) ApplicationRestrictionBeanWrapper applicationRestrictionBeanWrapper); @POST @Path("/configure-global-proxy") @@ -2056,8 +2060,7 @@ public interface DeviceManagementAdminService { @ApiParam( name = "globalProxyInfo", value = "The properties to set the global proxy settings.", - required = true) - GlobalProxyBeanWrapper globalProxyBeanWrapper); + required = true) GlobalProxyBeanWrapper globalProxyBeanWrapper); @POST @Path("/configure-display-message") @@ -2107,6 +2110,5 @@ public interface DeviceManagementAdminService { name = "display-message", value = "The properties required to send a messages. Provide the message you wish to send and the ID of the " + "Android device. Multiple device IDs can be added by using comma separated values.", - required = true) - DisplayMessageBeanWrapper displayMessageBeanWrapper); + required = true) DisplayMessageBeanWrapper displayMessageBeanWrapper); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java index 5e2440941..6e8e324ea 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceTypeConfigurationService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/DeviceTypeConfigurationAPI.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -32,9 +32,9 @@ import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; -import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; -import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; import javax.validation.Valid; import javax.ws.rs.*; @@ -55,10 +55,10 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Device Type Configuration Service") } ) -@Api(value = "Android Configuration Management", description = "This API carries all the resource used to mange the Android platform configurations.") +@Api(value = "Android Configuration Management") @Path("/configuration") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -84,7 +84,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface DeviceTypeConfigurationService { +public interface DeviceTypeConfigurationAPI { @GET @ApiOperation( @@ -136,8 +136,7 @@ public interface DeviceTypeConfigurationService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); @PUT @@ -245,8 +244,7 @@ public interface DeviceTypeConfigurationService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200.", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200.") @HeaderParam("If-Modified-Since") String ifModifiedSince) throws AndroidAgentException; } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java index 93b914a5f..09f61943c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/EventReceiverAPI.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services; +package org.wso2.carbon.device.mgt.mobile.android.api; import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Info; @@ -31,9 +31,9 @@ import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ResponseHeader; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EventBeanWrapper; import javax.validation.Valid; import javax.validation.constraints.Size; @@ -53,12 +53,10 @@ import javax.ws.rs.core.Response; } ), tags = { - @Tag(name = "android,device_management", description = "") + @Tag(name = "android,device_management", description = "Android Even Receiver Service") } ) -@Api(value = "Event Receiver", description = "Event publishing/retrieving related APIs. To enable event publishing/retrieving you need to" + - " configure WSO2 EMM as explained in https://docs.wso2.com/display/EMM220/Managing+Event+Publishing+with+WSO2+Data+Analytics+Server, " + - "https://docs.wso2.com/display/EMM220/Creating+a+New+Event+Stream+and+Receiver") +@Api(value = "Event Receiver") @Path("/events") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @@ -72,7 +70,7 @@ import javax.ws.rs.core.Response; ) } ) -public interface EventReceiverService { +public interface EventReceiverAPI { @POST @Path("/publish") @@ -131,8 +129,7 @@ public interface EventReceiverService { @ApiParam( name = "eventBeanWrapper", value = "Information of the agent event to be published on DAS.") - @Valid - EventBeanWrapper eventBeanWrapper); + @Valid EventBeanWrapper eventBeanWrapper); @GET @ApiOperation( @@ -207,8 +204,7 @@ public interface EventReceiverService { name = "If-Modified-Since", value = "Checks if the requested variant was modified, since the specified date-time.\n" + "Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" + - "Example: Mon, 05 Jan 2014 15:10:00 +0200", - required = false) + "Example: Mon, 05 Jan 2014 15:10:00 +0200") @HeaderParam("If-Modified-Since") String ifModifiedSince); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/GlobalThrowableMapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java similarity index 88% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/GlobalThrowableMapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java index 31370bd88..f45df54d3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/GlobalThrowableMapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/GlobalThrowableMapper.java @@ -16,12 +16,17 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.api.exception; import com.google.gson.JsonParseException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.ForbiddenException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.naming.AuthenticationException; import javax.validation.ConstraintViolationException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ParameterValidationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ParameterValidationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java index efb38a3d7..bf729a9e9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ParameterValidationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/exception/ParameterValidationException.java @@ -16,10 +16,10 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.api.exception; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.ConstraintViolation; import javax.ws.rs.WebApplicationException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/AndroidEnterpriseServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/AndroidEnterpriseServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java index 26805efd7..e4b541506 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/AndroidEnterpriseServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/AndroidEnterpriseAPIImpl.java @@ -16,9 +16,8 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; -import com.google.api.services.androidenterprise.model.AppRestrictionsSchema; import com.google.api.services.androidenterprise.model.ProductsListResponse; import com.google.api.services.androidenterprise.model.StoreCluster; import com.google.api.services.androidenterprise.model.StoreLayout; @@ -33,29 +32,29 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManage import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePackages; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePageLinks; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseTokenUrl; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.GoogleAppSyncResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.wrapper.TokenWrapper; -import org.wso2.carbon.mdm.services.android.common.GoogleAPIInvoker; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.services.AndroidEnterpriseService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidEnterpriseUtils; +import org.wso2.carbon.device.mgt.mobile.android.api.AndroidEnterpriseAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.GoogleAPIInvoker; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePackages; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePageLinks; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GoogleAppSyncResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.TokenWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidEnterpriseUtils; import org.wso2.carbon.policy.mgt.common.FeatureManagementException; import javax.ws.rs.Consumes; @@ -76,8 +75,8 @@ import java.util.List; @Path("/enterprise") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class AndroidEnterpriseServiceImpl implements AndroidEnterpriseService { - private static final Log log = LogFactory.getLog(AndroidEnterpriseServiceImpl.class); +public class AndroidEnterpriseAPIImpl implements AndroidEnterpriseAPI { + private static final Log log = LogFactory.getLog(AndroidEnterpriseAPIImpl.class); @Override @Produces(MediaType.APPLICATION_JSON) @@ -784,9 +783,7 @@ public class AndroidEnterpriseServiceImpl implements AndroidEnterpriseService { log.error(errorMessage); throw new NotFoundException( new ErrorResponse.ErrorResponseBuilder().setCode(Response.Status.INTERNAL_SERVER_ERROR - .getStatusCode()).setMessage(errorMessage).build()); - } - + .getStatusCode()).setMessage(errorMessage).build()); } } if (sentToDevice) { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java index 1ffadb887..ac075fb6f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAPIImpl.java @@ -32,7 +32,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -54,17 +54,19 @@ import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceExce import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtException; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseUser; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceManagementService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceManagementAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -90,10 +92,10 @@ import java.util.List; @Path("/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class DeviceManagementServiceImpl implements DeviceManagementService { +public class DeviceManagementAPIImpl implements DeviceManagementAPI { private static final String OPERATION_ERROR_STATUS = "ERROR"; - private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class); + private static final Log log = LogFactory.getLog(DeviceManagementAPIImpl.class); public static final String GOOGLE_AFW_EMM_ANDROID_ID = "googleEMMAndroidId"; public static final String GOOGLE_AFW_DEVICE_ID = "googleEMMDeviceId"; @@ -233,7 +235,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (androidDevice == null) { String errorMessage = "The payload of the android device enrollment is incorrect."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( + throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } try { @@ -264,7 +266,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { EnterpriseUser user = new EnterpriseUser(); user.setAndroidPlayDeviceId(googleEMMAndroidId); user.setEmmDeviceIdentifier(googleEMMDeviceId); - AndroidEnterpriseServiceImpl enterpriseService = new AndroidEnterpriseServiceImpl(); + AndroidEnterpriseAPIImpl enterpriseService = new AndroidEnterpriseAPIImpl(); token = enterpriseService.insertUser(user); } } @@ -427,13 +429,13 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (androidDevice == null) { String errorMessage = "The payload of the android device enrollment is incorrect."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( + throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } if (device == null) { String errorMessage = "The device to be modified doesn't exist."; log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.NotFoundException( + throw new NotFoundException( new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage(errorMessage).build()); } if(androidDevice.getEnrolmentInfo() != null){ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java index 0ed723cce..82bd09b53 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceManagementAdminAPIImpl.java @@ -33,7 +33,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -45,51 +45,51 @@ 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.core.operation.mgt.CommandOperation; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; -import org.wso2.carbon.mdm.services.android.bean.Camera; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.FileTransfer; -import org.wso2.carbon.mdm.services.android.bean.GlobalProxy; -import org.wso2.carbon.mdm.services.android.bean.LockCode; -import org.wso2.carbon.mdm.services.android.bean.DisplayMessage; -import org.wso2.carbon.mdm.services.android.bean.Notification; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; -import org.wso2.carbon.mdm.services.android.bean.Vpn; -import org.wso2.carbon.mdm.services.android.bean.WebClip; -import org.wso2.carbon.mdm.services.android.bean.Wifi; -import org.wso2.carbon.mdm.services.android.bean.WipeData; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationRestrictionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.FileTransferBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.GlobalProxyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DisplayMessageBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceManagementAdminService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceManagementAdminAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Camera; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DisplayMessage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.FileTransfer; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GlobalProxy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationRestrictionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DisplayMessageBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.FileTransferBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.GlobalProxyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.Valid; import javax.ws.rs.Consumes; @@ -110,9 +110,9 @@ import java.util.List; @Path("/admin/devices") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminService { +public class DeviceManagementAdminAPIImpl implements DeviceManagementAdminAPI { - private static final Log log = LogFactory.getLog(DeviceManagementAdminServiceImpl.class); + private static final Log log = LogFactory.getLog(DeviceManagementAdminAPIImpl.class); private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ"; @POST @@ -140,7 +140,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe operation.setType(Operation.Type.PROFILE); operation.setEnabled(true); operation.setPayLoad(file.toJSON()); - Activity activity = AndroidDeviceUtils.getOperationResponse(fileTransferBeanWrapper.getDeviceIDs(), operation); + Activity activity = AndroidDeviceUtils + .getOperationResponse(fileTransferBeanWrapper.getDeviceIDs(), operation); return Response.status(Response.Status.CREATED).entity(activity).build(); } catch (InvalidDeviceException e) { String errorMessage = "Invalid Device Identifiers ( " + fileTransferBeanWrapper.getDeviceIDs() + " ) found."; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java new file mode 100644 index 000000000..b2150f215 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/DeviceTypeConfigurationAPIImpl.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2016, 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. + * + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.android.api.impl; + +import com.google.api.client.http.HttpStatusCodes; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.mobile.android.api.DeviceTypeConfigurationAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestExceptionDup; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import javax.validation.Valid; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/configuration") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public class DeviceTypeConfigurationAPIImpl implements DeviceTypeConfigurationAPI { + + private static final Log log = LogFactory.getLog(DeviceTypeConfigurationAPIImpl.class); + + @GET + @Override + public Response getConfiguration( + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + try { + AndroidService androidService = AndroidAPIUtils.getAndroidnService(); + PlatformConfiguration platformConfiguration = androidService.getPlatformConfig(); + return Response.status(Response.Status.OK).entity(platformConfiguration).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the Android tenant configuration"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + } + + @PUT + @Override + public Response updateConfiguration( + @Valid AndroidPlatformConfiguration androidPlatformConfiguration) { + try { + AndroidService androidService = AndroidAPIUtils.getAndroidnService(); + androidService.updateConfiguration(androidPlatformConfiguration); + return Response.status(Response.Status.OK) + .entity("Android platform configuration has been updated successfully.").build(); + } catch (BadRequestExceptionDup e) { + String msg = "The payload of the android platform configuration is incorrect."; + log.error(msg, e); + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_BAD_REQUEST) + .setMessage(msg).build()); + } catch (AndroidDeviceMgtPluginException e) { + String msg = "Error occurred while modifying configuration settings of Android platform"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + + } + + @GET + @Path("/license") + @Produces(MediaType.TEXT_PLAIN) + public Response getLicense( + @HeaderParam("If-Modified-Since") String ifModifiedSince) { + try { + License license = AndroidAPIUtils.getDeviceManagementService() + .getLicense(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US); + return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while retrieving the license configured for Android device enrolment"; + log.error(msg, e); + throw new UnexpectedServerErrorException( + new ErrorResponse.ErrorResponseBuilder().setCode(HttpStatusCodes.STATUS_CODE_SERVER_ERROR) + .setMessage(msg).build()); + } + } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java index 20c0f4921..3f3f85527 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/device/mgt/mobile/android/api/impl/EventReceiverAPIImpl.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.services.impl; +package org.wso2.carbon.device.mgt.mobile.android.api.impl; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -29,17 +29,17 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.EventReceiverService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.api.EventReceiverAPI; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EventBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import javax.validation.Valid; import javax.validation.constraints.Size; @@ -52,9 +52,9 @@ import javax.ws.rs.core.Response; import java.util.List; @Path("/events") -public class EventReceiverServiceImpl implements EventReceiverService { +public class EventReceiverAPIImpl implements EventReceiverAPI { private static final String EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream"; - private static final Log log = LogFactory.getLog(EventReceiverServiceImpl.class); + private static final Log log = LogFactory.getLog(EventReceiverAPIImpl.class); private Gson gson = new Gson(); private static final String LONGITUDE = "longitude"; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java deleted file mode 100644 index 3fdc4e1ba..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ProxyType.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.wso2.carbon.mdm.services.android.bean; - -public enum ProxyType { - MANUAL, AUTO -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java deleted file mode 100644 index 385460e7c..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceTypeConfigurationServiceImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2016, 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. - * - * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. - * - * Entgra (Pvt) Ltd. 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.mdm.services.android.services.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.ServerConfiguration; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.common.EnrolmentInfo; -import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.license.mgt.License; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; -import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.NotifierFrequency; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; -import org.wso2.carbon.mdm.services.android.services.DeviceTypeConfigurationService; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; - -import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -@Path("/configuration") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurationService { - - private static final Log log = LogFactory.getLog(DeviceTypeConfigurationServiceImpl.class); - - @GET - @Override - public Response getConfiguration( - @HeaderParam("If-Modified-Since") String ifModifiedSince) { - String msg; - PlatformConfiguration platformConfiguration; - List configs; - try { - platformConfiguration = AndroidAPIUtils.getDeviceManagementService(). - getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - if (platformConfiguration != null) { - configs = platformConfiguration.getConfiguration(); - } else { - platformConfiguration = new PlatformConfiguration(); - configs = new ArrayList<>(); - } - ConfigurationEntry entry = new ConfigurationEntry(); - License license = AndroidAPIUtils.getDeviceManagementService().getLicense( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, AndroidConstants. - TenantConfigProperties.LANGUAGE_US); - - if (configs != null) { - ConfigurationEntry versionEntry = new ConfigurationEntry(); - versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); - versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); - versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); - configs.add(versionEntry); - if (license != null) { - entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); - entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); - entry.setValue(license.getText()); - configs.add(entry); - } - platformConfiguration.setConfiguration(configs); - } - } catch (DeviceManagementException e) { - msg = "Error occurred while retrieving the Android tenant configuration"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK).entity(platformConfiguration).build(); - } - - @PUT - @Override - public Response updateConfiguration(@Valid AndroidPlatformConfiguration androidPlatformConfiguration) { - String msg; - ConfigurationEntry licenseEntry = null; - PlatformConfiguration configuration = new PlatformConfiguration(); - if (androidPlatformConfiguration == null) { - String errorMessage = "The payload of the android platform configuration is incorrect."; - log.error(errorMessage); - throw new org.wso2.carbon.mdm.services.android.exception.BadRequestException( - new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); - } - configuration.setConfiguration(androidPlatformConfiguration.getConfiguration()); - try { - configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - List configs = configuration.getConfiguration(); - NotifierFrequency notifierFrequency = new NotifierFrequency(); - for (ConfigurationEntry entry : configs) { - if (AndroidConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) { - License license = new License(); - license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); - license.setLanguage(AndroidConstants.TenantConfigProperties.LANGUAGE_US); - license.setVersion("1.0.0"); - license.setText(entry.getValue().toString()); - AndroidAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants. - MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); - licenseEntry = entry; - } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { - if (entry.getValue() != null) { - notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); - } else { - return Response.status(Response.Status.BAD_REQUEST) - .entity("No value specified for notifierFrequency.").build(); - } - } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_TYPE.equals(entry.getName())) { - if (entry.getValue() != null) { - notifierFrequency.setType(Integer.parseInt(entry.getValue().toString())); - } else { - return Response.status(Response.Status.BAD_REQUEST) - .entity("No value specified for notifierType.").build(); - } - } - } - - if (licenseEntry != null) { - configs.remove(licenseEntry); - } - configuration.setConfiguration(configs); - AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); - notifyDevices(notifierFrequency); - } catch (DeviceManagementException e) { - msg = "Error occurred while modifying configuration settings of Android platform"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (NumberFormatException e) { - msg = "Error occurred while reading notification frequency."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (OperationManagementException e) { - msg = "Error occurred while modifying configuration settings of Android platform."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } catch (InvalidDeviceException e) { - msg = "Error occurred with the device."; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK) - .entity("Android platform configuration has been updated successfully.").build(); - } - - private void notifyDevices(NotifierFrequency notifierFrequency) throws DeviceManagementException, - OperationManagementException, InvalidDeviceException { - List deviceList = AndroidAPIUtils. - getDeviceManagementService(). - getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); - List deviceIdList = new ArrayList<>(); - for (Device device : deviceList) { - if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { - deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); - } - } - if (!deviceIdList.isEmpty()) { - ProfileOperation operation = new ProfileOperation(); - operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); - operation.setPayLoad(notifierFrequency.toJSON()); - operation.setEnabled(true); - AndroidAPIUtils.getDeviceManagementService().addOperation( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, - operation, deviceIdList); - } - } - - @GET - @Path("/license") - @Produces(MediaType.TEXT_PLAIN) - public Response getLicense( - @HeaderParam("If-Modified-Since") String ifModifiedSince) { - License license; - try { - license = - AndroidAPIUtils.getDeviceManagementService().getLicense( - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, - DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US); - } catch (DeviceManagementException e) { - String msg = "Error occurred while retrieving the license configured for Android device enrolment"; - log.error(msg, e); - throw new UnexpectedServerErrorException( - new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); - } - return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build(); - } - -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/DeviceIDHolder.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/DeviceIDHolder.java deleted file mode 100644 index 7b09fc700..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/DeviceIDHolder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016, 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.mdm.services.android.util; - -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; - -import java.util.List; - -/** - * Holder class for storing valid & invalid device-ids. - */ -public class DeviceIDHolder { - - private List errorDeviceIdList; - private List validDeviceIDList; - - public List getErrorDeviceIdList() { - return errorDeviceIdList; - } - - public void setErrorDeviceIdList(List errorDeviceIdList) { - this.errorDeviceIdList = errorDeviceIdList; - } - - public List getValidDeviceIDList() { - return validDeviceIDList; - } - - public void setValidDeviceIDList(List validDeviceIDList) { - this.validDeviceIDList = validDeviceIDList; - } -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 9b8fd84e1..4d74e7e7f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -44,8 +44,8 @@ - - + + @@ -60,13 +60,13 @@ - - - - - - - + + + + + + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml index b62410431..33eca93f1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/WEB-INF/web.xml @@ -76,7 +76,7 @@ ApiOriginFilter - org.wso2.carbon.mdm.services.android.util.ApiOriginFilter + org.wso2.carbon.device.mgt.mobile.android.addons.ApiOriginFilter ApiOriginFilter diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java deleted file mode 100644 index a8a267beb..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementAdminServiceTests.java +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2017, 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.mdm.services.android; - -import org.mockito.MockitoAnnotations; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockObjectFactory; -import org.testng.Assert; -import org.testng.IObjectFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.ObjectFactory; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.mdm.services.android.mocks.DeviceManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.services.impl.DeviceManagementAdminServiceImpl; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; - -import javax.ws.rs.core.Response; - -@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) -@PrepareForTest(AndroidAPIUtils.class) -public class DeviceManagementAdminServiceTests { - - private DeviceManagementAdminServiceImpl deviceManagementAdminService; - - @ObjectFactory - public IObjectFactory getObjectFactory() { - return new PowerMockObjectFactory(); - } - - @BeforeClass - public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - MockitoAnnotations.initMocks(this); - deviceManagementAdminService = new DeviceManagementAdminServiceImpl(); - } - - private void mockDeviceManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) - .toReturn(new DeviceManagementProviderServiceMock()); - } - - @Test - public void testConfigureDeviceLock() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureDeviceUnlock() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureDeviceUnlock(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceLocation() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceLocation(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRemovePassword() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.removePassword(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureCamera() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureCamera(TestUtils.getCamerabeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceInformation() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceInformation(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetDeviceLogcat() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getDeviceLogcat(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testWipeDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.wipeDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testWipeData() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.wipeData(TestUtils.getWipeDataBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetApplications() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.getApplications(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRingDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.ringDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testRebootDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.rebootDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testChangeLockTask() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.changeLockTask(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testMuteDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.muteDevice(TestUtils.getDeviceIds()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testInstallApplication() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .installApplication(TestUtils.getApplicationInstallationBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUpdateApplication() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUninstallApplicationPublic() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUninstallApplicationWebApp() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testBlacklistApplications() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService - .blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testUpgradeFirmware() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureVPN() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureVPN(TestUtils.getVpnBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSendNotification() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.sendNotification(TestUtils.getNotificationBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testConfigureWifi() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.configureWifi(TestUtils.getWifiBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testEncryptStorage() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.encryptStorage(TestUtils.getEncryptionBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testChangeLockCode() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.changeLockCode(TestUtils.getLockCodeBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSetPasswordPolicy() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testSetWebClip() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementAdminService.setWebClip(TestUtils.getWebClipBeanWrapper()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - -} - diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java deleted file mode 100644 index af08bb863..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/DeviceManagementServiceTests.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2017, 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.mdm.services.android; - -import org.mockito.MockitoAnnotations; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockObjectFactory; -import org.testng.Assert; -import org.testng.IObjectFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.ObjectFactory; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; -import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.mocks.ApplicationManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.DeviceInformationManagerServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.DeviceManagementProviderServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.NotificationManagementServiceMock; -import org.wso2.carbon.mdm.services.android.mocks.PolicyManagerServiceMock; -import org.wso2.carbon.mdm.services.android.services.impl.DeviceManagementServiceImpl; -import org.wso2.carbon.mdm.services.android.util.AndroidAPIUtils; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; - -import javax.ws.rs.core.Response; -import java.util.ArrayList; -import java.util.List; - -@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) -@PrepareForTest(AndroidAPIUtils.class) -public class DeviceManagementServiceTests { - - private DeviceManagementServiceImpl deviceManagementService; - - @ObjectFactory - public IObjectFactory getObjectFactory() { - return new PowerMockObjectFactory(); - } - - @BeforeClass - public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - MockitoAnnotations.initMocks(this); - deviceManagementService = new DeviceManagementServiceImpl(); - } - - private void mockDeviceManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) - .toReturn(new DeviceManagementProviderServiceMock()); - } - - private void mockApplicationManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getApplicationManagerService")) - .toReturn(new ApplicationManagementProviderServiceMock()); - } - - private void mockPolicyManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getPolicyManagerService")) - .toReturn(new PolicyManagerServiceMock()); - } - - private void mockDeviceInformationManagerService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceInformationManagerService")) - .toReturn(new DeviceInformationManagerServiceMock()); - } - - private void mockNotificationManagementService() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getNotificationManagementService")) - .toReturn(new NotificationManagementServiceMock()); - } - - private void mockUser() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getAuthenticatedUser")) - .toReturn("admin"); - } - - @Test - public void testUpdateApplicationList() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockApplicationManagerService(); - Response response = deviceManagementService - .updateApplicationList(TestUtils.getDeviceId(), TestUtils.getAndroidApplications()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsForNullDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - Response response = deviceManagementService - .getPendingOperations(true, null, null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); - } - - @Test - public void testGetPendingOperationsInvalidDevice() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, "1234", null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testGetPendingOperationsNullResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithMonitorResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockPolicyManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessMonitorOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithApplicationResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockApplicationManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessApplicationOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithDeviceInfoResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockDeviceInformationManagerService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getSuccessInfoOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithInProgressResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getInProgressOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testGetPendingOperationsWithErrorResponse() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockNotificationManagementService(); - Response response = deviceManagementService - .getPendingOperations(true, TestUtils.getDeviceId(), null, - TestUtils.getErrorOperationResponse()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); - } - - @Test - public void testEnrollDeviceWithoutLocationSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockPolicyManagerService(); - mockUser(); - Response response = deviceManagementService.enrollDevice(TestUtils.getBasicAndroidDevice()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testEnrollDeviceWithLocationSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockDeviceInformationManagerService(); - mockPolicyManagerService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - - List properties = new ArrayList<>(); - Device.Property property = new Device.Property(); - property.setName("LATITUDE"); - property.setValue("79.5"); - properties.add(property); - property = new Device.Property(); - property.setName("LONGITUDE"); - property.setValue("6.9"); - properties.add(property); - property = new Device.Property(); - property.setName("ALTITUDE"); - property.setValue("-59.8373726"); - properties.add(property); - property = new Device.Property(); - property.setName("SPEED"); - property.setValue("0.5123423333"); - properties.add(property); - property = new Device.Property(); - property.setName("BEARING"); - property.setValue("44.0"); - properties.add(property); - property = new Device.Property(); - property.setName("DISTANCE"); - property.setValue("44.0"); - properties.add(property); - androidDevice.setProperties(properties); - - Response response = deviceManagementService.enrollDevice(androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testEnrollDeviceUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - androidDevice.setDeviceIdentifier("1234"); - Response response = deviceManagementService.enrollDevice(androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - } - - @Test - public void testIsEnrolledExists() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled(TestUtils.getDeviceId(), null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testIsEnrolledNonExist() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled("1234", null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testIsEnrolledNull() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.isEnrolled(null, null); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - - @Test - public void testModifyEnrollmentSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - Response response = deviceManagementService - .modifyEnrollment(TestUtils.getDeviceId(), TestUtils.getBasicAndroidDevice()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); - } - - @Test - public void testModifyEnrollmentUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - mockUser(); - AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); - androidDevice.setDeviceIdentifier("1234"); - Response response = deviceManagementService - .modifyEnrollment(TestUtils.getDeviceId(), androidDevice); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_MODIFIED.getStatusCode()); - } - - @Test - public void testDisEnrollDeviceSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.disEnrollDevice(TestUtils.getDeviceId()); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); - } - - @Test - public void testDisenrollUnSuccess() - throws DeviceManagementException, OperationManagementException, InvalidDeviceException { - mockDeviceManagementService(); - Response response = deviceManagementService.disEnrollDevice("1234"); - Assert.assertNotNull(response); - Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); - } - -} - diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml new file mode 100644 index 000000000..b04328c70 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/pom.xml @@ -0,0 +1,117 @@ + + + + + + android-plugin + org.wso2.carbon.devicemgt-plugins + 5.0.5-SNAPSHOT + ../pom.xml + + + 4.0.0 + org.wso2.carbon.device.mgt.mobile.android.common + bundle + WSO2 Carbon - Mobile Device Management Android Common Impl + WSO2 Carbon - Mobile Device Management Android Common Implementation + https://entgra.io/ + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.felix + maven-scr-plugin + + + org.apache.felix + maven-bundle-plugin + true + + + ${project.artifactId} + ${project.artifactId} + ${carbon.devicemgt.plugins.version} + Device Management Mobile Android Impl Bundle + + io.swagger.annotations.*;resolution:=optional, + javax.validation.constraints, + javax.xml.bind.annotation.*, + javax.xml, + javax.xml.stream, + javax.xml.bind.*, + javax.xml.parsers; version=0.0.0, + javax.naming, + org.wso2.carbon.context, + org.wso2.carbon.utils.*, + org.wso2.carbon.device.mgt.common.*, + org.wso2.carbon.ndatasource.core, + org.wso2.carbon.policy.mgt.common.*, + org.wso2.carbon.device.mgt.extensions.license.mgt.registry, + com.google.gson.* + + + org.wso2.carbon.device.mgt.mobile.android.common.* + + + + + + + + + + org.wso2.carbon + org.wso2.carbon.logging + + + com.google.code.gson + gson + + + com.google.apis + google-api-services-androidenterprise + v1-rev186-1.25.0 + + + io.swagger + swagger-annotations + + + org.hibernate + hibernate-validator + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.common + provided + + + javax.ws.rs + javax.ws.rs-api + + + org.codehaus.jackson + jackson-core-asl + + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java index e7d618b70..d96c8d0e5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidConstants.java @@ -50,7 +50,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.common; /** * Defines constants used in Android-REST API bundle. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java index a0c7a332d..79835c2bb 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/AndroidPluginConstants.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/AndroidPluginConstants.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.util; +package org.wso2.carbon.device.mgt.mobile.android.common; /** * Defines constants used by android plugin. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java index 542cd6078..2bcbbed6f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorHandler.java @@ -15,9 +15,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; -import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidAgentException; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorMessage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorMessage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java index fd880c04c..793fb7291 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/ErrorMessage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/ErrorMessage.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; public class ErrorMessage { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GoogleAPIInvoker.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GoogleAPIInvoker.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java index 4e700a7e1..da1cc2023 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GoogleAPIInvoker.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GoogleAPIInvoker.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; @@ -49,11 +49,11 @@ import com.google.api.services.androidenterprise.model.User; import com.google.common.collect.ImmutableList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStoreCluster; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePackages; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseStorePage; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStoreCluster; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePackages; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseStorePage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseTokenUrl; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GsonMessageBodyHandler.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GsonMessageBodyHandler.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java index 297630029..9ffe273a4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/common/GsonMessageBodyHandler.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/GsonMessageBodyHandler.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.common; +package org.wso2.carbon.device.mgt.mobile.android.common; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/Message.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/Message.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java index 8cb5f6d14..b8168d837 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/Message.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/Message.java @@ -16,9 +16,8 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.common; -import javax.ws.rs.core.MediaType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidOperation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidOperation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java index 3361b90dc..aeccd384d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidOperation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidOperation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.google.gson.Gson; /* diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidPlatformConfiguration.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidPlatformConfiguration.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java index 9832c3f03..7dc0505ec 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AndroidPlatformConfiguration.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AndroidPlatformConfiguration.java @@ -16,12 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApiRegistrationProfile.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApiRegistrationProfile.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java index 6b14c0d38..a88a907e7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApiRegistrationProfile.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApiRegistrationProfile.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class ApiRegistrationProfile { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AppRestriction.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AppRestriction.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java index 2c8d8c93d..4f82dcc7c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/AppRestriction.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/AppRestriction.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java index 4c90d42cb..3fcfc34a1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationInstallation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java index b3773376d..1ed7f1243 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationRestriction.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationRestriction.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java index a5356ae59..e8efbdef0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUninstallation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java index 95241b444..cd9084df1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ApplicationUpdate.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BasicUserInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BasicUserInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java index 6117fb246..1f361b336 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BasicUserInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BasicUserInfo.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BlacklistApplications.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BlacklistApplications.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java index b7db28976..cf99c2cf4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/BlacklistApplications.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/BlacklistApplications.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Camera.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Camera.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java index 0dad70364..21ee35f08 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Camera.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Camera.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceEncryption.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceEncryption.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java index 68ab6ae94..0b5473de1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceEncryption.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceEncryption.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceLock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceLock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java index e76ff6f1a..f0475d7c3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceLock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceLock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceState.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceState.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java index fb23b0fcc..911fe5f37 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DeviceState.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DeviceState.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Disenrollment.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Disenrollment.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java index c591d2ae0..99e329c7d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Disenrollment.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Disenrollment.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; + import java.io.Serializable; @ApiModel(value = "Disenrollment", diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DisplayMessage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DisplayMessage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java index 20531f6f9..eda425738 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/DisplayMessage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/DisplayMessage.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseConfigs.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseConfigs.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java index 41abaa380..81d58ec42 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseConfigs.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseConfigs.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseConfigs { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStoreCluster.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStoreCluster.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java index a29e46e1a..59d2eff9c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStoreCluster.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStoreCluster.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePackages.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePackages.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java index a93672892..69dba56d9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePackages.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePackages.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseStorePackages { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePage.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePage.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java index 841338d52..b6b578897 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePage.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePage.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePageLinks.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePageLinks.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java index 9fb4f5050..73b514830 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseStorePageLinks.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseStorePageLinks.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseTokenUrl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseTokenUrl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java index e93e20c10..7aaf2739d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/EnterpriseTokenUrl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/EnterpriseTokenUrl.java @@ -17,7 +17,7 @@ * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class EnterpriseTokenUrl { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorListItem.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorListItem.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java index 1e48b0183..2d8ca0856 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorListItem.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorListItem.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorResponse.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorResponse.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java index 457782ade..97b7eb768 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ErrorResponse.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ErrorResponse.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java index 2e8af23a7..8677147f5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/FileTransfer.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/FileTransfer.java @@ -15,11 +15,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.AndroidOperation; import java.io.Serializable; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GlobalProxy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GlobalProxy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java index 5414a1407..46fb31c73 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GlobalProxy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GlobalProxy.java @@ -17,7 +17,7 @@ * */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GoogleAppSyncResponse.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java similarity index 77% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GoogleAppSyncResponse.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java index 3eafae848..896eeef08 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/GoogleAppSyncResponse.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/GoogleAppSyncResponse.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; public class GoogleAppSyncResponse { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/LockCode.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/LockCode.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java index 4c2764dad..0e139e924 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/LockCode.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/LockCode.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Notification.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Notification.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java index 7cc4d4627..ade05a1a4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Notification.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Notification.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java index b38a8b802..f441ffb1e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/NotifierFrequency.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/NotifierFrequency.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/PasscodePolicy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/PasscodePolicy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java index c2e48ce70..8cd56e51e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/PasscodePolicy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/PasscodePolicy.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java new file mode 100644 index 000000000..d638b071f --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/ProxyType.java @@ -0,0 +1,5 @@ +package org.wso2.carbon.device.mgt.mobile.android.common.bean; + +public enum ProxyType { + MANUAL, AUTO +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/UpgradeFirmware.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/UpgradeFirmware.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java index 748ee0e59..f07a519db 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/UpgradeFirmware.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/UpgradeFirmware.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Vpn.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Vpn.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java index 188d44f8f..76be3fc28 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Vpn.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Vpn.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WebClip.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WebClip.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java index cf39b1070..06b815df4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WebClip.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WebClip.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Wifi.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Wifi.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java index 8cdf3c58b..d8e130987 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/Wifi.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/Wifi.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WipeData.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WipeData.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java index 83efddc12..ff1c05bc0 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/WipeData.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/WipeData.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean; +package org.wso2.carbon.device.mgt.mobile.android.common.bean; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidApplication.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidApplication.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java index 8dee1a60d..1c1776350 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidApplication.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidApplication.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java index 6c5fcec34..274b6ec89 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDevice.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.Device; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDeviceInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDeviceInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java index 41fbb5857..148d46d56 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDeviceInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AndroidDeviceInfo.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AppRestrictionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AppRestrictionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java index 64412336e..70a520b89 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AppRestrictionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/AppRestrictionBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.AppRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AppRestriction; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationInstallationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationInstallationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java index b0bd54cf3..688703080 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationInstallationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationInstallationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java index 147a577da..0f6e8b979 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationRestrictionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationRestrictionBeanWrapper.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationRestriction; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationRestriction; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUninstallationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUninstallationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java index 28c72c6cd..ad88bbb35 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUninstallationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUninstallationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUpdateBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUpdateBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java index b202bf883..241cec506 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/ApplicationUpdateBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/ApplicationUpdateBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/BlacklistApplicationsBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/BlacklistApplicationsBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java index 32b107bf4..19f0e5a36 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/BlacklistApplicationsBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/BlacklistApplicationsBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; import javax.validation.Valid; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/CameraBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/CameraBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java index 9f9a014f2..04ac86a90 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/CameraBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/CameraBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Camera; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Camera; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceEnrollmentInfo.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceEnrollmentInfo.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java index b2f77cc31..c6882a6e7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceEnrollmentInfo.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceEnrollmentInfo.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceLockBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceLockBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java index bd668faba..31e5e41aa 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DeviceLockBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DeviceLockBeanWrapper.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisenrollmentBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisenrollmentBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java index fdcab0120..308da5161 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisenrollmentBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisenrollmentBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Disenrollment; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Disenrollment; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisplayMessageBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisplayMessageBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java index 8ef1fe644..ca1330b3c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/DisplayMessageBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/DisplayMessageBeanWrapper.java @@ -16,11 +16,11 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DisplayMessage; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DisplayMessage; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EncryptionBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EncryptionBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java index aeb01400a..557d39540 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EncryptionBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EncryptionBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseApp.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseApp.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java index e20d1547d..1d12d1d95 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseApp.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseApp.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import com.google.api.services.androidenterprise.model.VariableSet; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseInstallPolicy.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseInstallPolicy.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java index 677e6d33c..fe659659b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseInstallPolicy.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseInstallPolicy.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import java.io.Serializable; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseUser.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseUser.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java index 990e3fa4e..ff9bc4b38 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EnterpriseUser.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EnterpriseUser.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; public class EnterpriseUser { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EventBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EventBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java index c4fb13e07..ed4e314d3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/EventBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/EventBeanWrapper.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java index d34b00e66..4777c3133 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/FileTransferBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/FileTransferBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.FileTransfer; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.FileTransfer; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/GlobalProxyBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/GlobalProxyBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java index 1063ee260..09c3bc0e3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/GlobalProxyBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/GlobalProxyBeanWrapper.java @@ -17,11 +17,11 @@ * */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.GlobalProxy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.GlobalProxy; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/LockCodeBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/LockCodeBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java index 364fd39d2..4cf164d46 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/LockCodeBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/LockCodeBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/NotificationBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/NotificationBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java index eb82e49ee..97bb7f706 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/NotificationBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/NotificationBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/PasswordPolicyBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/PasswordPolicyBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java index e47ece1c5..b9e728624 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/PasswordPolicyBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/PasswordPolicyBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/TokenWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java similarity index 72% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/TokenWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java index a3a706efa..7bf731e18 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/TokenWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/TokenWrapper.java @@ -1,4 +1,4 @@ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; public class TokenWrapper { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/UpgradeFirmwareBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/UpgradeFirmwareBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java index b881422c2..ed0231d6a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/UpgradeFirmwareBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/UpgradeFirmwareBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/VpnBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/VpnBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java index e71270d22..1a2d67a59 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/VpnBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/VpnBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WebClipBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WebClipBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java index fb2edc239..6f8667311 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WebClipBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WebClipBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WifiBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WifiBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java index 2d63a27d9..85e6df2d3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WifiBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WifiBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WipeDataBeanWrapper.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java similarity index 91% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WipeDataBeanWrapper.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java index b7ebb2903..fe753bd3f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/WipeDataBeanWrapper.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/bean/wrapper/WipeDataBeanWrapper.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.bean.wrapper; +package org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.mdm.services.android.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/AndroidDataSourceConfigurations.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/AndroidDataSourceConfigurations.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java index 9409bab13..a0d3fbbd7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/AndroidDataSourceConfigurations.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/AndroidDataSourceConfigurations.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlElement; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/DataSourceConfigAdapter.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/DataSourceConfigAdapter.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java index 75a95c7c7..5b0aa5713 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/DataSourceConfigAdapter.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/DataSourceConfigAdapter.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.util.HashMap; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/JNDILookupDefinition.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/JNDILookupDefinition.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java index d98022058..770963989 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/JNDILookupDefinition.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/JNDILookupDefinition.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.*; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfig.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfig.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java index cb0e78fb2..09bb84de4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfig.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfig.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfigurations.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfigurations.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java index c698e7800..b4613bd99 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/datasource/MobileDataSourceConfigurations.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/datasource/MobileDataSourceConfigurations.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource; +package org.wso2.carbon.device.mgt.mobile.android.common.config.datasource; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/task/TaskConfiguration.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/task/TaskConfiguration.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java index 9c98306fb..56b873c34 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/task/TaskConfiguration.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/config/task/TaskConfiguration.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.config.task; +package org.wso2.carbon.device.mgt.mobile.android.common.config.task; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseManagedConfig.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseManagedConfig.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java index 687327d6d..30e717dc7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseManagedConfig.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseManagedConfig.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; public class AndroidEnterpriseManagedConfig { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseUser.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseUser.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java index 48bddbb03..afd64a12e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/AndroidEnterpriseUser.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/AndroidEnterpriseUser.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; public class AndroidEnterpriseUser { String emmUsername; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ErrorDTO.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ErrorDTO.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java index ebd5ec8fc..44e3385ca 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ErrorDTO.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/ErrorDTO.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.util.ArrayList; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDevice.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java index 2b064452a..7644cb3cc 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDevice.java @@ -16,10 +16,9 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.io.Serializable; -import java.util.Date; import java.util.HashMap; import java.util.Map; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDeviceOperationMapping.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDeviceOperationMapping.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java index ae855e2ab..279f93883 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileDeviceOperationMapping.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileDeviceOperationMapping.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; /** * DTO of Mobile Device Operation Mappings. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java index 1778f8560..576fd92c7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileFeature.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileFeature.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.io.Serializable; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperation.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java index fa9723484..5f1571394 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperation.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperationProperty.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperationProperty.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java index 5147bb004..04f7b58d5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dto/MobileOperationProperty.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/dto/MobileOperationProperty.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dto; +package org.wso2.carbon.device.mgt.mobile.android.common.dto; /** * DTO of Mobile Operation property. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidAgentException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidAgentException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java index c12d03538..697fefa26 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidAgentException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidAgentException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidDeviceMgtPluginException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidDeviceMgtPluginException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java index 4a0b6a1c7..117c42905 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/AndroidDeviceMgtPluginException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidDeviceMgtPluginException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; public class AndroidDeviceMgtPluginException extends Exception{ diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidOperationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java similarity index 89% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidOperationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java index 8c68866d8..527c1b45e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/AndroidOperationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/AndroidOperationException.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.util.Message; +import org.wso2.carbon.device.mgt.mobile.android.common.Message; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/BadRequestException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java similarity index 87% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/BadRequestException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java index 5fa5ededc..3213a8ed7 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/BadRequestException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestException.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java new file mode 100644 index 000000000..0d1220e9d --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/BadRequestExceptionDup.java @@ -0,0 +1,32 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.android.common.exception; + +/** + * Represents the exception thrown during validating the request. + */ +public class BadRequestExceptionDup extends AndroidDeviceMgtPluginException { + + public BadRequestExceptionDup(String message, Throwable ex) { + super(message, ex); + } + + public BadRequestExceptionDup(String message) { + super(message); + } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseManagementDAOException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseManagementDAOException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java index 86af32e80..4b8c17276 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseManagementDAOException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseManagementDAOException.java @@ -33,7 +33,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for enterprise specific data access related exceptions. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/EnterpriseServiceException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/EnterpriseServiceException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java index d8b5e80df..9153f5948 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/EnterpriseServiceException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/EnterpriseServiceException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for enterprise specific data access related exceptions. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ForbiddenException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java similarity index 87% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ForbiddenException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java index 75113f850..451a3e033 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/ForbiddenException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/ForbiddenException.java @@ -16,9 +16,10 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java index f87ddbfec..395da6acd 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/MobileDeviceManagementDAOException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * Custom exception class for mobile device specific data access related exceptions. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/NotFoundException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java similarity index 83% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/NotFoundException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java index 53863c3ac..3f412587d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/NotFoundException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/NotFoundException.java @@ -16,10 +16,11 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/OperationConfigurationException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/OperationConfigurationException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java index 1300b1481..93f677aa4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/OperationConfigurationException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/OperationConfigurationException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; /** * diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/UnexpectedServerErrorException.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/UnexpectedServerErrorException.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java index a66c2f506..b00a4e51f 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/exception/UnexpectedServerErrorException.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/exception/UnexpectedServerErrorException.java @@ -16,10 +16,11 @@ * under the License. * */ -package org.wso2.carbon.mdm.services.android.exception; +package org.wso2.carbon.device.mgt.mobile.android.common.exception; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.ErrorDTO; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java similarity index 79% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java index 7bc4ad3be..a10fc418e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/AndroidPluginService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidGoogleEnterpriseService.java @@ -16,15 +16,15 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android; +package org.wso2.carbon.device.mgt.mobile.android.common.spi; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import java.util.List; -public interface AndroidPluginService { +public interface AndroidGoogleEnterpriseService { void addEnterpriseUser(AndroidEnterpriseUser androidEnterpriseUser) throws EnterpriseServiceException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java new file mode 100644 index 000000000..406038e79 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.common/src/main/java/org/wso2/carbon/device/mgt/mobile/android/common/spi/AndroidService.java @@ -0,0 +1,31 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.android.common.spi; + +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; + +public interface AndroidService { + + PlatformConfiguration getPlatformConfig() throws DeviceManagementException; + + void updateConfiguration(AndroidPlatformConfiguration androidPlatformConfiguration) + throws AndroidDeviceMgtPluginException; +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml similarity index 69% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml index 99b428302..ee22567e1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.core bundle - WSO2 Carbon - Mobile Device Management Android Impl - WSO2 Carbon - Mobile Device Management Android Implementation + WSO2 Carbon - Mobile Device Management Android Core Impl + WSO2 Carbon - Mobile Device Management Android Core Implementation http://wso2.org @@ -53,7 +53,7 @@ ${project.artifactId} ${carbon.devicemgt.plugins.version} Device Management Mobile Android Impl Bundle - org.wso2.carbon.device.mgt.mobile.android.internal + org.wso2.carbon.device.mgt.mobile.android.core.internal org.osgi.framework, org.osgi.service.component, @@ -78,8 +78,8 @@ com.google.gson.* - !org.wso2.carbon.device.mgt.mobile.android.internal, - org.wso2.carbon.device.mgt.mobile.android.* + !org.wso2.carbon.device.mgt.mobile.android.core.internal, + org.wso2.carbon.device.mgt.mobile.android.core.* @@ -134,10 +134,6 @@ org.wso2.carbon org.wso2.carbon.utils - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.common - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.extensions @@ -146,29 +142,86 @@ org.wso2.carbon org.wso2.carbon.ndatasource.core + + org.wso2.carbon + org.wso2.carbon.registry.api + + + org.wso2.carbon + org.wso2.carbon.registry.core + + + org.apache.tomcat.wso2 + jdbc-pool + + + com.google.code.gson + gson + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.application.mgt.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.core + provided + + + org.slf4j + slf4j-api + + + org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common + provided org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core + provided - org.wso2.carbon - org.wso2.carbon.registry.api + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.application.extension + provided - org.wso2.carbon - org.wso2.carbon.registry.core + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.common + provided + + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.annotations + provided org.testng testng + test - org.apache.tomcat.wso2 - jdbc-pool + org.powermock + powermock-module-testng + test + + + org.powermock + powermock-api-mockito + test com.h2database.wso2 @@ -176,8 +229,33 @@ test - com.google.code.gson - gson + org.wso2.carbon + org.wso2.carbon.queuing + test + + + org.wso2.carbon + org.wso2.carbon.ndatasource.core + + + commons-dbcp.wso2 + commons-dbcp + test + + + commons-pool.wso2 + commons-pool + test + + + org.wso2.carbon + javax.cache.wso2 + test + + + javassist + javassist + test diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AbstractMobileDeviceManagementDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AbstractMobileDeviceManagementDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java index 634951826..e22bfabcc 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AbstractMobileDeviceManagementDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AbstractMobileDeviceManagementDAOFactory.java @@ -16,14 +16,14 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.JNDILookupDefinition; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.AndroidDeviceMgtPluginException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.util.MobileDeviceManagementDAOUtil; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.JNDILookupDefinition; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.MobileDataSourceConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.util.MobileDeviceManagementDAOUtil; import javax.sql.DataSource; import java.util.HashMap; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AndroidDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AndroidDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java index 2ccd09374..d18cc0f8a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/AndroidDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/AndroidDAOFactory.java @@ -16,12 +16,13 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.EnterpriseDAOImpl; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.impl.EnterpriseDAOImpl; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseDAO.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java similarity index 84% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseDAO.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java index 87aafb814..79c91e3e5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/EnterpriseDAO.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/EnterpriseDAO.java @@ -16,10 +16,11 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; import java.util.List; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOFactory.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java similarity index 92% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOFactory.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java index d4746f623..6ba69f723 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/MobileDeviceManagementDAOFactory.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/MobileDeviceManagementDAOFactory.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao; +package org.wso2.carbon.device.mgt.mobile.android.core.dao; public interface MobileDeviceManagementDAOFactory { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/EnterpriseDAOImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/EnterpriseDAOImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java index 8dbdb6e29..0abfa811c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/impl/EnterpriseDAOImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/impl/EnterpriseDAOImpl.java @@ -16,19 +16,16 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl; +package org.wso2.carbon.device.mgt.mobile.android.core.dao.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AndroidDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseDAO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.MobileDeviceManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.util.MobileDeviceManagementDAOUtil; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDevice; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.AndroidPluginConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AndroidDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.EnterpriseDAO; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.util.MobileDeviceManagementDAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; @@ -37,9 +34,7 @@ import java.sql.SQLException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * Implements EnterpriseDAO for Android Devices. diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/util/MobileDeviceManagementDAOUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/util/MobileDeviceManagementDAOUtil.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java index 1892ddecb..decfbdb3b 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/dao/util/MobileDeviceManagementDAOUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/dao/util/MobileDeviceManagementDAOUtil.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.dao.util; +package org.wso2.carbon.device.mgt.mobile.android.core.dao.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidPluginServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java similarity index 90% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidPluginServiceImpl.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java index 1fc0754f9..67d79b8f4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/AndroidPluginServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidGoogleEnterpriseServiceImpl.java @@ -32,29 +32,30 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl; +package org.wso2.carbon.device.mgt.mobile.android.core.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AndroidDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseDAO; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.EnterpriseManagementDAOException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseManagementDAOException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AndroidDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.EnterpriseDAO; import java.util.List; /** * This represents the Android implementation of DeviceManagerService. */ -public class AndroidPluginServiceImpl implements AndroidPluginService { +public class AndroidGoogleEnterpriseServiceImpl implements AndroidGoogleEnterpriseService { - private static final Log log = LogFactory.getLog(AndroidPluginServiceImpl.class); + private static final Log log = LogFactory.getLog(AndroidGoogleEnterpriseServiceImpl.class); private EnterpriseDAO enterpriseDAO; - public AndroidPluginServiceImpl() { + public AndroidGoogleEnterpriseServiceImpl() { enterpriseDAO = AndroidDAOFactory.getEnterpriseDAO(); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java new file mode 100644 index 000000000..a8a367c83 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidPluginServiceImpl.java @@ -0,0 +1,75 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.android.core.impl; + +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.EnrolmentInfo; +import org.wso2.carbon.device.mgt.common.MDMAppConstants; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.spi.DeviceTypePluginService; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class AndroidPluginServiceImpl implements DeviceTypePluginService { + + @Override + public Map getEnrollmentQRCode() throws DeviceManagementException { + return null; + } + +// private void getPlatformConfig() { +// PlatformConfiguration platformConfiguration; +// List configs; +// try { +// platformConfiguration = AndroidAPIUtils.getDeviceManagementService(). +// getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); +// if (platformConfiguration != null) { +// configs = platformConfiguration.getConfiguration(); +// } else { +// platformConfiguration = new PlatformConfiguration(); +// configs = new ArrayList<>(); +// } +// ConfigurationEntry entry = new ConfigurationEntry(); +// License license = AndroidAPIUtils.getDeviceManagementService().getLicense( +// DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, MDMAppConstants.AndroidConstants. +// TenantConfigProperties.LANGUAGE_US); +// +// if (configs != null) { +// ConfigurationEntry versionEntry = new ConfigurationEntry(); +// versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); +// versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); +// versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); +// configs.add(versionEntry); +// if (license != null) { +// entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); +// entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); +// entry.setValue(license.getText()); +// configs.add(entry); +// } +// platformConfiguration.setConfiguration(configs); +// } +// } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java new file mode 100644 index 000000000..78077948f --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/impl/AndroidServiceImpl.java @@ -0,0 +1,184 @@ +/* Copyright (c) 2019, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. 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.android.core.impl; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.common.EnrolmentInfo; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.license.mgt.License; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; +import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.AndroidPlatformConfiguration; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.NotifierFrequency; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestExceptionDup; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + +public class AndroidServiceImpl implements AndroidService { + + private static final Log log = LogFactory.getLog(AndroidServiceImpl.class); + + @Override + public PlatformConfiguration getPlatformConfig() throws DeviceManagementException { + List configs; + PlatformConfiguration platformConfiguration; + + DeviceManagementProviderService deviceManagementProviderService = AndroidAPIUtils.getDeviceManagementService(); + platformConfiguration = deviceManagementProviderService. + getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + if (platformConfiguration != null) { + configs = platformConfiguration.getConfiguration(); + } else { + platformConfiguration = new PlatformConfiguration(); + configs = new ArrayList<>(); + } + + if (configs != null) { + ConfigurationEntry versionEntry = new ConfigurationEntry(); + versionEntry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); + versionEntry.setName(AndroidConstants.TenantConfigProperties.SERVER_VERSION); + versionEntry.setValue(ServerConfiguration.getInstance().getFirstProperty("Version")); + configs.add(versionEntry); + + License license = deviceManagementProviderService + .getLicense(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + AndroidConstants. + TenantConfigProperties.LANGUAGE_US); + if (license != null) { + ConfigurationEntry entry = new ConfigurationEntry(); + entry.setContentType(AndroidConstants.TenantConfigProperties.CONTENT_TYPE_TEXT); + entry.setName(AndroidConstants.TenantConfigProperties.LICENSE_KEY); + entry.setValue(license.getText()); + configs.add(entry); + } + platformConfiguration.setConfiguration(configs); + } + return platformConfiguration; + } + + @Override + public void updateConfiguration(AndroidPlatformConfiguration androidPlatformConfiguration) throws + AndroidDeviceMgtPluginException { + ConfigurationEntry licenseEntry = null; + PlatformConfiguration configuration = new PlatformConfiguration(); + if (androidPlatformConfiguration == null) { + String errorMessage = "The payload of the android platform configuration is null."; + log.error(errorMessage); + throw new BadRequestExceptionDup(errorMessage); + } + configuration.setConfiguration(androidPlatformConfiguration.getConfiguration()); + try { + DeviceManagementProviderService deviceManagementProviderService = AndroidAPIUtils + .getDeviceManagementService(); + configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + List configs = configuration.getConfiguration(); + NotifierFrequency notifierFrequency = new NotifierFrequency(); + for (ConfigurationEntry entry : configs) { + if (AndroidConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) { + License license = new License(); + license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); + license.setLanguage(AndroidConstants.TenantConfigProperties.LANGUAGE_US); + license.setVersion("1.0.0"); + license.setText(entry.getValue().toString()); + deviceManagementProviderService.addLicense(DeviceManagementConstants. + MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, license); + licenseEntry = entry; + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_FREQUENCY.equals(entry.getName())) { + if (entry.getValue() != null) { + notifierFrequency.setValue(Integer.parseInt(entry.getValue().toString())); + } else { + String msg = "No value specified for notifierFrequency."; + log.error(msg); + throw new BadRequestExceptionDup(msg); + } + } else if (AndroidConstants.TenantConfigProperties.NOTIFIER_TYPE.equals(entry.getName())) { + if (entry.getValue() != null) { + notifierFrequency.setType(Integer.parseInt(entry.getValue().toString())); + } else { + String msg = "No value specified for notifierType."; + log.error(msg); + throw new BadRequestExceptionDup(msg); + } + } + } + + if (licenseEntry != null) { + configs.remove(licenseEntry); + } + configuration.setConfiguration(configs); + deviceManagementProviderService.saveConfiguration(configuration); + notifyDevices(notifierFrequency); + } catch (DeviceManagementException e) { + String msg = "Error occurred while getting device management service to modify Android config settings"; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (NumberFormatException e) { + String msg = "Error occurred while reading notification frequency."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (OperationManagementException e) { + String msg = "Error occurred while modifying configuration settings of Android platform."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } catch (InvalidDeviceException e) { + String msg = "Error occurred with the device."; + log.error(msg, e); + throw new AndroidDeviceMgtPluginException(msg, e); + } + } + + private void notifyDevices(NotifierFrequency notifierFrequency) throws DeviceManagementException, + OperationManagementException, InvalidDeviceException { + List deviceList = AndroidAPIUtils. + getDeviceManagementService(). + getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, false); + List deviceIdList = new ArrayList<>(); + for (Device device : deviceList) { + if (EnrolmentInfo.Status.REMOVED != device.getEnrolmentInfo().getStatus()) { + deviceIdList.add(new DeviceIdentifier(device.getDeviceIdentifier(), device.getType())); + } + } + if (!deviceIdList.isEmpty()) { + ProfileOperation operation = new ProfileOperation(); + operation.setCode(AndroidConstants.OperationCodes.NOTIFIER_FREQUENCY); + operation.setPayLoad(notifierFrequency.toJSON()); + operation.setEnabled(true); + AndroidAPIUtils.getDeviceManagementService().addOperation( + DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, + operation, deviceIdList); + } + } +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidDeviceManagementDataHolder.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java similarity index 69% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidDeviceManagementDataHolder.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java index 09d111fca..9f4740313 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidDeviceManagementDataHolder.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidDeviceManagementDataHolder.java @@ -16,10 +16,10 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.internal; +package org.wso2.carbon.device.mgt.mobile.android.core.internal; -import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; import org.wso2.carbon.registry.core.service.RegistryService; /** @@ -28,7 +28,8 @@ import org.wso2.carbon.registry.core.service.RegistryService; public class AndroidDeviceManagementDataHolder { private RegistryService registryService; - private AndroidPluginService androidDeviceManagementService; + private AndroidGoogleEnterpriseService androidDeviceManagementService; + private AndroidService androidService; private static AndroidDeviceManagementDataHolder thisInstance = new AndroidDeviceManagementDataHolder(); @@ -47,13 +48,20 @@ public class AndroidDeviceManagementDataHolder { this.registryService = registryService; } - public AndroidPluginService getAndroidDeviceManagementService() { + public AndroidGoogleEnterpriseService getAndroidDeviceManagementService() { return androidDeviceManagementService; } public void setAndroidDeviceManagementService( - AndroidPluginService androidDeviceManagementService) { + AndroidGoogleEnterpriseService androidDeviceManagementService) { this.androidDeviceManagementService = androidDeviceManagementService; } + public AndroidService getAndroidService() { + return androidService; + } + + public void setAndroidService(AndroidService androidService) { + this.androidService = androidService; + } } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidPluginServiceComponent.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java similarity index 80% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidPluginServiceComponent.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java index 08f0c1c95..2ee731c65 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/internal/AndroidPluginServiceComponent.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/internal/AndroidPluginServiceComponent.java @@ -16,21 +16,23 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.internal; +package org.wso2.carbon.device.mgt.mobile.android.core.internal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.device.mgt.mobile.android.impl.AndroidPluginServiceImpl; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.AbstractMobileDeviceManagementDAOFactory; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.MobileDeviceManagementUtil; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; +import org.wso2.carbon.device.mgt.mobile.android.core.dao.AbstractMobileDeviceManagementDAOFactory; +import org.wso2.carbon.device.mgt.mobile.android.core.impl.AndroidGoogleEnterpriseServiceImpl; +import org.wso2.carbon.device.mgt.mobile.android.core.impl.AndroidServiceImpl; +import org.wso2.carbon.device.mgt.mobile.android.core.util.MobileDeviceManagementUtil; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; /** - * @scr.component name="org.wso2.carbon.device.mgt.mobile.android.impl.internal.AndroidPluginServiceComponent" + * @scr.component name="org.wso2.carbon.device.mgt.mobile.android.core.impl.internal.AndroidPluginServiceComponent" * immediate="true" * @scr.reference name="org.wso2.carbon.ndatasource" * interface="org.wso2.carbon.ndatasource.core.DataSourceService" @@ -58,15 +60,19 @@ public class AndroidPluginServiceComponent { try { BundleContext bundleContext = ctx.getBundleContext(); - MobileDeviceManagementUtil.initConfig(); AbstractMobileDeviceManagementDAOFactory.init("android", MobileDeviceManagementUtil .getIosDataSourceConfigurations().getIosDataSourceConfiguration()); - AndroidPluginService androidPluginService = new AndroidPluginServiceImpl(); + AndroidService androidService = new AndroidServiceImpl(); + AndroidDeviceManagementDataHolder.getInstance().setAndroidService( + androidService); + bundleContext.registerService(AndroidService.class.getName(), androidService, null); + + AndroidGoogleEnterpriseService androidPluginService = new AndroidGoogleEnterpriseServiceImpl(); AndroidDeviceManagementDataHolder.getInstance().setAndroidDeviceManagementService( androidPluginService); - bundleContext.registerService(AndroidPluginService.class.getName(), androidPluginService, null); + bundleContext.registerService(AndroidGoogleEnterpriseService.class.getName(), androidPluginService, null); if (log.isDebugEnabled()) { log.debug("Android Mobile Device Management Service Component has been successfully activated"); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java similarity index 87% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java index f91e67424..5fe4f401d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidAPIUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -34,9 +34,11 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementExcept import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.device.mgt.mobile.android.AndroidPluginService; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidGoogleEnterpriseService; +import org.wso2.carbon.device.mgt.mobile.android.common.spi.AndroidService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -55,10 +57,10 @@ public class AndroidAPIUtils { throw new IllegalStateException("Utility class"); } - public static AndroidPluginService getAndroidPluginService() { + public static AndroidGoogleEnterpriseService getAndroidPluginService() { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - AndroidPluginService androidPluginService = - (AndroidPluginService) ctx.getOSGiService(AndroidPluginService.class, null); + AndroidGoogleEnterpriseService androidPluginService = + (AndroidGoogleEnterpriseService) ctx.getOSGiService(AndroidGoogleEnterpriseService.class, null); if (androidPluginService == null) { String msg = "Android plugin service has not initialized."; log.error(msg); @@ -67,6 +69,17 @@ public class AndroidAPIUtils { return androidPluginService; } + public static AndroidService getAndroidnService() { + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + AndroidService androidService = (AndroidService) ctx.getOSGiService(AndroidService.class, null); + if (androidService == null) { + String msg = "Android service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return androidService; + } + public static String getAuthenticatedUser() { PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); String username = threadLocalCarbonContext.getUsername(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidDeviceUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidDeviceUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java index a66e3a07f..51edcb75d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidDeviceUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidDeviceUtils.java @@ -33,7 +33,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -62,13 +62,13 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.app.mgt.Application; -import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; @@ -85,17 +85,18 @@ import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceDetailsMgtExcept import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation; import org.wso2.carbon.device.mgt.core.search.mgt.impl.Utils; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.GoogleAPIInvoker; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceState; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorListItem; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.BadRequestException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; -import org.wso2.carbon.mdm.services.android.bean.DeviceState; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.ErrorListItem; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.common.GoogleAPIInvoker; -import org.wso2.carbon.mdm.services.android.exception.BadRequestException; import org.wso2.carbon.policy.mgt.common.FeatureManagementException; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; @@ -207,7 +208,8 @@ public class AndroidDeviceUtils { } public static void updateOperation(String deviceId, Operation operation) - throws OperationManagementException, PolicyComplianceException, ApplicationManagementException { + throws OperationManagementException, PolicyComplianceException, + org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException { DeviceIdentifier deviceIdentifier = new DeviceIdentifier(); deviceIdentifier.setId(deviceId); deviceIdentifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); @@ -351,35 +353,32 @@ public class AndroidDeviceUtils { * @param deviceIdentifier device to apply policy */ private static void sendPayloadToGoogle(String uuid, String payload, DeviceIdentifier deviceIdentifier) - throws org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException { + throws ApplicationManagementException { try { EnterpriseConfigs enterpriseConfigs = AndroidEnterpriseUtils.getEnterpriseConfigsFromGoogle(); - if (enterpriseConfigs != null && enterpriseConfigs.getErrorResponse() == null) { + if (enterpriseConfigs.getErrorResponse() == null) { GoogleAPIInvoker googleAPIInvoker = new GoogleAPIInvoker(enterpriseConfigs.getEsa()); AndroidEnterpriseUser userDetail = AndroidAPIUtils.getAndroidPluginService() .getEnterpriseUserByDevice(deviceIdentifier.getId()); if (userDetail != null && userDetail.getEnterpriseId() != null && !userDetail.getEnterpriseId() - .isEmpty() && userDetail.getEmmUsername() != null) { - - if (payload != null) { -// ProfileFeature feature = AndroidDeviceUtils.getEnrollmentPolicy(deviceIdentifier); - EnterpriseInstallPolicy enterpriseInstallPolicy = AndroidEnterpriseUtils - .getDeviceAppPolicy(payload, null, userDetail); - - List apps = new ArrayList<>(); - for (EnterpriseApp enterpriseApp : enterpriseInstallPolicy.getApps()) { - apps.add(enterpriseApp.getProductId()); - } - googleAPIInvoker.approveAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail - .getGoogleUserId(), apps, enterpriseInstallPolicy.getProductSetBehavior()); - googleAPIInvoker.updateAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), - AndroidEnterpriseUtils.convertToDeviceInstance(enterpriseInstallPolicy)); - AndroidEnterpriseUtils.getAppSubscriptionService() - .performEntAppSubscription(uuid, - Arrays.asList(CarbonContext.getThreadLocalCarbonContext().getUsername()), - SubscriptionType.USER.toString(), SubAction.INSTALL.toString(), false); + .isEmpty() && userDetail.getEmmUsername() != null && payload != null) { + EnterpriseInstallPolicy enterpriseInstallPolicy = AndroidEnterpriseUtils + .getDeviceAppPolicy(payload, null, userDetail); + List apps = new ArrayList<>(); + for (EnterpriseApp enterpriseApp : enterpriseInstallPolicy.getApps()) { + apps.add(enterpriseApp.getProductId()); } + googleAPIInvoker + .approveAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), apps, + enterpriseInstallPolicy.getProductSetBehavior()); + googleAPIInvoker + .updateAppsForUser(enterpriseConfigs.getEnterpriseId(), userDetail.getGoogleUserId(), + AndroidEnterpriseUtils.convertToDeviceInstance(enterpriseInstallPolicy)); + AndroidEnterpriseUtils.getAppSubscriptionService().performEntAppSubscription(uuid, + Arrays.asList(CarbonContext.getThreadLocalCarbonContext().getUsername()), + SubscriptionType.USER.toString(), SubAction.INSTALL.toString(), false); + } } @@ -390,7 +389,7 @@ public class AndroidDeviceUtils { } private static void updateApplicationList(Operation operation, DeviceIdentifier deviceIdentifier) - throws ApplicationManagementException { + throws org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException { // Parsing json string to get applications list. if (operation.getOperationResponse() != null) { if (operation.getOperationResponse().equals("SAME_APPLICATION_LIST")) { diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidEnterpriseUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java similarity index 96% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidEnterpriseUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java index 6bd4e0be8..1fc9549ed 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidEnterpriseUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/AndroidEnterpriseUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import com.google.api.services.androidenterprise.model.AppVersion; import com.google.api.services.androidenterprise.model.AutoInstallConstraint; @@ -51,16 +51,17 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.policy.mgt.ProfileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.EnterpriseServiceException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseManagedConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.AndroidEnterpriseUser; -import org.wso2.carbon.mdm.services.android.bean.BasicUserInfo; -import org.wso2.carbon.mdm.services.android.bean.EnterpriseConfigs; -import org.wso2.carbon.mdm.services.android.bean.ErrorResponse; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseApp; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EnterpriseInstallPolicy; -import org.wso2.carbon.mdm.services.android.exception.NotFoundException; -import org.wso2.carbon.mdm.services.android.exception.UnexpectedServerErrorException; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BasicUserInfo; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.EnterpriseConfigs; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ErrorResponse; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseApp; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EnterpriseInstallPolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseManagedConfig; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.AndroidEnterpriseUser; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.EnterpriseServiceException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.NotFoundException; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.UnexpectedServerErrorException; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.user.core.service.RealmService; @@ -141,13 +142,12 @@ public class AndroidEnterpriseUtils { variableSets.add(variableSet); } - if (variableSets != null && variableSets.size() > 0) { + if (!variableSets.isEmpty()) { configurationVariables.setVariableSet(variableSets); } managedConfiguration.setConfigurationVariables(configurationVariables); productPolicy.setManagedConfiguration(managedConfiguration); } - policyList.add(productPolicy); } diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java similarity index 94% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java index 1ea1543a4..240043aad 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/util/MobileDeviceManagementUtil.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/MobileDeviceManagementUtil.java @@ -34,7 +34,7 @@ * under the License. */ -package org.wso2.carbon.device.mgt.mobile.android.impl.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -45,16 +45,15 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.Feature; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.AndroidDataSourceConfigurations; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfigurations; -import org.wso2.carbon.device.mgt.mobile.android.impl.dao.impl.AndroidDeviceMgtPluginException; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDevice; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileDeviceOperationMapping; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileFeature; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileOperation; -import org.wso2.carbon.device.mgt.mobile.android.impl.dto.MobileOperationProperty; -import org.wso2.carbon.device.mgt.mobile.android.internal.AndroidDeviceManagementDataHolder; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidPluginConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.config.datasource.AndroidDataSourceConfigurations; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileDeviceOperationMapping; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileFeature; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileOperation; +import org.wso2.carbon.device.mgt.mobile.android.common.dto.MobileOperationProperty; +import org.wso2.carbon.device.mgt.mobile.android.common.exception.AndroidDeviceMgtPluginException; +import org.wso2.carbon.device.mgt.mobile.android.core.internal.AndroidDeviceManagementDataHolder; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.Registry; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/OAuthUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java similarity index 95% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/OAuthUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java index 53e0832c3..d4a6064aa 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/OAuthUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/main/java/org/wso2/carbon/device/mgt/mobile/android/core/util/OAuthUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.util; +package org.wso2.carbon.device.mgt.mobile.android.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -24,7 +24,8 @@ import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.mdm.services.android.bean.ApiRegistrationProfile; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApiRegistrationProfile; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java new file mode 100644 index 000000000..4c1e432b4 --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementAdminServiceTests.java @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2017, 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.android.core; + +import org.mockito.MockitoAnnotations; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.testng.PowerMockObjectFactory; +import org.testng.Assert; +import org.testng.IObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; + +import javax.ws.rs.core.Response; + +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) +@PrepareForTest(AndroidAPIUtils.class) +public class DeviceManagementAdminServiceTests { + +// private DeviceManagementAdminServiceImpl deviceManagementAdminService; + + @ObjectFactory + public IObjectFactory getObjectFactory() { + return new PowerMockObjectFactory(); + } + +// @BeforeClass +// public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// MockitoAnnotations.initMocks(this); +// deviceManagementAdminService = new DeviceManagementAdminServiceImpl(); +// } + + private void mockDeviceManagementService() + throws DeviceManagementException, OperationManagementException, InvalidDeviceException { + PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) + .toReturn(new DeviceManagementProviderServiceMock()); + } + +// @Test +// public void testConfigureDeviceLock() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureDeviceLock(TestUtils.getDeviceLockBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureDeviceUnlock() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureDeviceUnlock(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceLocation() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceLocation(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRemovePassword() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.removePassword(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureCamera() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureCamera(TestUtils.getCamerabeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceInformation() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceInformation(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetDeviceLogcat() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getDeviceLogcat(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testWipeDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.wipeDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testWipeData() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.wipeData(TestUtils.getWipeDataBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetApplications() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.getApplications(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRingDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.ringDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testRebootDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.rebootDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testChangeLockTask() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.changeLockTask(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testMuteDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.muteDevice(TestUtils.getDeviceIds()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testInstallApplication() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .installApplication(TestUtils.getApplicationInstallationBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUpdateApplication() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.updateApplication(TestUtils.getApplicationUpdateBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUninstallApplicationPublic() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperPublic()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUninstallApplicationWebApp() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .uninstallApplication(TestUtils.getApplicationUninstallationBeanWrapperWebApp()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testBlacklistApplications() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService +// .blacklistApplications(TestUtils.getBlacklistApplicationsBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testUpgradeFirmware() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.upgradeFirmware(TestUtils.getUpgradeFirmwareBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureVPN() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureVPN(TestUtils.getVpnBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSendNotification() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.sendNotification(TestUtils.getNotificationBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testConfigureWifi() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.configureWifi(TestUtils.getWifiBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testEncryptStorage() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.encryptStorage(TestUtils.getEncryptionBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testChangeLockCode() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.changeLockCode(TestUtils.getLockCodeBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSetPasswordPolicy() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.setPasswordPolicy(TestUtils.getPasswordPolicyBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testSetWebClip() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementAdminService.setWebClip(TestUtils.getWebClipBeanWrapper()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } + +} + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java new file mode 100644 index 000000000..9ce61820d --- /dev/null +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/DeviceManagementServiceTests.java @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2017, 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.android.core; + +import org.mockito.MockitoAnnotations; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.testng.PowerMockObjectFactory; +import org.testng.Assert; +import org.testng.IObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import org.wso2.carbon.device.mgt.common.exceptions.InvalidDeviceException; +import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.ApplicationManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceInformationManagerServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.DeviceManagementProviderServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.NotificationManagementServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.PolicyManagerServiceMock; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidAPIUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; + +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; + +@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*"}) +@PrepareForTest(AndroidAPIUtils.class) +public class DeviceManagementServiceTests { + +// private DeviceManagementServiceImpl deviceManagementService; + +// @ObjectFactory +// public IObjectFactory getObjectFactory() { +// return new PowerMockObjectFactory(); +// } + +// @BeforeClass +// public void init() throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// MockitoAnnotations.initMocks(this); +// deviceManagementService = new DeviceManagementServiceImpl(); +// } + +// private void mockDeviceManagementService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceManagementService")) +// .toReturn(new DeviceManagementProviderServiceMock()); +// } +// +// private void mockApplicationManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getApplicationManagerService")) +// .toReturn(new ApplicationManagementProviderServiceMock()); +// } +// +// private void mockPolicyManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getPolicyManagerService")) +// .toReturn(new PolicyManagerServiceMock()); +// } +// +// private void mockDeviceInformationManagerService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getDeviceInformationManagerService")) +// .toReturn(new DeviceInformationManagerServiceMock()); +// } +// +// private void mockNotificationManagementService() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getNotificationManagementService")) +// .toReturn(new NotificationManagementServiceMock()); +// } +// +// private void mockUser() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// PowerMockito.stub(PowerMockito.method(AndroidAPIUtils.class, "getAuthenticatedUser")) +// .toReturn("admin"); +// } +// +// @Test +// public void testUpdateApplicationList() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockApplicationManagerService(); +// Response response = deviceManagementService +// .updateApplicationList(TestUtils.getDeviceId(), TestUtils.getAndroidApplications()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsForNullDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// Response response = deviceManagementService +// .getPendingOperations(true, null, null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsInvalidDevice() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, "1234", null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsNullResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithMonitorResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockPolicyManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessMonitorOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithApplicationResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockApplicationManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessApplicationOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithDeviceInfoResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockDeviceInformationManagerService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getSuccessInfoOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithInProgressResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getInProgressOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testGetPendingOperationsWithErrorResponse() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockNotificationManagementService(); +// Response response = deviceManagementService +// .getPendingOperations(true, TestUtils.getDeviceId(), null, +// TestUtils.getErrorOperationResponse()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceWithoutLocationSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockPolicyManagerService(); +// mockUser(); +// Response response = deviceManagementService.enrollDevice(TestUtils.getBasicAndroidDevice()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceWithLocationSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockDeviceInformationManagerService(); +// mockPolicyManagerService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// +// List properties = new ArrayList<>(); +// Device.Property property = new Device.Property(); +// property.setName("LATITUDE"); +// property.setValue("79.5"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("LONGITUDE"); +// property.setValue("6.9"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("ALTITUDE"); +// property.setValue("-59.8373726"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("SPEED"); +// property.setValue("0.5123423333"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("BEARING"); +// property.setValue("44.0"); +// properties.add(property); +// property = new Device.Property(); +// property.setName("DISTANCE"); +// property.setValue("44.0"); +// properties.add(property); +// androidDevice.setProperties(properties); +// +// Response response = deviceManagementService.enrollDevice(androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testEnrollDeviceUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// androidDevice.setDeviceIdentifier("1234"); +// Response response = deviceManagementService.enrollDevice(androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledExists() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled(TestUtils.getDeviceId(), null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledNonExist() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled("1234", null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testIsEnrolledNull() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.isEnrolled(null, null); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } +// +// @Test +// public void testModifyEnrollmentSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// Response response = deviceManagementService +// .modifyEnrollment(TestUtils.getDeviceId(), TestUtils.getBasicAndroidDevice()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.ACCEPTED.getStatusCode()); +// } +// +// @Test +// public void testModifyEnrollmentUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// mockUser(); +// AndroidDevice androidDevice = TestUtils.getBasicAndroidDevice(); +// androidDevice.setDeviceIdentifier("1234"); +// Response response = deviceManagementService +// .modifyEnrollment(TestUtils.getDeviceId(), androidDevice); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_MODIFIED.getStatusCode()); +// } +// +// @Test +// public void testDisEnrollDeviceSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.disEnrollDevice(TestUtils.getDeviceId()); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); +// } +// +// @Test +// public void testDisenrollUnSuccess() +// throws DeviceManagementException, OperationManagementException, InvalidDeviceException { +// mockDeviceManagementService(); +// Response response = deviceManagementService.disEnrollDevice("1234"); +// Assert.assertNotNull(response); +// Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); +// } + +} + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java index 563258b3c..29de8de79 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/ApplicationManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/ApplicationManagementProviderServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.app.mgt.Application; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java similarity index 93% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java index 2be212e52..37a5ac425 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceInformationManagerServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceInformationManagerServiceMock.java @@ -1,6 +1,5 @@ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; -import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java similarity index 99% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java index 6d5bf8937..67dbd2b12 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/DeviceManagementProviderServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/DeviceManagementProviderServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -53,7 +53,7 @@ import org.wso2.carbon.device.mgt.core.geo.GeoCluster; import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo; -import org.wso2.carbon.mdm.services.android.utils.TestUtils; +import org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils.TestUtils; import java.util.Date; import java.util.HashMap; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java similarity index 97% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java index 4fd989de6..1f9cafbd3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/NotificationManagementServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/NotificationManagementServiceMock.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java similarity index 98% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java index a71dafebf..36283e5d3 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/mocks/PolicyManagerServiceMock.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/PolicyManagerServiceMock.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.mdm.services.android.mocks; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.Feature; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java similarity index 86% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java index 994cb9423..2a0bb71ea 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/java/org/wso2/carbon/mdm/services/android/utils/TestUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/java/org/wso2/carbon/device/mgt/mobile/android/core/mokcs/utils/TestUtils.java @@ -16,8 +16,9 @@ * under the License. */ -package org.wso2.carbon.mdm.services.android.utils; +package org.wso2.carbon.device.mgt.mobile.android.core.mokcs.utils; +import javafx.scene.Camera; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -26,40 +27,39 @@ import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationInstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUninstallation; -import org.wso2.carbon.mdm.services.android.bean.ApplicationUpdate; -import org.wso2.carbon.mdm.services.android.bean.BlacklistApplications; -import org.wso2.carbon.mdm.services.android.bean.Camera; -import org.wso2.carbon.mdm.services.android.bean.DeviceEncryption; -import org.wso2.carbon.mdm.services.android.bean.DeviceLock; -import org.wso2.carbon.mdm.services.android.bean.LockCode; -import org.wso2.carbon.mdm.services.android.bean.Notification; -import org.wso2.carbon.mdm.services.android.bean.PasscodePolicy; -import org.wso2.carbon.mdm.services.android.bean.UpgradeFirmware; -import org.wso2.carbon.mdm.services.android.bean.Vpn; -import org.wso2.carbon.mdm.services.android.bean.WebClip; -import org.wso2.carbon.mdm.services.android.bean.Wifi; -import org.wso2.carbon.mdm.services.android.bean.WipeData; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication; -import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationInstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUninstallationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.ApplicationUpdateBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.BlacklistApplicationsBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.CameraBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.DeviceLockBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.EncryptionBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.LockCodeBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.NotificationBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.PasswordPolicyBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.UpgradeFirmwareBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.VpnBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WebClipBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WifiBeanWrapper; -import org.wso2.carbon.mdm.services.android.bean.wrapper.WipeDataBeanWrapper; -import org.wso2.carbon.mdm.services.android.util.AndroidConstants; -import org.wso2.carbon.mdm.services.android.util.AndroidDeviceUtils; +import org.wso2.carbon.device.mgt.mobile.android.common.AndroidConstants; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationInstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUninstallation; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.ApplicationUpdate; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.BlacklistApplications; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceEncryption; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.DeviceLock; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.LockCode; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Notification; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.PasscodePolicy; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.UpgradeFirmware; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Vpn; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WebClip; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.Wifi; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.WipeData; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidApplication; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.AndroidDevice; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationInstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUninstallationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.ApplicationUpdateBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.BlacklistApplicationsBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.CameraBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.DeviceLockBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.EncryptionBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.LockCodeBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.NotificationBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.PasswordPolicyBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.UpgradeFirmwareBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.VpnBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WebClipBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WifiBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.common.bean.wrapper.WipeDataBeanWrapper; +import org.wso2.carbon.device.mgt.mobile.android.core.util.AndroidDeviceUtils; import java.util.ArrayList; import java.util.List; @@ -108,14 +108,14 @@ public class TestUtils { return deviceLockBeanWrapper; } - public static CameraBeanWrapper getCamerabeanWrapper() { - CameraBeanWrapper cameraBeanWrapper = new CameraBeanWrapper(); - cameraBeanWrapper.setDeviceIDs(getDeviceIds()); - Camera camera = new Camera(); - camera.setEnabled(false); - cameraBeanWrapper.setOperation(camera); - return cameraBeanWrapper; - } +// public static CameraBeanWrapper getCamerabeanWrapper() { +// CameraBeanWrapper cameraBeanWrapper = new CameraBeanWrapper(); +// cameraBeanWrapper.setDeviceIDs(getDeviceIds()); +// Camera camera = new Camera(); +// camera.setEnabled(false); +// cameraBeanWrapper.setOperation(camera); +// return cameraBeanWrapper; +// } public static WipeDataBeanWrapper getWipeDataBeanWrapper() { WipeDataBeanWrapper wipeDataBeanWrapper = new WipeDataBeanWrapper(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/log4j.properties similarity index 100% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/log4j.properties rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/log4j.properties diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml similarity index 80% rename from components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml rename to components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml index 865a1e85b..edecf75b9 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/test/resources/testng.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.core/src/test/resources/testng.xml @@ -23,8 +23,8 @@ - - + + diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceConfigurationManager.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceConfigurationManager.java deleted file mode 100644 index ded87ad71..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceConfigurationManager.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2014, 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.android.impl.config; - -import org.w3c.dom.Document; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.mobile.android.impl.util.MobileDeviceManagementUtil; -import org.wso2.carbon.utils.CarbonUtils; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import java.io.File; - -/** - * Class responsible for the mobile device manager configuration initialization. - */ -public class MobileDeviceConfigurationManager { - - private static final String MOBILE_DEVICE_CONFIG_XML_NAME = "mobile-config.xml"; - private static final String MOBILE_DEVICE_PLUGIN_DIRECTORY = "mobile"; - private static final String DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY = "device-mgt-plugin-configs"; - private MobileDeviceManagementConfig currentMobileDeviceConfig; - private static MobileDeviceConfigurationManager mobileDeviceConfigManager; - - private final String mobileDeviceMgtConfigXMLPath = - CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + - DEVICE_MGT_PLUGIN_CONFIGS_DIRECTORY + - File.separator + - MOBILE_DEVICE_PLUGIN_DIRECTORY + File.separator + MOBILE_DEVICE_CONFIG_XML_NAME; - - public static MobileDeviceConfigurationManager getInstance() { - if (mobileDeviceConfigManager == null) { - synchronized (MobileDeviceConfigurationManager.class) { - if (mobileDeviceConfigManager == null) { - mobileDeviceConfigManager = new MobileDeviceConfigurationManager(); - } - } - } - return mobileDeviceConfigManager; - } - - public synchronized void initConfig() throws DeviceManagementException { - try { - File mobileDeviceMgtConfig = new File(mobileDeviceMgtConfigXMLPath); - Document doc = MobileDeviceManagementUtil.convertToDocument(mobileDeviceMgtConfig); - JAXBContext mobileDeviceMgmtContext = - JAXBContext.newInstance(MobileDeviceManagementConfig.class); - Unmarshaller unmarshaller = mobileDeviceMgmtContext.createUnmarshaller(); - this.currentMobileDeviceConfig = - (MobileDeviceManagementConfig) unmarshaller.unmarshal(doc); - } catch (Exception e) { - throw new DeviceManagementException( - "Error occurred while initializing Mobile Device Management config", e); - } - } - - public MobileDeviceManagementConfig getMobileDeviceManagementConfig() { - return currentMobileDeviceConfig; - } - - -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementConfig.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementConfig.java deleted file mode 100644 index 2c65375c7..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2014, 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.android.impl.config; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * Represents Mobile Device Mgt configuration. - */ -@XmlRootElement(name = "MobileDeviceMgtConfiguration") -public final class MobileDeviceManagementConfig { - - private MobileDeviceManagementRepository mobileDeviceMgtRepository; - - @XmlElement(name = "ManagementRepository", nillable = false) - public MobileDeviceManagementRepository getMobileDeviceMgtRepository() { - return mobileDeviceMgtRepository; - } - - public void setMobileDeviceMgtRepository( - MobileDeviceManagementRepository mobileDeviceMgtRepository) { - this.mobileDeviceMgtRepository = mobileDeviceMgtRepository; - } - -} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementRepository.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementRepository.java deleted file mode 100644 index e40202acf..000000000 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android/src/main/java/org/wso2/carbon/device/mgt/mobile/android/impl/config/MobileDeviceManagementRepository.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014, 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.android.impl.config; - -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.DataSourceConfigAdapter; -import org.wso2.carbon.device.mgt.mobile.android.impl.config.datasource.MobileDataSourceConfig; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import java.util.List; -import java.util.Map; - -/** - * Class for holding management repository data. - */ -@XmlRootElement(name = "ManagementRepository") -public class MobileDeviceManagementRepository { - - private Map mobileDataSourceConfigMap; - private List mobileDataSourceConfigs; - - public MobileDataSourceConfig getMobileDataSourceConfig(String provider) { - return mobileDataSourceConfigMap.get(provider); - } - - @XmlElement(name = "DataSourceConfigurations") - @XmlJavaTypeAdapter(DataSourceConfigAdapter.class) - public Map getMobileDataSourceConfigMap() { - return mobileDataSourceConfigMap; - } - - public void setMobileDataSourceConfigMap(Map mobileDataSourceConfigMap) { - this.mobileDataSourceConfigMap = mobileDataSourceConfigMap; - } - - public List getMobileDataSourceConfigs() { - return (List) mobileDataSourceConfigMap.values(); - } - -} diff --git a/components/mobile-plugins/android-plugin/pom.xml b/components/mobile-plugins/android-plugin/pom.xml index abef3c20a..96bc4786c 100644 --- a/components/mobile-plugins/android-plugin/pom.xml +++ b/components/mobile-plugins/android-plugin/pom.xml @@ -33,7 +33,9 @@ http://wso2.org - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.common + org.wso2.carbon.device.mgt.mobile.android.addons + org.wso2.carbon.device.mgt.mobile.android.core org.wso2.carbon.device.mgt.mobile.android.api org.wso2.carbon.device.mgt.mobile.android.emulator org.wso2.carbon.device.mgt.mobile.android.ui diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml index 34cda052b..22690b491 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/pom.xml @@ -39,7 +39,11 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.core + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.common com.h2database.wso2 @@ -243,7 +247,10 @@ - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android:${carbon.devicemgt.plugins.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.core:${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.common:${carbon.devicemgt.plugins.version} diff --git a/pom.xml b/pom.xml index 58d141fff..9633307cd 100644 --- a/pom.xml +++ b/pom.xml @@ -549,7 +549,17 @@ org.wso2.carbon.devicemgt-plugins - org.wso2.carbon.device.mgt.mobile.android + org.wso2.carbon.device.mgt.mobile.android.common + ${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.addons + ${carbon.devicemgt.plugins.version} + + + org.wso2.carbon.devicemgt-plugins + org.wso2.carbon.device.mgt.mobile.android.core ${carbon.devicemgt.plugins.version}