From c61ef1c98ee1d933d8bfa6bdb1f5d2a869a4467b Mon Sep 17 00:00:00 2001 From: dilanua Date: Fri, 8 Jul 2016 18:01:10 +0530 Subject: [PATCH] Fixing issues of GET /compliance-data API --- .../carbon/device/mgt/jaxrs/beans/DeviceCompliance.java | 6 +++--- .../mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java index ce76a63c25..6f74422514 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/DeviceCompliance.java @@ -24,7 +24,7 @@ import org.wso2.carbon.policy.mgt.common.monitor.ComplianceData; @ApiModel(value = "DeviceCompliance", description = "Device's policy compliance status") public class DeviceCompliance { - private int deviceID; + private String deviceID; private ComplianceData complianceData; private Long code; @@ -44,11 +44,11 @@ public class DeviceCompliance { this.code = code; } - public int getDeviceID() { + public String getDeviceID() { return deviceID; } - public void setDeviceID(int deviceID) { + public void setDeviceID(String deviceID) { this.deviceID = deviceID; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 6a7c3fec47..2266f51d4a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -357,7 +357,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { } if (policy == null) { - deviceCompliance.setDeviceID(Integer.valueOf(id)); + deviceCompliance.setDeviceID(id); deviceCompliance.setComplianceData(null); //deviceCompliance.setCode(0001l); //code 0001 means no compliance data related to the device return Response.status(Response.Status.OK).entity(deviceCompliance).build(); @@ -366,7 +366,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); complianceData = policyManagementService.getDeviceCompliance( new DeviceIdentifier(id, type)); - deviceCompliance.setDeviceID(Integer.valueOf(id)); + deviceCompliance.setDeviceID(id); deviceCompliance.setComplianceData(complianceData); //deviceCompliance.setCode(0002l); //code 0002 means there are compliance data related to the device return Response.status(Response.Status.OK).entity(deviceCompliance).build();