package com.jiayue.ipfcst.common.data.entity.gathertunnelinfo;

import com.jiayue.ipfcst.common.data.constant.enums.TunnelType;
import com.jiayue.ipfcst.common.data.entity.BaseTunnelInfo;
import com.jiayue.ipfcst.common.data.entity.ProtocolGatherDataPoint;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 104协议tcp数据采集通道信息
 *
 * @author 修唯xiuwei
 * @version 3.0
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Table(name = "gather_104_tcp_tunnel_info")
@Proxy(lazy = false)
public class Gather104TcpTunnelInfo extends BaseTunnelInfo<ProtocolGatherDataPoint> {


    /**
     * 远端ip
     */
    @Column(length = 15)
    private String remoteIp;

    /**
     * 远端端口
     */
    @Column(length = 6)
    private Integer remotePort = 2404;

    /**
     * 远端备用ip
     */
    @Column(length = 15)
    private String remoteSpareIp;

    /**
     * 远端备用端口
     */
    @Column(length = 6)
    private Integer remoteSparePort;

    /**
     * 自身的ip
     */
    @Column(length = 15)
    private String selfIp;

    /**
     * 自身的端口
     */
    @Column(length = 6)
    private Integer selfPort;

    /**
     * 公共地址位
     */
    @Column(length = 3)
    private Integer publicAddress = 1;

    /**
     * 初始化时确定通道类型
     */
    public Gather104TcpTunnelInfo() {
        this.setTunnelType(TunnelType.IEC104TCPMASTER);
    }


}
