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 SshMsgKexDhGexRequest
        extends Message<SshMsgKexDhGexRequest.Handler> {

    public final int min;
    public final int n;
    public final int max;

    public SshMsgKexDhGexRequest(int min, int n, int max) {
        this.min = min;
        this.n = n;
        this.max = max;
    }

    @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 "SshMsgKeyDhGexRequest {"
                + "min=" + this.min
                + ", n=" + this.n
                + ", max=" + this.max
                + '}';
    }

    public interface Handler
            extends Message.HandlerBase {

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

    }
}
