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 " + 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/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 @@ - + + 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);