From 79755635308f583062781a3405d918d478fb96e2 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Thu, 24 Jan 2019 17:33:27 +0530 Subject: [PATCH] Improve the payload of enrollment notification --- .../mgt/common/DeviceEnrollmentInfoNotification.java | 12 ------------ .../carbon/device/mgt/common/DeviceNotification.java | 6 +++--- .../service/DeviceManagementProviderServiceImpl.java | 3 +-- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceEnrollmentInfoNotification.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceEnrollmentInfoNotification.java index f4b10218a1..2d2e846c1f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceEnrollmentInfoNotification.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceEnrollmentInfoNotification.java @@ -19,10 +19,6 @@ package org.wso2.carbon.device.mgt.common; public class DeviceEnrollmentInfoNotification { - /*** - * Enrollment Id - */ - private int id; /*** * Enrollment timestamp */ @@ -44,14 +40,6 @@ public class DeviceEnrollmentInfoNotification { */ private String owner; - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - public Long getDateOfEnrolment() { return dateOfEnrolment; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceNotification.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceNotification.java index 46238b9a53..d376344939 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceNotification.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceNotification.java @@ -26,7 +26,7 @@ public class DeviceNotification { @XmlAttribute(name = "id") - private int deviceId; + private String identifier; @XmlElement(name = "name") private String deviceName; @XmlElement(name = "type") @@ -40,10 +40,10 @@ public class DeviceNotification { public DeviceNotification(){} - public DeviceNotification(int deviceId, String deviceName, String deviceType, String description, + public DeviceNotification(String identifier, String deviceName, String deviceType, String description, DevicePropertyNotification devicePropertyNotification, DeviceEnrollmentInfoNotification deviceEnrollmentInfoNotification) { - this.deviceId = deviceId; + this.identifier = identifier; this.deviceName = deviceName; this.deviceType = deviceType; this.description = description; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 37851dbb1c..06794514df 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -2947,14 +2947,13 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } } DeviceEnrollmentInfoNotification deviceEnrollmentInfoNotification = new DeviceEnrollmentInfoNotification(); - deviceEnrollmentInfoNotification.setId(device.getEnrolmentInfo().getId()); deviceEnrollmentInfoNotification.setOwner(device.getEnrolmentInfo().getOwner()); deviceEnrollmentInfoNotification.setDateOfEnrolment(device.getEnrolmentInfo().getDateOfEnrolment()); deviceEnrollmentInfoNotification.setDateOfLastUpdate(device.getEnrolmentInfo().getDateOfLastUpdate()); deviceEnrollmentInfoNotification.setOwnership(device.getEnrolmentInfo().getOwnership().toString()); deviceEnrollmentInfoNotification.setStatus(device.getEnrolmentInfo().getStatus().toString()); - DeviceNotification deviceNotification = new DeviceNotification(device.getId(), device.getName(), + DeviceNotification deviceNotification = new DeviceNotification(device.getDeviceIdentifier(), device.getName(), device.getType(), device.getDescription(), devicePropertyNotification, deviceEnrollmentInfoNotification);