package com.bocloud.nms.model.hillstone;

import java.util.List;
import java.util.Objects;

// AAA服务器
public class AAAServerModel extends HillStoneGenericModel {
    private Long vendorId; // 所属平台
    private String name;
    private Integer type; // 0 -> 本地服务器；3 -> LDAP服务器；2 -> ACTIVE-DIRECTORY服务器
    private Integer allowChangePwd; // 1->开启；不开启无此属性
    private String backUp3aServer; // 备用服务器
    private String hostname; // 服务器地址
    private String hostnameVirtualRoute; // 虚拟路由器
    private String hostnameVirtualRouteId;
    private String backUp1; // 备份服务器1
    private String backUp1VirtualRoute; // 虚拟路由器1
    private String backUp2; // 备份服务器2
    private String backUp2VirtualRoute; // 虚拟路由器2
    private String ldapBdn; // BASE-DNrefersh
    private Integer ldapPort; // 端口
    private String ldapLoginDn; // LOGIN-DN
    private String ldapLoginPassword; // 密钥
    private String ldapNamingAttr; // 用户名属性
    private String ldapGroupClass; // 组类别
    private String ldapMemberAttr; // 成员属性
    private String userFilter; // 过滤条件
    private Integer ldapAuthMethod; // 0 -> 明文；md5 无此属性
    private Integer ldapAgentEnable; // 监控用户登陆 1->启用 关闭无此属性
    private Integer ldapAgentPort; // 监听端口 1025-65535 默认6666
    private Integer disconnDelTimeout; // 登陆信息保留时间 0-1800 默认300
    private List<LocalUserModel> localUsers; // 该服务器下用户 1-n
    private List<LocalUserGroupModel> userGroups; // 该服务器下用户组 1-n

    public Long getVendorId() {
        return vendorId;
    }

    public void setVendorId(Long vendorId) {
        this.vendorId = vendorId;
    }

    public String getName() {
        return name;
    }

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

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getAllowChangePwd() {
        return allowChangePwd;
    }

    public void setAllowChangePwd(Integer allowChangePwd) {
        this.allowChangePwd = allowChangePwd;
    }

    public String getBackUp3aServer() {
        return backUp3aServer;
    }

    public void setBackUp3aServer(String backUp3aServer) {
        this.backUp3aServer = backUp3aServer;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public String getHostnameVirtualRoute() {
        return hostnameVirtualRoute;
    }

    public void setHostnameVirtualRoute(String hostnameVirtualRoute) {
        this.hostnameVirtualRoute = hostnameVirtualRoute;
    }

    public String getHostnameVirtualRouteId() {
        return hostnameVirtualRouteId;
    }

    public void setHostnameVirtualRouteId(String hostnameVirtualRouteId) {
        this.hostnameVirtualRouteId = hostnameVirtualRouteId;
    }

    public String getBackUp1() {
        return backUp1;
    }

    public void setBackUp1(String backUp1) {
        this.backUp1 = backUp1;
    }

    public String getBackUp2() {
        return backUp2;
    }

    public void setBackUp2(String backUp2) {
        this.backUp2 = backUp2;
    }

    public String getBackUp1VirtualRoute() {
        return backUp1VirtualRoute;
    }

    public void setBackUp1VirtualRoute(String backUp1VirtualRoute) {
        this.backUp1VirtualRoute = backUp1VirtualRoute;
    }

    public String getBackUp2VirtualRoute() {
        return backUp2VirtualRoute;
    }

    public void setBackUp2VirtualRoute(String backUp2VirtualRoute) {
        this.backUp2VirtualRoute = backUp2VirtualRoute;
    }

    public String getLdapBdn() {
        return ldapBdn;
    }

    public void setLdapBdn(String ldapBdn) {
        this.ldapBdn = ldapBdn;
    }

    public Integer getLdapPort() {
        return ldapPort;
    }

    public void setLdapPort(Integer ldapPort) {
        this.ldapPort = ldapPort;
    }

    public String getLdapLoginDn() {
        return ldapLoginDn;
    }

    public void setLdapLoginDn(String ldapLoginDn) {
        this.ldapLoginDn = ldapLoginDn;
    }

    public String getLdapLoginPassword() {
        return ldapLoginPassword;
    }

    public void setLdapLoginPassword(String ldapLoginPassword) {
        this.ldapLoginPassword = ldapLoginPassword;
    }

    public String getLdapNamingAttr() {
        return ldapNamingAttr;
    }

    public void setLdapNamingAttr(String ldapNamingAttr) {
        this.ldapNamingAttr = ldapNamingAttr;
    }

    public String getLdapGroupClass() {
        return ldapGroupClass;
    }

    public void setLdapGroupClass(String ldapGroupClass) {
        this.ldapGroupClass = ldapGroupClass;
    }

    public String getLdapMemberAttr() {
        return ldapMemberAttr;
    }

    public void setLdapMemberAttr(String ldapMemberAttr) {
        this.ldapMemberAttr = ldapMemberAttr;
    }

    public String getUserFilter() {
        return userFilter;
    }

    public void setUserFilter(String userFilter) {
        this.userFilter = userFilter;
    }

    public Integer getLdapAuthMethod() {
        return ldapAuthMethod;
    }

    public void setLdapAuthMethod(Integer ldapAuthMethod) {
        this.ldapAuthMethod = ldapAuthMethod;
    }

    public Integer getLdapAgentEnable() {
        return ldapAgentEnable;
    }

    public void setLdapAgentEnable(Integer ldapAgentEnable) {
        this.ldapAgentEnable = ldapAgentEnable;
    }

    public Integer getLdapAgentPort() {
        return ldapAgentPort;
    }

    public void setLdapAgentPort(Integer ldapAgentPort) {
        this.ldapAgentPort = ldapAgentPort;
    }

    public Integer getDisconnDelTimeout() {
        return disconnDelTimeout;
    }

    public void setDisconnDelTimeout(Integer disconnDelTimeout) {
        this.disconnDelTimeout = disconnDelTimeout;
    }

    public List<LocalUserModel> getLocalUsers() {
        return localUsers;
    }

    public void setLocalUsers(List<LocalUserModel> localUsers) {
        this.localUsers = localUsers;
    }

    public List<LocalUserGroupModel> getUserGroups() {
        return userGroups;
    }

    public void setUserGroups(List<LocalUserGroupModel> userGroups) {
        this.userGroups = userGroups;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AAAServerModel aaaServer = (AAAServerModel) o;
        return Objects.equals(vendorId, aaaServer.vendorId) &&
            Objects.equals(name, aaaServer.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(vendorId, name);
    }
}
