|
|
@ -18,10 +18,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.wso2.carbon.device.mgt.mobile.impl.windows;
|
|
|
|
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.Log;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.wso2.carbon.device.mgt.common.Device;
|
|
|
|
import org.wso2.carbon.device.mgt.common.Device;
|
|
|
@ -56,16 +52,7 @@ public class WindowsPolicyMonitoringService implements PolicyMonitoringService {
|
|
|
|
return complianceData;
|
|
|
|
return complianceData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<ComplianceFeature> complianceFeatures = new ArrayList<ComplianceFeature>();
|
|
|
|
List<ComplianceFeature> complianceFeatures = new ArrayList<ComplianceFeature>();
|
|
|
|
|
|
|
|
complianceData.setComplianceFeatures((List<ComplianceFeature>) compliancePayload);
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (ComplianceFeature cf : complianceFeatures) {
|
|
|
|
for (ComplianceFeature cf : complianceFeatures) {
|
|
|
|
if (!cf.isCompliant()) {
|
|
|
|
if (!cf.isCompliant()) {
|
|
|
|