diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyWrapper.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyWrapper.java index 31420dae888..1795e299829 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyWrapper.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/beans/PolicyWrapper.java @@ -20,7 +20,6 @@ package org.wso2.carbon.device.mgt.jaxrs.beans; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import java.util.List; @@ -52,6 +51,10 @@ public class PolicyWrapper { + "device type", required = true) private String ownershipType; + @ApiModelProperty(name = "active", value = "If the value is true it indicates that the policy is active. " + + "If the value is false it indicates that the policy is inactive", required = true) + private boolean active; + @ApiModelProperty(name = "profile", value = "Contains the details of the profile that is included in the" + " policy", required = true) private Profile profile; @@ -115,11 +118,19 @@ public class PolicyWrapper { this.ownershipType = ownershipType; } + public boolean isActive() { + return active; + } + + public void setActive(boolean active) { + this.active = active; + } + public List getDeviceIdentifiers() { return deviceIdentifiers; } - public void setDeviceIdentifier(List deviceIdentifier) { + public void setDeviceIdentifier(List deviceIdentifiers) { this.deviceIdentifiers = deviceIdentifiers; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java index 520285fe572..e22b3996d17 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -106,6 +106,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { policy.setDescription(policyWrapper.getDescription()); policy.setProfile(DeviceMgtUtil.convertProfile(policyWrapper.getProfile())); policy.setOwnershipType(policyWrapper.getOwnershipType()); + policy.setActive(policyWrapper.isActive()); policy.setRoles(policyWrapper.getRoles()); policy.setUsers(policyWrapper.getUsers()); policy.setCompliance(policyWrapper.getCompliance());