package com.cloudcross.ssp.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.common.utils.FieldInfo;

/**
 * 创建人：rongying
 * 创建时间：2015.12.11
 * dsp账户实体对象
 */

@SuppressWarnings("serial")
public class DspAgent implements Serializable {
	
	private Long id;//dsp账号id

	private String token;//令牌
	
	private String name;//dsp账户名
	
	private String ip;//ip地址
	
	private Long port;//端口

	private Date updated;//最后更新时间
	
	public Long getId() {
		return id;
	}

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

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Long getPort() {
		return port;
	}

	public void setPort(Long port) {
		this.port = port;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@Override
	public String toString() {
		return "DspAgent [id=" + id + ", token=" + token + ", name=" + name + ","
				+ " ip=" + ip + ", port=" + port + " updated=" + updated + "]";
	}
	
	/**
	 * 组装t_dsp_agent表结构
	 * @return
	 */
	public static Map<String,FieldInfo> getFieldInfoForDspAgent(){
		Map<String,FieldInfo> map = new HashMap<String,FieldInfo>();
		String[] columnNames = {"id","token","name","ip","port"};
		String[] dataTypes= {"Long","String","String","String","Long"};
		int[] maxLengths = {11,255,255,255,11};
		for (int i = 0, l = columnNames.length; i<l; i++) {
			FieldInfo field = new FieldInfo();
			field.setColumnName(columnNames[i]);
			field.setIsNull("NO");
			field.setDataType(dataTypes[i]);
			field.setMaxLength(maxLengths[i]);
			field.setPointNum(0);
			map.put(columnNames[i], field);
		}
		return map;
	}

}

