package com.bocloud.ims.entity.resource.horizon;

import com.bocloud.common.utils.DateSerializer;
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;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * horizon会话
 * 
 * @author HP
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("vmware_horizon_session")
public class VmwareHorizonSession extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("access_group_id")
	private String accessGroupId;
	@Column("agent_version")
	private String agentVersion;
	@Column("application_names")
	private String applicationNames;
	@Column("broker_user_id")
	private String brokerUserId;
	@Column("brokered_remotely")
	private Boolean brokeredRemotely;
	@Column("client_data")
	private String clientData;
	@Column("desktop_pool_id")
	private String desktopPoolId;
	@Column("horizon_desktop_pool_id")
	private Long horizonDesktopPoolId;
	@Column("disconnected_time")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date disconnectedTime;
	@Column("farm_id")
	private String farmId;
	@Column("session_uuid")
	private String uuid;
	@Column("idle_duration")
	private Long idleDuration;
	@Column("last_session_duration_ms")
	private Long lastSessionDurationMs;
	@Column("machine_id")
	private String machineId;
	@Column("rds_server_id")
	private String rdsServerId;
	@Column("resourced_remotely")
	private Boolean resourcedRemotely;
	@Column("security_gateway_data")
	private String securityGatewayData;
	@Column("session_protocol")
	private String sessionProtocol;
	@Column("session_state")
	private String sessionState;
	@Column("session_type")
	private String sessionType;
	@Column("start_time")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;
	@Column("unauthenticated")
	private Boolean unauthenticated;
	@Column("user_id")
	private String userId;
	@Column("horizon_user_id")
	private Long horizonUserId;
	@Column("vendor_id")
	private Long vendorId;
	@IgnoreAll
	private String vendorType;
	@IgnoreAll
	private String vendorName;
}
