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("lb_rule")
public class LbRule 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("back_end_id")
	private Long backEndId;
	@Column("probe_id")
	private Long probeId;
	@Column("front_end_port")
	private Integer frontEndPort;// 前端端口
	@Column("back_end_port")
	private Integer backEndPort;// 后端端口
	@Column("load_distribution")
	private String loadDistribution;
	@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 slbUuid;
	@IgnoreAll
	private String probeUuid;
	@IgnoreAll
	private String backEndName;
	@IgnoreAll
	private String probeName;

	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 getProbeUuid() {
		return probeUuid;
	}

	public void setProbeUuid(String probeUuid) {
		this.probeUuid = probeUuid;
	}

	public Long getProbeId() {
		return probeId;
	}

	public void setProbeId(Long probeId) {
		this.probeId = probeId;
	}

	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 String getLoadDistribution() {
		return loadDistribution;
	}

	public void setLoadDistribution(String loadDistribution) {
		this.loadDistribution = loadDistribution;
	}

	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 LbRule() {
		super();
	}

	public LbRule(Long creatorId, Long ownerId, Long menderId) {
		super(creatorId, ownerId, menderId);
	}

	public Long getFrontEndId() {
		return frontEndId;
	}

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

	public Long getBackEndId() {
		return backEndId;
	}

	public void setBackEndId(Long backEndId) {
		this.backEndId = backEndId;
	}

	public String getBackEndName() {
		return backEndName;
	}

	public void setBackEndName(String backEndName) {
		this.backEndName = backEndName;
	}

	public String getProbeName() {
		return probeName;
	}

	public void setProbeName(String probeName) {
		this.probeName = probeName;
	}

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

}
