|
|
@ -17,6 +17,8 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
package org.wso2.carbon.policy.mgt.common;
|
|
|
|
package org.wso2.carbon.policy.mgt.common;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.Device;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
|
|
import javax.xml.bind.annotation.XmlElement;
|
|
|
@ -29,24 +31,50 @@ import java.util.Map;
|
|
|
|
* This class will be the used to create policy object with relevant information for evaluating.
|
|
|
|
* This class will be the used to create policy object with relevant information for evaluating.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@XmlRootElement
|
|
|
|
@XmlRootElement
|
|
|
|
|
|
|
|
@ApiModel(value = "Policy", description = "This class carries all information related to Policies")
|
|
|
|
public class Policy implements Comparable<Policy>, Serializable {
|
|
|
|
public class Policy implements Comparable<Policy>, Serializable {
|
|
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 19981017L;
|
|
|
|
private static final long serialVersionUID = 19981017L;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "id", value = "The policy ID", required = true)
|
|
|
|
private int id; // Identifier of the policy.
|
|
|
|
private int id; // Identifier of the policy.
|
|
|
|
private int priorityId; // Priority of the policies. This will be used only for simple evaluation.
|
|
|
|
@ApiModelProperty(name = "priorityId", value = "The priority order of the policy. 1 indicates the highest"
|
|
|
|
|
|
|
|
+ " priority", required = true)
|
|
|
|
|
|
|
|
private int priorityId; // Priority of the policies. This will be used only for simple evaluation.
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "profile", value = "Contains the details of the profile that is included in the "
|
|
|
|
|
|
|
|
+ "policy", required = true)
|
|
|
|
private Profile profile; // Profile
|
|
|
|
private Profile profile; // Profile
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "policyName", value = "The name of the policy", required = true)
|
|
|
|
private String policyName; // Name of the policy.
|
|
|
|
private String policyName; // Name of the policy.
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "generic", value = "If true, this should be applied to all related device",
|
|
|
|
|
|
|
|
required = true)
|
|
|
|
private boolean generic; // If true, this should be applied to all related device.
|
|
|
|
private boolean generic; // If true, this should be applied to all related device.
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "roles", value = "The roles to whom the policy is applied on", required = true)
|
|
|
|
private List<String> roles; // Roles which this policy should be applied.
|
|
|
|
private List<String> roles; // Roles which this policy should be applied.
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "ownershipType", value = "The policy ownership type. It can be any of the "
|
|
|
|
|
|
|
|
+ "following values:\n"
|
|
|
|
|
|
|
|
+ "ANY - The policy will be applied on the BYOD and COPE device types\n"
|
|
|
|
|
|
|
|
+ "BYOD (Bring Your Own Device) - The policy will only be applied on the BYOD device type\n"
|
|
|
|
|
|
|
|
+ "COPE (Corporate-Owned, Personally-Enabled) - The policy will only be applied on the COPE "
|
|
|
|
|
|
|
|
+ "device type\n", required = true)
|
|
|
|
private String ownershipType; // Ownership type (COPE, BYOD, CPE)
|
|
|
|
private String ownershipType; // Ownership type (COPE, BYOD, CPE)
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "devices", value = "Lists out the devices the policy is enforced on",
|
|
|
|
|
|
|
|
required = true)
|
|
|
|
private List<Device> devices; // Individual devices this policy should be applied
|
|
|
|
private List<Device> devices; // Individual devices this policy should be applied
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "users", value = "Lists out the users on whose devices the policy is enforced",
|
|
|
|
|
|
|
|
required = true)
|
|
|
|
private List<String> users;
|
|
|
|
private List<String> users;
|
|
|
|
|
|
|
|
@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;
|
|
|
|
private boolean active;
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "updated", value = "If you have made changes to the policy but have not applied"
|
|
|
|
|
|
|
|
+ " these changes to the devices that are registered with EMM, then the value is defined as true."
|
|
|
|
|
|
|
|
+ " But if you have already applied any changes made to the policy then the value is defined as"
|
|
|
|
|
|
|
|
+ " false.", required = true)
|
|
|
|
private boolean updated;
|
|
|
|
private boolean updated;
|
|
|
|
|
|
|
|
@ApiModelProperty(name = "description", value = "Gives a description on the policy", required = true)
|
|
|
|
private String description;
|
|
|
|
private String description;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Compliance data*/
|
|
|
|
/* Compliance data*/
|
|
|
|
private String compliance;
|
|
|
|
private String compliance;
|
|
|
|
|
|
|
|
|
|
|
|