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.util.List;

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

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

    public final List<String> responses;

    public SshMsgUserAuthInfoResponse(List<String> responses) {
        assertNotNull(responses);
        this.responses = responses;
    }

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

    public interface Handler
            extends Message.HandlerBase {

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

    }
}
