package com.bocloud.nms.model.hillstone;

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

// 接口
public class InterfaceModel extends HillStoneGenericModel {
    private Long vendorId; // 所属平台
    private String name; // 名称
    private Integer state; // 状态
    private String description; // 描述
    private Long zoneId; // 绑定的安全域id，
    private String zone; // 绑定的安全域，对应安全域名称
    private Long tapAddrId; // TAP内网地址Id
    private String tapAddr; // TAP内网地址，对应地址簿名称
    private Boolean dhcp; // dhcp
    private Boolean setRoute; // 将DHCP服务器提供的网关信息设置为默认网关路由
    private Long ip; // ip地址
    private Long mask; // 子网掩码
    private String mac; // mac地址
    private String vsys; // 虚拟系统
    private Integer currAccssIpCnt; // 接入用户/IP数，该数据是实时的
    private Long currUpTraffic; // 上行速率，该数据是实时的
    private Long currDownTraffic; // 上行速率，该数据是实时的
    private Boolean localIp; // 配置为localIp
    private Integer dnsProxy; // dns代理，0不启用，1启用代理，2启用透明代理
    private Integer dnsPass; // dns穿透，3不启用，4启用
    private Boolean telnetEnable; // 开启telnet管理方式
    private Boolean sshEnable; // 开启ssh管理方式
    private Boolean pingEnable; // 开启ping
    private Boolean httpEnable; // 开启http协议访问
    private Boolean httpsEnable; // 开启https协议访问
    private Boolean snmpEnable; // 开启smnp协议访问
    private Integer revsRoute; // 逆向路由，1关闭，2自动，null启用
    private Boolean hostRoute; // WAP智能分流
    private Boolean dstIpReplace; // 目的IP替换
    private Integer hostRouteLog; // WAP日志记录方式，1记录所有日志，0记录被替换的目的ip的日志
    private Integer dstPort1; // 目的服务器端口1
    private Integer dstPort2; // 目的服务器端口2
    private Integer routeDist; // 路由距离
    private Integer routeWeight; // 路由权重
    private Integer dnsPri; // dns管理优先级
    private Long manageIp; // 管理ip
    private String secondIps; // 二级IP列表，按照1.1.1.1/24的格式保存，英文逗号隔开
    private Boolean arp; // 开启arp
    private Integer arpTimeout; // arp超时时间，秒
    private Integer mtu; // mtu，字节
    private Long keepaliveIp; // 开启keepalive IP
    private Boolean mirror; // 开启流量镜像
    private String mirrorType; // 流量镜像类型：both所有流量，tx发送流量，rx接收流量
    private Boolean shutdown; // 立即关闭
    private Long shutdownTrackId; // 当此id监控对象失败时，接口自动关闭
    private String shutdownTrack; // 在此id的监控对象失败时，接口自动关闭
    private Long shutdownScheduleId; // 在此id的时间表内，接口自动关闭
    private String shutdownSchedule; // 在此时间表内，接口自动关闭
    private Long monitorBackupTrackId; // 在此id的监控对象失败时，执行监控与备份
    private String monitorBackupTrack; // 在此监控对象失败时，执行监控与备份
    private Long monitorBackupScheduleId; // 在此id的时间表内，执行监控与备份
    private String monitorBackupSchedule; // 在此时间表内，执行监控与备份
    private Boolean mbMonitor; // 在时间表内或监控对象失败时，是否执行监控
    private Long mbBackupIfId; // 在时间表内或监控对象失败时，将流量备份到此id的接口
    private String mbBackupIf; // 在时间表内或监控对象失败时，将流量备份到此接口
    private Integer mbBackupOverlap; // 在过渡时间内，流量从主接口平滑转到备份接口
    private String ripAuthMode; // rip认证方式，text：明文，md5：MD5
    private String ripAuthString; // rip认证码
    private Integer ripSendVersion; // rip发送版本，1：V1,2：V2，3：V1&V2
    private Integer ripRecvVersion; // rip接收版本，1：V1,2：V2，3：V1&V2
    private Boolean ripSplitHorizon; // rip水平分割
    private String duplex; // 双工，full全双工，半双工取值未知
    private Integer speed; // 速率，米
    private Boolean lacpAggregate; // 聚合方式：true：LACP动态传输，false：强制模式
    private Integer aggSysPriority; // 系统优先级
    private Integer aggMaxBundle; // 最大链路数
    private Integer aggMinBundle; // 最小链路数
    private Long aggIfId; // 绑定的聚集接口id
    private String aggIf; // 绑定的聚集接口
    private Boolean lbStream; // 负载均衡方式: 基于流
    private Boolean lbSrcMac; // 负载均衡方式：源MAC
    private Boolean lbDesMac; // 负载均衡方式：目的MAC
    private Boolean lbSrcIp; // 负载均衡方式：源IP
    private Boolean lbDesIp; // 负载均衡方式：目的IP
    private Boolean lbSrcPort; // 负载均衡方式：源端口
    private Boolean lbDesPort; // 负载均衡方式：目的端口
    private Boolean lbProtocol; // 负载均衡方式：协议类型
    private List<Long> bindPorts; // 绑定端口
    private Long upstreamBandwidth; // 上行带宽 512000-1000000000000 bps
    private Long downstreamBandwidth; // 下行带宽 512000-1000000000000 bps

    public void setBindPorts(List<Long> bindPorts) {
        this.bindPorts = bindPorts;
    }

    public List<Long> getBindPorts() {
        return bindPorts;
    }

    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 String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getZoneId() {
        return zoneId;
    }

    public void setZoneId(Long zoneId) {
        this.zoneId = zoneId;
    }

    public String getZone() {
        return zone;
    }

    public void setZone(String zone) {
        this.zone = zone;
    }

    public Long getTapAddrId() {
        return tapAddrId;
    }

    public void setTapAddrId(Long tapAddrId) {
        this.tapAddrId = tapAddrId;
    }

    public String getTapAddr() {
        return tapAddr;
    }

    public void setTapAddr(String tapAddr) {
        this.tapAddr = tapAddr;
    }

    public Boolean getDhcp() {
        return dhcp;
    }

    public void setDhcp(Boolean dhcp) {
        this.dhcp = dhcp;
    }

    public Boolean getSetRoute() {
        return setRoute;
    }

    public void setSetRoute(Boolean setRoute) {
        this.setRoute = setRoute;
    }

    public Long getIp() {
        return ip;
    }

    public void setIp(Long ip) {
        this.ip = ip;
    }

    public Long getMask() {
        return mask;
    }

    public void setMask(Long mask) {
        this.mask = mask;
    }

    public Boolean getLocalIp() {
        return localIp;
    }

    public void setLocalIp(Boolean localIp) {
        this.localIp = localIp;
    }

    public Integer getDnsProxy() {
        return dnsProxy;
    }

    public void setDnsProxy(Integer dnsProxy) {
        this.dnsProxy = dnsProxy;
    }

    public Integer getDnsPass() {
        return dnsPass;
    }

    public void setDnsPass(Integer dnsPass) {
        this.dnsPass = dnsPass;
    }

    public Boolean getTelnetEnable() {
        return telnetEnable;
    }

    public void setTelnetEnable(Boolean telnetEnable) {
        this.telnetEnable = telnetEnable;
    }

    public Boolean getSshEnable() {
        return sshEnable;
    }

    public void setSshEnable(Boolean sshEnable) {
        this.sshEnable = sshEnable;
    }

    public Boolean getPingEnable() {
        return pingEnable;
    }

    public void setPingEnable(Boolean pingEnable) {
        this.pingEnable = pingEnable;
    }

    public Boolean getHttpEnable() {
        return httpEnable;
    }

    public void setHttpEnable(Boolean httpEnable) {
        this.httpEnable = httpEnable;
    }

    public Boolean getHttpsEnable() {
        return httpsEnable;
    }

    public void setHttpsEnable(Boolean httpsEnable) {
        this.httpsEnable = httpsEnable;
    }

    public Boolean getSnmpEnable() {
        return snmpEnable;
    }

    public void setSnmpEnable(Boolean snmpEnable) {
        this.snmpEnable = snmpEnable;
    }

    public Integer getRevsRoute() {
        return revsRoute;
    }

    public void setRevsRoute(Integer revsRoute) {
        this.revsRoute = revsRoute;
    }

    public Boolean getHostRoute() {
        return hostRoute;
    }

    public void setHostRoute(Boolean hostRoute) {
        this.hostRoute = hostRoute;
    }

    public Boolean getDstIpReplace() {
        return dstIpReplace;
    }

    public void setDstIpReplace(Boolean dstIpReplace) {
        this.dstIpReplace = dstIpReplace;
    }

    public Integer getHostRouteLog() {
        return hostRouteLog;
    }

    public void setHostRouteLog(Integer hostRouteLog) {
        this.hostRouteLog = hostRouteLog;
    }

    public Integer getDstPort1() {
        return dstPort1;
    }

    public void setDstPort1(Integer dstPort1) {
        this.dstPort1 = dstPort1;
    }

    public Integer getDstPort2() {
        return dstPort2;
    }

    public void setDstPort2(Integer dstPort2) {
        this.dstPort2 = dstPort2;
    }

    public Integer getRouteDist() {
        return routeDist;
    }

    public void setRouteDist(Integer routeDist) {
        this.routeDist = routeDist;
    }

    public Integer getRouteWeight() {
        return routeWeight;
    }

    public void setRouteWeight(Integer routeWeight) {
        this.routeWeight = routeWeight;
    }

    public Integer getDnsPri() {
        return dnsPri;
    }

    public void setDnsPri(Integer dnsPri) {
        this.dnsPri = dnsPri;
    }

    public Long getManageIp() {
        return manageIp;
    }

    public void setManageIp(Long manageIp) {
        this.manageIp = manageIp;
    }

    public String getSecondIps() {
        return secondIps;
    }

    public void setSecondIps(String secondIps) {
        this.secondIps = secondIps;
    }

    public Boolean getArp() {
        return arp;
    }

    public void setArp(Boolean arp) {
        this.arp = arp;
    }

    public Integer getArpTimeout() {
        return arpTimeout;
    }

    public void setArpTimeout(Integer arpTimeout) {
        this.arpTimeout = arpTimeout;
    }

    public Integer getMtu() {
        return mtu;
    }

    public void setMtu(Integer mtu) {
        this.mtu = mtu;
    }

    public Long getKeepaliveIp() {
        return keepaliveIp;
    }

    public void setKeepaliveIp(Long keepaliveIp) {
        this.keepaliveIp = keepaliveIp;
    }

    public Boolean getMirror() {
        return mirror;
    }

    public void setMirror(Boolean mirror) {
        this.mirror = mirror;
    }

    public String getMirrorType() {
        return mirrorType;
    }

    public void setMirrorType(String mirrorType) {
        this.mirrorType = mirrorType;
    }

    public Boolean getShutdown() {
        return shutdown;
    }

    public void setShutdown(Boolean shutdown) {
        this.shutdown = shutdown;
    }

    public Long getShutdownTrackId() {
        return shutdownTrackId;
    }

    public void setShutdownTrackId(Long shutdownTrackId) {
        this.shutdownTrackId = shutdownTrackId;
    }

    public String getShutdownTrack() {
        return shutdownTrack;
    }

    public void setShutdownTrack(String shutdownTrack) {
        this.shutdownTrack = shutdownTrack;
    }

    public Long getShutdownScheduleId() {
        return shutdownScheduleId;
    }

    public void setShutdownScheduleId(Long shutdownScheduleId) {
        this.shutdownScheduleId = shutdownScheduleId;
    }

    public String getShutdownSchedule() {
        return shutdownSchedule;
    }

    public void setShutdownSchedule(String shutdownSchedule) {
        this.shutdownSchedule = shutdownSchedule;
    }

    public Long getMonitorBackupTrackId() {
        return monitorBackupTrackId;
    }

    public void setMonitorBackupTrackId(Long monitorBackupTrackId) {
        this.monitorBackupTrackId = monitorBackupTrackId;
    }

    public String getMonitorBackupTrack() {
        return monitorBackupTrack;
    }

    public void setMonitorBackupTrack(String monitorBackupTrack) {
        this.monitorBackupTrack = monitorBackupTrack;
    }

    public Long getMonitorBackupScheduleId() {
        return monitorBackupScheduleId;
    }

    public void setMonitorBackupScheduleId(Long monitorBackupScheduleId) {
        this.monitorBackupScheduleId = monitorBackupScheduleId;
    }

    public String getMonitorBackupSchedule() {
        return monitorBackupSchedule;
    }

    public void setMonitorBackupSchedule(String monitorBackupSchedule) {
        this.monitorBackupSchedule = monitorBackupSchedule;
    }

    public Boolean getMbMonitor() {
        return mbMonitor;
    }

    public void setMbMonitor(Boolean mbMonitor) {
        this.mbMonitor = mbMonitor;
    }

    public Long getMbBackupIfId() {
        return mbBackupIfId;
    }

    public void setMbBackupIfId(Long mbBackupIfId) {
        this.mbBackupIfId = mbBackupIfId;
    }

    public String getMbBackupIf() {
        return mbBackupIf;
    }

    public void setMbBackupIf(String mbBackupIf) {
        this.mbBackupIf = mbBackupIf;
    }

    public Integer getMbBackupOverlap() {
        return mbBackupOverlap;
    }

    public void setMbBackupOverlap(Integer mbBackupOverlap) {
        this.mbBackupOverlap = mbBackupOverlap;
    }

    public String getRipAuthMode() {
        return ripAuthMode;
    }

    public void setRipAuthMode(String ripAuthMode) {
        this.ripAuthMode = ripAuthMode;
    }

    public String getRipAuthString() {
        return ripAuthString;
    }

    public void setRipAuthString(String ripAuthString) {
        this.ripAuthString = ripAuthString;
    }

    public Integer getRipSendVersion() {
        return ripSendVersion;
    }

    public void setRipSendVersion(Integer ripSendVersion) {
        this.ripSendVersion = ripSendVersion;
    }

    public Integer getRipRecvVersion() {
        return ripRecvVersion;
    }

    public void setRipRecvVersion(Integer ripRecvVersion) {
        this.ripRecvVersion = ripRecvVersion;
    }

    public Boolean getRipSplitHorizon() {
        return ripSplitHorizon;
    }

    public void setRipSplitHorizon(Boolean ripSplitHorizon) {
        this.ripSplitHorizon = ripSplitHorizon;
    }

    public String getDuplex() {
        return duplex;
    }

    public void setDuplex(String duplex) {
        this.duplex = duplex;
    }

    public Integer getSpeed() {
        return speed;
    }

    public void setSpeed(Integer speed) {
        this.speed = speed;
    }

    public Boolean getLacpAggregate() {
        return lacpAggregate;
    }

    public void setLacpAggregate(Boolean lacpAggregate) {
        this.lacpAggregate = lacpAggregate;
    }

    public Integer getAggSysPriority() {
        return aggSysPriority;
    }

    public void setAggSysPriority(Integer aggSysPriority) {
        this.aggSysPriority = aggSysPriority;
    }

    public Integer getAggMaxBundle() {
        return aggMaxBundle;
    }

    public void setAggMaxBundle(Integer aggMaxBundle) {
        this.aggMaxBundle = aggMaxBundle;
    }

    public Integer getAggMinBundle() {
        return aggMinBundle;
    }

    public void setAggMinBundle(Integer aggMinBundle) {
        this.aggMinBundle = aggMinBundle;
    }

    public Long getAggIfId() {
        return aggIfId;
    }

    public void setAggIfId(Long aggIfId) {
        this.aggIfId = aggIfId;
    }

    public String getAggIf() {
        return aggIf;
    }

    public void setAggIf(String aggIf) {
        this.aggIf = aggIf;
    }

    public Boolean getLbStream() {
        return lbStream;
    }

    public void setLbStream(Boolean lbStream) {
        this.lbStream = lbStream;
    }

    public Boolean getLbSrcMac() {
        return lbSrcMac;
    }

    public void setLbSrcMac(Boolean lbSrcMac) {
        this.lbSrcMac = lbSrcMac;
    }

    public Boolean getLbDesMac() {
        return lbDesMac;
    }

    public void setLbDesMac(Boolean lbDesMac) {
        this.lbDesMac = lbDesMac;
    }

    public Boolean getLbSrcIp() {
        return lbSrcIp;
    }

    public void setLbSrcIp(Boolean lbSrcIp) {
        this.lbSrcIp = lbSrcIp;
    }

    public Boolean getLbDesIp() {
        return lbDesIp;
    }

    public void setLbDesIp(Boolean lbDesIp) {
        this.lbDesIp = lbDesIp;
    }

    public Boolean getLbSrcPort() {
        return lbSrcPort;
    }

    public void setLbSrcPort(Boolean lbSrcPort) {
        this.lbSrcPort = lbSrcPort;
    }

    public Boolean getLbDesPort() {
        return lbDesPort;
    }

    public void setLbDesPort(Boolean lbDesPort) {
        this.lbDesPort = lbDesPort;
    }

    public Boolean getLbProtocol() {
        return lbProtocol;
    }

    public String getIpString() {
        return Optional.ofNullable(this.getIp()).map(Ipv4::convertIp).orElse(null);
    }

    public String getMaskString() {
        return Optional.ofNullable(this.getMask()).map(Ipv4::convertMask).orElse(null);
    }

    public void setLbProtocol(Boolean lbProtocol) {
        this.lbProtocol = lbProtocol;
    }

    public void setUpstreamBandwidth(Long upstreamBandwidth) {
        this.upstreamBandwidth = upstreamBandwidth;
    }

    public Long getUpstreamBandwidth() {
        return upstreamBandwidth;
    }

    public void setDownstreamBandwidth(Long downstreamBandwidth) {
        this.downstreamBandwidth = downstreamBandwidth;
    }

    public Long getDownstreamBandwidth() {
        return downstreamBandwidth;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getVsys() {
        return vsys;
    }

    public void setVsys(String vsys) {
        this.vsys = vsys;
    }

    public Integer getCurrAccssIpCnt() {
        return currAccssIpCnt;
    }

    public void setCurrAccssIpCnt(Integer currAccssIpCnt) {
        this.currAccssIpCnt = currAccssIpCnt;
    }

    public Long getCurrUpTraffic() {
        return currUpTraffic;
    }

    public void setCurrUpTraffic(Long currUpTraffic) {
        this.currUpTraffic = currUpTraffic;
    }

    public Long getCurrDownTraffic() {
        return currDownTraffic;
    }

    public void setCurrDownTraffic(Long currDownTraffic) {
        this.currDownTraffic = currDownTraffic;
    }

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

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