From 4e61f771e719094ae4b188efa7c42fb11a78d9c8 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 17 Oct 2019 12:58:48 +0530 Subject: [PATCH] Add corrective action bean class --- .../common/policy/mgt/CorrectiveAction.java | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java new file mode 100644 index 0000000000..dece7db618 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2019, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved. + * + * Entgra (Pvt) Ltd. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.common.policy.mgt; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.util.List; + +@ApiModel( + value = "CorrectiveAction", + description = "This bean carries all information related corrective action which is required " + + "when a policy is violated." +) +public class CorrectiveAction implements Serializable { + + private static final long serialVersionUID = -3414709449056070148L; + + @ApiModelProperty( + name = "action", + value = "Corrective action type (POLICY or OPERATION) to trigger when a policy is violated.", + example = "POLICY", + required = true + ) + private String actionType; + + @ApiModelProperty( + name = "policyId", + value = "When corrective action is POLICY, the corrective policy ID to be applied when a policy " + + "is violated.", + example = "1" + ) + private int policyId; + + @ApiModelProperty( + name = "operations", + value = "When corrective action is OPERATION, the list of operations in features to be applied " + + "when a policy is violated." + ) + private List operations; + + public String getActionType() { + return actionType; + } + + public void setActionType(String actionType) { + this.actionType = actionType; + } + + public int getPolicyId() { + return policyId; + } + + public void setPolicyId(int policyId) { + this.policyId = policyId; + } + + public List getOperations() { + return operations; + } + + public void setOperations(List operations) { + this.operations = operations; + } +}