package cn.com.taiji.track.event;

import cn.com.taiji.track.dto.FocusTrackQueryDTO;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelId;
import org.springframework.context.ApplicationEvent;

/**
 * @author chenfangchao
 * @title: NettyEvent
 * @projectName ax-geomesa-redis
 * @description: TODO
 * @date 2022/9/22 6:00 PM
 */
public class FocusTrackChannelAddEvent extends ApplicationEvent {

    private ChannelHandlerContext ctx;

    private ChannelId channelId;

    private FocusTrackQueryDTO dto;

    public FocusTrackChannelAddEvent(Object source, ChannelHandlerContext ctx, ChannelId channelId, FocusTrackQueryDTO dto) {
        super(source);
        this.ctx = ctx;
        this.channelId = channelId;
        if(null != dto){
            this.dto = dto;
        }
    }

    public ChannelHandlerContext getCtx() {
        return ctx;
    }

    public void setCtx(ChannelHandlerContext ctx) {
        this.ctx = ctx;
    }

    public ChannelId getChannelId() {
        return channelId;
    }

    public void setChannelId(ChannelId channelId) {
        this.channelId = channelId;
    }

    public FocusTrackQueryDTO getDto() {
        return dto;
    }

    public void setDto(FocusTrackQueryDTO dto) {
        this.dto = dto;
    }

    @Override
    public String toString() {
        return "ChannelAddEvent{" +
                "ctx=" + ctx +
                ", channelId=" + channelId +
                ", dto='" + dto.toString() + '\'' +
                '}';
    }
}
