From 6d14133bab84528a18d46addab453bf3f1b5ce6b Mon Sep 17 00:00:00 2001 From: inoshperera Date: Tue, 31 May 2016 14:45:05 +0530 Subject: [PATCH 1/3] fixing the mismatch of swagger annotation and implementation --- .../services/android/services/DeviceManagementService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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/mdm/services/android/services/DeviceManagementService.java index d403581b9..4464d6c73 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/mdm/services/android/services/DeviceManagementService.java @@ -87,11 +87,11 @@ public interface DeviceManagementService { value = "List of applications that need to be persisted against the device") List applications); - @GET + @PUT @Path("/{id}/pending-operations") @ApiOperation( produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", + httpMethod = "PUT", value = "Get the operation list pending for the device", responseContainer = "List", notes = "The Android agent communicates with the server to get the operations that are queued up " + From 61d88f77b6b2d83a1493454d889a038becc00c43 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 31 May 2016 14:48:23 +0530 Subject: [PATCH 2/3] removed device Id from notification bean --- .../services/impl/DeviceManagementServiceImpl.java | 3 +-- .../windows/operations/util/OperationUtils.java | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) 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/mdm/services/android/services/impl/DeviceManagementServiceImpl.java index 3c5f4a5f3..987d14f6d 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/mdm/services/android/services/impl/DeviceManagementServiceImpl.java @@ -145,10 +145,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { notification.setOperationId(operation.getId()); notification.setStatus(org.wso2.carbon.device.mgt.common.notification.mgt.Notification. Status.NEW.toString()); - notification.setDeviceIdentifier(id); notification.setDescription("Operation " + operation.getCode() + " failed to execute on device " + deviceName + ". Device ID : " + deviceId); - AndroidAPIUtils.getNotificationManagementService().addNotification(notification); + AndroidAPIUtils.getNotificationManagementService().addNotification(id, notification); } if (log.isDebugEnabled()) { log.debug("Updating operation '" + operation.toString() + "'"); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/operations/util/OperationUtils.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/operations/util/OperationUtils.java index f9140826e..4ff0475af 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/operations/util/OperationUtils.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/operations/util/OperationUtils.java @@ -87,10 +87,9 @@ public class OperationUtils { Notification lockResetNotification = new Notification(); lockResetNotification.setOperationId(status.getCommandReference()); lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW)); - lockResetNotification.setDeviceIdentifier(deviceIdentifier); lockResetNotification.setDescription( Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION); - nmService.addNotification(lockResetNotification); + nmService.addNotification(deviceIdentifier, lockResetNotification); } catch (NotificationManagementException e) { throw new WindowsOperationException("Failure occurred in getting notification service", e); } @@ -156,10 +155,9 @@ public class OperationUtils { Notification lockResetNotification = new Notification(); lockResetNotification.setOperationId(status.getCommandReference()); lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW)); - lockResetNotification.setDeviceIdentifier(deviceIdentifier); lockResetNotification.setDescription(Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION); - nmService.addNotification(lockResetNotification); + nmService.addNotification(deviceIdentifier, lockResetNotification); } catch (NotificationManagementException e) { String msg = "Failure occurred in getting notification service"; log.error(msg, e); @@ -404,10 +402,9 @@ public class OperationUtils { Notification notification = new Notification(); notification.setDescription("Auto generated DevicePin : " + pinValue); notification.setOperationId(result.getCommandReference()); - notification.setDeviceIdentifier(deviceIdentifier); notification.setStatus(String.valueOf(Notification.Status.NEW)); try { - nmService.addNotification(notification); + nmService.addNotification(deviceIdentifier, notification); } catch (NotificationManagementException e) { String msg = "Failure Occurred in getting notification service."; log.error(msg, e); From 212c11750c06503d1ad825a2915941e5da545b42 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Tue, 31 May 2016 16:13:20 +0530 Subject: [PATCH 3/3] Added http schem supported by the API --- .../services/impl/DeviceTypeConfigurationServiceImpl.java | 3 +-- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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 index f20e31f4d..e1a4f7fcd 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/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 @@ -60,7 +60,6 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati PlatformConfiguration = new PlatformConfiguration(); configs = new ArrayList<>(); } - ConfigurationEntry entry = new ConfigurationEntry(); License license = AndroidAPIUtils.getDeviceManagementService().getLicense( DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, AndroidConstants. @@ -110,7 +109,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration); //AndroidAPIUtils.getGCMService().resetTenantConfigCache(); Response.status(Response.Status.ACCEPTED); - responseMsg.setResponseMessage("Android platform configuration has updated successfully."); + responseMsg.setResponseMessage("Android platform configuration has been updated successfully."); responseMsg.setResponseCode(Response.Status.ACCEPTED.toString()); } catch (DeviceManagementException e) { msg = "Error occurred while modifying configuration settings of Android platform"; 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 b27d32735..cc020be21 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 @@ -45,7 +45,8 @@ - + +