package com.bocloud.ims.entity.resource;

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;

/**
 * 负载均衡监听器实体类
 * 
 * @author wangyu
 * @version 1.0
 * @since 2017年8月29日
 *
 */
@Table("lb_listener")
public class LbListener extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("listener_uuid")
	private String listenerUuid;// 监听器ID
	@Column("conn_limit")
	private Integer connLimit;// 连接限制
	@Column("defaultpool_uuid")
	private String defaultPoolUuid;// 默认池ID
	@Column("lb_uuid")
	private String lbUuid;// 负载均衡器UUID
	@Column("protocol")
	private String protocol;// 监听器协议
	@Column("port")
	private Integer port;// 监听器端口
	@Column("tenant_uuid")
	private String tenantUuid;// 租户ID
	@Column("admin_stateup")
	private Boolean adminStateUp;// 网络管理状态
	@Column("def_tls_container_ref")
	private String defTlsContainerRef;
	@Column("vendor_id")
	private Long vendorId;
	@Column("lb_id")
	private Long lbId;// 负载均衡器ID
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@Column("project_id")
	private Long projectId;// 项目ID

	@Column("region_id")
	private String regionId;// 所属域
	@Column("certificates")
	private Object certificates;
	@Column("ssl_policy")
	private String sslPolicy;
	@Column("alpn_policy")
	private Object alpnPolicy;
	@Column("default_actions")
	private Object defaultActions;
	@Column("configuration")
	private Object configuration;

	@IgnoreAll
	private LbPool pool;
	@IgnoreAll
	private HealthMonitor monitor;
	@IgnoreAll
	private String tenantName;
	@IgnoreAll
	private Long poolId;
	@IgnoreAll
	private String regionName;
	@IgnoreAll
	private String poolName;
	@IgnoreAll
	private String remark;

	public LbListener() {
		super();
	}

	public void preSave(Long creatorId, Long menderId, Long vendorId, Long lbId, Long tenantId, Long projectId) {
		this.setCreatorId(creatorId);
		this.setMenderId(menderId);
		this.setVendorId(vendorId);
		this.setLbId(lbId);
		this.setTenantId(tenantId);
		this.setProjectId(projectId);
	}

	/**
	 * @param listenerUuid
	 * @param connLimit
	 * @param defaultPoolUuid
	 * @param lbId
	 * @param lbUuid
	 * @param protocol
	 * @param port
	 * @param tenantUuid
	 * @param adminStateUp
	 * @param defTlsContainerRef
	 * @param vendorId
	 */
	public LbListener(String listenerUuid, Integer connLimit, String defaultPoolUuid, Long lbId, String lbUuid,
			String protocol, Integer port, String tenantUuid, Boolean adminStateUp, String defTlsContainerRef,
			Long vendorId) {
		super();
		this.listenerUuid = listenerUuid;
		this.connLimit = connLimit;
		this.defaultPoolUuid = defaultPoolUuid;
		this.lbId = lbId;
		this.lbUuid = lbUuid;
		this.protocol = protocol;
		this.port = port;
		this.tenantUuid = tenantUuid;
		this.adminStateUp = adminStateUp;
		this.defTlsContainerRef = defTlsContainerRef;
		this.vendorId = vendorId;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the listenerUuid
	 */
	public String getListenerUuid() {
		return listenerUuid;
	}

	/**
	 * @param listenerUuid the listenerUuid to set
	 */
	public void setListenerUuid(String listenerUuid) {
		this.listenerUuid = listenerUuid;
	}

	/**
	 * @return the connLimit
	 */
	public Integer getConnLimit() {
		return connLimit;
	}

	/**
	 * @param connLimit the connLimit to set
	 */
	public void setConnLimit(Integer connLimit) {
		this.connLimit = connLimit;
	}

	/**
	 * @return the defaultPoolUuid
	 */
	public String getDefaultPoolUuid() {
		return defaultPoolUuid;
	}

	/**
	 * @param defaultPoolUuid the defaultPoolUuid to set
	 */
	public void setDefaultPoolUuid(String defaultPoolUuid) {
		this.defaultPoolUuid = defaultPoolUuid;
	}

	/**
	 * @return the lbId
	 */
	public Long getLbId() {
		return lbId;
	}

	/**
	 * @param lbId the lbId to set
	 */
	public void setLbId(Long lbId) {
		this.lbId = lbId;
	}

	/**
	 * @return the lbUuid
	 */
	public String getLbUuid() {
		return lbUuid;
	}

	/**
	 * @param lbUuid the lbUuid to set
	 */
	public void setLbUuid(String lbUuid) {
		this.lbUuid = lbUuid;
	}

	/**
	 * @return the protocol
	 */
	public String getProtocol() {
		return protocol;
	}

	/**
	 * @param protocol the protocol to set
	 */
	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	/**
	 * @return the port
	 */
	public Integer getPort() {
		return port;
	}

	/**
	 * @param port the port to set
	 */
	public void setPort(Integer port) {
		this.port = port;
	}

	/**
	 * @return the tenantUuid
	 */
	public String getTenantUuid() {
		return tenantUuid;
	}

	/**
	 * @param tenantUuid the tenantUuid to set
	 */
	public void setTenantUuid(String tenantUuid) {
		this.tenantUuid = tenantUuid;
	}

	/**
	 * @return the adminStateUp
	 */
	public Boolean getAdminStateUp() {
		return adminStateUp;
	}

	/**
	 * @param adminStateUp the adminStateUp to set
	 */
	public void setAdminStateUp(Boolean adminStateUp) {
		this.adminStateUp = adminStateUp;
	}

	/**
	 * @return the defTlsContainerRef
	 */
	public String getDefTlsContainerRef() {
		return defTlsContainerRef;
	}

	/**
	 * @param defTlsContainerRef the defTlsContainerRef to set
	 */
	public void setDefTlsContainerRef(String defTlsContainerRef) {
		this.defTlsContainerRef = defTlsContainerRef;
	}

	/**
	 * @return the vendorId
	 */
	public Long getVendorId() {
		return vendorId;
	}

	/**
	 * @param vendorId the vendorId to set
	 */
	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	/**
	 * @return the pool
	 */
	public LbPool getPool() {
		return pool;
	}

	/**
	 * @param pool the pool to set
	 */
	public void setPool(LbPool pool) {
		this.pool = pool;
	}

	/**
	 * @return the monitor
	 */
	public HealthMonitor getMonitor() {
		return monitor;
	}

	/**
	 * @param monitor the monitor to set
	 */
	public void setMonitor(HealthMonitor monitor) {
		this.monitor = monitor;
	}

	/**
	 * @return the tenantId
	 */
	public Long getTenantId() {
		return tenantId;
	}

	/**
	 * @param tenantId the tenantId to set
	 */
	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	/**
	 * @return the tenantName
	 */
	public String getTenantName() {
		return tenantName;
	}

	/**
	 * @param tenantName the tenantName to set
	 */
	public void setTenantName(String tenantName) {
		this.tenantName = tenantName;
	}

	/**
	 * @return the projectId
	 */
	public Long getProjectId() {
		return projectId;
	}

	/**
	 * @param projectId the projectId to set
	 */
	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	/**
	 * @return the poolId
	 */
	public Long getPoolId() {
		return poolId;
	}

	/**
	 * @param poolId the poolId to set
	 */
	public void setPoolId(Long poolId) {
		this.poolId = poolId;
	}

	public String getRegionId() {
		return regionId;
	}

	public void setRegionId(String regionId) {
		this.regionId = regionId;
	}

	public Object getCertificates() {
		return certificates;
	}

	public void setCertificates(Object certificates) {
		this.certificates = certificates;
	}

	public String getSslPolicy() {
		return sslPolicy;
	}

	public void setSslPolicy(String sslPolicy) {
		this.sslPolicy = sslPolicy;
	}

	public Object getAlpnPolicy() {
		return alpnPolicy;
	}

	public void setAlpnPolicy(Object alpnPolicy) {
		this.alpnPolicy = alpnPolicy;
	}

	public Object getDefaultActions() {
		return defaultActions;
	}

	public void setDefaultActions(Object defaultActions) {
		this.defaultActions = defaultActions;
	}

	public Object getConfiguration() {
		return configuration;
	}

	public void setConfiguration(Object configuration) {
		this.configuration = configuration;
	}

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	public String getPoolName() {
		return poolName;
	}

	public void setPoolName(String poolName) {
		this.poolName = poolName;
	}

	@Override
	public String getRemark() {
		return remark;
	}

	@Override
	public void setRemark(String remark) {
		this.remark = remark;
	}
}
