From aba2cf44470a8e7aebb69c430a69a2484da88f65 Mon Sep 17 00:00:00 2001 From: hasuniea Date: Fri, 2 Oct 2015 16:21:12 +0530 Subject: [PATCH] implemented checkCompliancePolicy Service --- .../windows/WindowsPolicyMonitoringService.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsPolicyMonitoringService.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsPolicyMonitoringService.java index fd14cf3e62..ecc9e36ada 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsPolicyMonitoringService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/windows/WindowsPolicyMonitoringService.java @@ -18,10 +18,6 @@ package org.wso2.carbon.device.mgt.mobile.impl.windows; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.Device; @@ -56,16 +52,7 @@ public class WindowsPolicyMonitoringService implements PolicyMonitoringService { return complianceData; } List complianceFeatures = new ArrayList(); - - JsonElement jsonElement = new JsonParser().parse(compliancePayload.toString()); - JsonArray jsonArray = jsonElement.getAsJsonArray(); - Gson gson = new Gson(); - ComplianceFeature complianceFeature; - for (int x = 0; x < jsonArray.size(); x++) { - complianceFeature = gson.fromJson(jsonArray.get(x), ComplianceFeature.class); - complianceFeatures.add(complianceFeature); - } - complianceData.setComplianceFeatures(complianceFeatures); + complianceData.setComplianceFeatures((List) compliancePayload); for (ComplianceFeature cf : complianceFeatures) { if (!cf.isCompliant()) {