From 61d88f77b6b2d83a1493454d889a038becc00c43 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 31 May 2016 14:48:23 +0530 Subject: [PATCH] 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);