Adding isActive property to PolicyWrapper

4.x.x
dilanua 8 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.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<DeviceIdentifier> getDeviceIdentifiers() {
return deviceIdentifiers;
}
public void setDeviceIdentifier(List<DeviceIdentifier> deviceIdentifier) {
public void setDeviceIdentifier(List<DeviceIdentifier> deviceIdentifiers) {
this.deviceIdentifiers = deviceIdentifiers;
}

@ -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());

Loading…
Cancel
Save