package com.bocloud.nms.model.hillstone;

import java.util.Objects;

// 服务黑名单
public class BlackServiceModel extends HillStoneGenericModel {
    private Long vendorId; // 所属平台
    private Long virtualRouterId; // 所属虚拟路由器id
    private String virtualRouter; // 所属虚拟路由器
    private String srcIp; // 源ip地址
    private String desIp; // 目的ip地址
    private Integer desPort; // 目的端口
    private String protocol; // 协议：TCP、UDP
    private Integer age; // 剩余阻断时长，该字段会随着时间变化而变化，60-3600秒
    private String reason; // 加入原因： Manual 手工加入 其他可取值暂时未知

    public Long getVendorId() {
        return vendorId;
    }

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

    public Long getVirtualRouterId() {
        return virtualRouterId;
    }

    public void setVirtualRouterId(Long virtualRouterId) {
        this.virtualRouterId = virtualRouterId;
    }

    public String getVirtualRouter() {
        return virtualRouter;
    }

    public void setVirtualRouter(String virtualRouter) {
        this.virtualRouter = virtualRouter;
    }

    public String getSrcIp() {
        return srcIp;
    }

    public void setSrcIp(String srcIp) {
        this.srcIp = srcIp;
    }

    public String getDesIp() {
        return desIp;
    }

    public void setDesIp(String desIp) {
        this.desIp = desIp;
    }

    public Integer getDesPort() {
        return desPort;
    }

    public void setDesPort(Integer desPort) {
        this.desPort = desPort;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BlackServiceModel service = (BlackServiceModel) o;
        return Objects.equals(virtualRouterId, service.virtualRouterId) &&
            Objects.equals(srcIp, service.srcIp) &&
            Objects.equals(desIp, service.desIp) &&
            Objects.equals(desPort, service.desPort) &&
            Objects.equals(protocol, service.protocol);
    }

    @Override
    public int hashCode() {
        return Objects.hash(virtualRouterId, srcIp, desIp, desPort, protocol);
    }
}
