package com.jscape.inet.sftp.protocol.v4.messages;

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

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

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

    public final int id;
    public final String filename;

    public SshFxpRemove(int id, String filename) {
        this.id = id;

        assertNotNull(filename);
        this.filename = filename;
    }

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

    @Override
    public String toString() {
        return "SshFxpRemove {"
                + "id=" + this.id
                + ", filename='" + this.filename + '\''
                + '}';
    }

    public interface Handler
            extends Message.HandlerBase {

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

    }
}
