package com.bocloud.cmp.model.jumpserver;

import com.bocloud.cmp.model.DepartmentBean;

public class Rule {
    private Long id; //动态权限ID。
    private String name; //动态权限名称。取值范围: 1..200
    private Integer userType; //指定用户类型。0-全部用户 1-用户/用户组 2-指定规则，默认为0。
    private Integer resType; //指定资产类型。0-全部资产 1-资产/资产组 2-指定规则，默认为0。
    private Integer protoType; //指定协议类型。0-全部协议 1-指定协议，默认为0。
    private Integer accountType; //指定帐号类型。0-全部帐号 1-指定帐号 2-指定规则，默认为0。注意：0-全部帐号时，包含self和any帐号。
    private Integer chkType; //南京银行那台堡垒机需要这个参数,很奇怪
    private RuleTemplate loginRuleTemplate; //规则模板。
    private DepartmentBean department; //所属部门。不提供则设置为根部门。
    private Long departmentId; // 部门id，数据库中的id，不是给driver用的
    private RuleConfiguration configurations; //高级配置。

    public void setChkType(Integer chkType) {
        this.chkType = chkType;
    }

    public Integer getChkType() {
        return chkType;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getResType() {
        return resType;
    }

    public void setResType(Integer resType) {
        this.resType = resType;
    }

    public Integer getProtoType() {
        return protoType;
    }

    public void setProtoType(Integer protoType) {
        this.protoType = protoType;
    }

    public Integer getAccountType() {
        return accountType;
    }

    public void setAccountType(Integer accountType) {
        this.accountType = accountType;
    }

    public RuleTemplate getLoginRuleTemplate() {
        return loginRuleTemplate;
    }

    public void setLoginRuleTemplate(RuleTemplate loginRuleTemplate) {
        this.loginRuleTemplate = loginRuleTemplate;
    }

    public DepartmentBean getDepartment() {
        return department;
    }

    public void setDepartment(DepartmentBean department) {
        this.department = department;
    }

    public RuleConfiguration getConfigurations() {
        return configurations;
    }

    public RuleConfiguration safeGetConfigurations() {
        if (configurations == null) {
            configurations = new RuleConfiguration();
        }
        return configurations;
    }

    public void setConfigurations(RuleConfiguration configurations) {
        this.configurations = configurations;
    }

    public Long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }
}
