package com.jscape.inet.ssh.protocol.v2.messages;

import com.jscape.inet.ssh.protocol.messages.Message;
import com.jscape.util.net.connection.MessageConnection;

/**
 * @author Alex Usun
 */
public class SshMsgChannelSuccess
        extends Message<SshMsgChannelSuccess.Handler> {

    public final int recipientChannel;

    public SshMsgChannelSuccess(int recipientChannel) {
        this.recipientChannel = recipientChannel;
    }

    @Override
    public Class handlerClass() {
        return Handler.class;
    }

    @Override
    public void accept(Handler handler, MessageConnection<Message> connection) {
        handler.handle(this, connection);
    }

    @Override
    public String toString() {
        return "SshMsgChannelSuccess {"
                + "recipientChannel=" + this.recipientChannel
                + '}';
    }

    public interface Handler
            extends Message.HandlerBase {

        void handle(SshMsgChannelSuccess message, MessageConnection<Message> connection);

    }
}
