Adding isActive property to PolicyWrapper

merge-requests/7/head
dilanua 9 years ago
parent 0eed97e84c
commit 1513c6cf8a

@ -20,7 +20,6 @@ package org.wso2.carbon.device.mgt.jaxrs.beans;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import java.util.List; import java.util.List;
@ -52,6 +51,10 @@ public class PolicyWrapper {
+ "device type", required = true) + "device type", required = true)
private String ownershipType; 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" @ApiModelProperty(name = "profile", value = "Contains the details of the profile that is included in the"
+ " policy", required = true) + " policy", required = true)
private Profile profile; private Profile profile;
@ -115,11 +118,19 @@ public class PolicyWrapper {
this.ownershipType = ownershipType; this.ownershipType = ownershipType;
} }
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public List<DeviceIdentifier> getDeviceIdentifiers() { public List<DeviceIdentifier> getDeviceIdentifiers() {
return deviceIdentifiers; return deviceIdentifiers;
} }
public void setDeviceIdentifier(List<DeviceIdentifier> deviceIdentifier) { public void setDeviceIdentifier(List<DeviceIdentifier> deviceIdentifiers) {
this.deviceIdentifiers = deviceIdentifiers; this.deviceIdentifiers = deviceIdentifiers;
} }

@ -106,6 +106,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService {
policy.setDescription(policyWrapper.getDescription()); policy.setDescription(policyWrapper.getDescription());
policy.setProfile(DeviceMgtUtil.convertProfile(policyWrapper.getProfile())); policy.setProfile(DeviceMgtUtil.convertProfile(policyWrapper.getProfile()));
policy.setOwnershipType(policyWrapper.getOwnershipType()); policy.setOwnershipType(policyWrapper.getOwnershipType());
policy.setActive(policyWrapper.isActive());
policy.setRoles(policyWrapper.getRoles()); policy.setRoles(policyWrapper.getRoles());
policy.setUsers(policyWrapper.getUsers()); policy.setUsers(policyWrapper.getUsers());
policy.setCompliance(policyWrapper.getCompliance()); policy.setCompliance(policyWrapper.getCompliance());

Loading…
Cancel
Save