package cn.com.taiji.track.event;

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 ChannelAddEvent extends ApplicationEvent {

    private ChannelHandlerContext ctx;

    private ChannelId channelId;

    private String cql;

    private String realCql;

    public ChannelAddEvent(Object source, ChannelHandlerContext ctx, ChannelId channelId,String cql,String realCql) {
        super(source);
        this.ctx = ctx;
        this.channelId = channelId;
        if(null != cql){
            this.cql = cql;
        }
        if(null != realCql){
            this.realCql = realCql;
        }
    }

    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 String getCql() {
        return cql;
    }

    public void setCql(String cql) {
        this.cql = cql;
    }

    public String getRealCql() {
        return realCql;
    }

    public void setRealCql(String realCql) {
        this.realCql = realCql;
    }

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