From b2c7033608104e6a154a2cfd8b6fa1df741e1676 Mon Sep 17 00:00:00 2001 From: lasantha Date: Mon, 5 Mar 2018 11:39:26 +0530 Subject: [PATCH 1/2] Format RPi and Arduino source --- .../mgt/iot/arduino/service/impl/ArduinoServiceImpl.java | 6 ++++-- .../raspberrypi/service/impl/RaspberryPiServiceImpl.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/ArduinoServiceImpl.java b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/ArduinoServiceImpl.java index 2c5e608b2..462de254d 100644 --- a/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/ArduinoServiceImpl.java +++ b/components/device-types/arduino-plugin/org.wso2.carbon.device.mgt.iot.arduino.api/src/main/java/org/wso2/carbon/device/mgt/iot/arduino/service/impl/ArduinoServiceImpl.java @@ -222,11 +222,13 @@ public class ArduinoServiceImpl implements ArduinoService { .getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext .getThreadLocalCarbonContext().getTenantDomain(); if (apiApplicationKey == null) { - String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName(); + String adminUsername = + PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration() + .getAdminUserName(); String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService(); String[] tags = {ArduinoConstants.DEVICE_TYPE}; - try{ + try { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername); diff --git a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/RaspberryPiServiceImpl.java b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/RaspberryPiServiceImpl.java index 5ebd98005..9d0c48689 100644 --- a/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/RaspberryPiServiceImpl.java +++ b/components/device-types/raspberrypi-plugin/org.wso2.carbon.device.mgt.iot.raspberrypi.api/src/main/java/org/wso2/carbon/device/mgt/iot/raspberrypi/service/impl/RaspberryPiServiceImpl.java @@ -203,14 +203,16 @@ public class RaspberryPiServiceImpl implements RaspberryPiService { throw new DeviceManagementException(msg); } if (apiApplicationKey == null) { - String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName(); + String adminUsername = + PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration() + .getAdminUserName(); String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm() .getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext .getThreadLocalCarbonContext().getTenantDomain(); APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService(); String[] tags = {RaspberrypiConstants.DEVICE_TYPE}; - try{ + try { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername); From 82213166d28b8373adee0b21dec4110136611b81 Mon Sep 17 00:00:00 2001 From: lasantha Date: Mon, 5 Mar 2018 12:17:58 +0530 Subject: [PATCH 2/2] Fix issues in android-device-mgt-v0.9 copyright text --- .../pom.xml | 2 +- .../android/bean/AndroidOperation.java | 2 +- .../bean/AndroidPlatformConfiguration.java | 2 +- .../services/android/bean/AppRestriction.java | 3 ++- .../android/bean/ApplicationInstallation.java | 2 +- .../bean/ApplicationUninstallation.java | 2 +- .../android/bean/ApplicationUpdate.java | 2 +- .../android/bean/BlacklistApplications.java | 2 +- .../mdm/services/android/bean/Camera.java | 2 +- .../android/bean/DeviceEncryption.java | 2 +- .../mdm/services/android/bean/DeviceLock.java | 2 +- .../services/android/bean/DeviceState.java | 2 +- .../services/android/bean/Disenrollment.java | 2 +- .../services/android/bean/ErrorListItem.java | 3 ++- .../services/android/bean/ErrorResponse.java | 3 ++- .../services/android/bean/FileTransfer.java | 1 + .../mdm/services/android/bean/LockCode.java | 2 +- .../services/android/bean/Notification.java | 2 +- .../services/android/bean/PasscodePolicy.java | 2 +- .../android/bean/UpgradeFirmware.java | 2 +- .../carbon/mdm/services/android/bean/Vpn.java | 2 +- .../mdm/services/android/bean/WebClip.java | 2 +- .../mdm/services/android/bean/Wifi.java | 2 +- .../mdm/services/android/bean/WipeData.java | 2 +- .../bean/wrapper/AndroidApplication.java | 18 ++++++++++++++++++ .../android/bean/wrapper/AndroidDevice.java | 3 ++- .../bean/wrapper/AndroidDeviceInfo.java | 19 ++++++++++++++++++- .../wrapper/AppRestrictionBeanWrapper.java | 3 ++- .../ApplicationInstallationBeanWrapper.java | 3 ++- .../ApplicationUninstallationBeanWrapper.java | 3 ++- .../wrapper/ApplicationUpdateBeanWrapper.java | 3 ++- .../BlacklistApplicationsBeanWrapper.java | 3 ++- .../bean/wrapper/CameraBeanWrapper.java | 3 ++- .../bean/wrapper/DeviceEnrollmentInfo.java | 3 ++- .../bean/wrapper/DeviceLockBeanWrapper.java | 2 +- .../wrapper/DisenrollmentBeanWrapper.java | 3 ++- .../bean/wrapper/EncryptionBeanWrapper.java | 3 ++- .../bean/wrapper/EventBeanWrapper.java | 2 +- .../bean/wrapper/FileTransferBeanWrapper.java | 1 + .../bean/wrapper/LockCodeBeanWrapper.java | 3 ++- .../bean/wrapper/NotificationBeanWrapper.java | 3 ++- .../wrapper/PasswordPolicyBeanWrapper.java | 3 ++- .../wrapper/UpgradeFirmwareBeanWrapper.java | 3 ++- .../android/bean/wrapper/VpnBeanWrapper.java | 3 ++- .../bean/wrapper/WebClipBeanWrapper.java | 3 ++- .../android/bean/wrapper/WifiBeanWrapper.java | 3 ++- .../bean/wrapper/WipeDataBeanWrapper.java | 3 ++- .../services/android/common/ErrorHandler.java | 3 ++- .../services/android/common/ErrorMessage.java | 3 ++- .../common/GsonMessageBodyHandler.java | 2 +- .../android/common/ValidationInterceptor.java | 2 +- .../exception/AndroidAgentException.java | 3 ++- .../exception/AndroidOperationException.java | 2 +- .../exception/BadRequestException.java | 2 +- .../services/android/exception/ErrorDTO.java | 2 +- .../android/exception/ForbiddenException.java | 2 +- .../exception/GlobalThrowableMapper.java | 2 +- .../android/exception/NotFoundException.java | 3 ++- .../OperationConfigurationException.java | 2 +- .../ParameterValidationException.java | 2 +- .../UnexpectedServerErrorException.java | 3 ++- .../DeviceManagementAdminService.java | 3 ++- .../services/DeviceManagementService.java | 3 ++- .../DeviceTypeConfigurationService.java | 3 ++- .../services/EventReceiverService.java | 3 ++- .../DeviceManagementAdminServiceImpl.java | 3 ++- .../impl/DeviceManagementServiceImpl.java | 3 ++- .../DeviceTypeConfigurationServiceImpl.java | 3 ++- .../impl/EventReceiverServiceImpl.java | 3 ++- .../android/util/AndroidAPIUtils.java | 2 +- .../android/util/AndroidConstants.java | 2 +- .../android/util/AndroidDeviceUtils.java | 2 +- .../android/util/ApiOriginFilter.java | 3 ++- .../services/android/util/DeviceIDHolder.java | 2 +- .../mdm/services/android/util/Message.java | 2 +- .../src/main/webapp/META-INF/permissions.xml | 2 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 3 ++- .../src/main/webapp/WEB-INF/web.xml | 3 ++- .../src/main/webapp/servicelist.css | 2 +- .../DeviceInformationManagerServiceMock.java | 18 ++++++++++++++++++ 81 files changed, 169 insertions(+), 77 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml index a99f4d9c3..55ba6157e 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.v09.api/pom.xml @@ -1,6 +1,6 @@ + +