package com.bocloud.ims.entity.resource.azure.slb;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;


@Table("inbound_nat_rule")
public class InboundNatRule extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("uuid")
    private String uuid;
    @Column("slb_id")
    private Long slbId;
    @Column("front_end_id")
    private Long frontEndId;
    @Column("front_end_port")
    private Integer frontEndPort;// 前端端口
    @Column("back_end_port")
    private Integer backEndPort;// 后端端口
    @Column("idle_timeout_in_minutes")
    private Integer idleTimeoutInMinutes;// 空闲超时（分钟）
    @Column("floating_ip_enabled")
    private Boolean floatingIPEnabled;// 浮动IP（禁用/起用）
    @Column("protocol")
    private String protocol;// 协议
    @Column("vendor_id")
    private Long vendorId;

    @IgnoreAll
    private String frontEndUuid;
    @IgnoreAll
    private String slbUuid;
    @IgnoreAll
    private String frontEndName;
    @IgnoreAll
    private String frontEndIpAddress;

    public String getFrontEndIpAddress() {
        return frontEndIpAddress;
    }

    public void setFrontEndIpAddress(String frontEndIpAddress) {
        this.frontEndIpAddress = frontEndIpAddress;
    }

    public String getFrontEndName() {
        return frontEndName;
    }

    public void setFrontEndName(String frontEndName) {
        this.frontEndName = frontEndName;
    }

    public Long getId() {
        return id;
    }

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

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getSlbUuid() {
        return slbUuid;
    }

    public void setSlbUuid(String slbUuid) {
        this.slbUuid = slbUuid;
    }

    public Long getSlbId() {
        return slbId;
    }

    public void setSlbId(Long slbId) {
        this.slbId = slbId;
    }

    public String getFrontEndUuid() {
        return frontEndUuid;
    }

    public void setFrontEndUuid(String frontEndUuid) {
        this.frontEndUuid = frontEndUuid;
    }

    public Integer getFrontEndPort() {
        return frontEndPort;
    }

    public void setFrontEndPort(Integer frontEndPort) {
        this.frontEndPort = frontEndPort;
    }

    public Integer getBackEndPort() {
        return backEndPort;
    }

    public void setBackEndPort(Integer backEndPort) {
        this.backEndPort = backEndPort;
    }

    public Integer getIdleTimeoutInMinutes() {
        return idleTimeoutInMinutes;
    }

    public void setIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) {
        this.idleTimeoutInMinutes = idleTimeoutInMinutes;
    }

    public Boolean getFloatingIPEnabled() {
        return floatingIPEnabled;
    }

    public void setFloatingIPEnabled(Boolean floatingIPEnabled) {
        this.floatingIPEnabled = floatingIPEnabled;
    }

    public String getProtocol() {
        return protocol;
    }

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

    public Long getVendorId() {
        return vendorId;
    }

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

    public InboundNatRule() {
        super();
    }

    public Long getFrontEndId() {
        return frontEndId;
    }

    public void setFrontEndId(Long frontEndId) {
        this.frontEndId = frontEndId;
    }

    public void preSave(Long creatorId, Long menderId, Long vendorId) {
        this.setCreatorId(creatorId);
        this.setMenderId(menderId);
        this.setVendorId(vendorId);
    }

}
