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

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

import java.math.BigInteger;

import static com.jscape.util.Parameters.assertNotNull;

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

    public final BigInteger e;

    public SshMsgKexDhInit(BigInteger e) {
        assertNotNull(e);
        this.e = e;
    }

    @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 "SshMsgKexDhInit {"
                + "e=" + this.e
                + '}';
    }

    public interface Handler
            extends Message.HandlerBase {

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

    }
}
