package com.jscape.inet.http.protocol.messages;

import com.jscape.util.net.connection.MessageConnection;

import java.io.InputStream;
import java.util.Arrays;

/**
 * @author Alex Usun
 */
public class DeleteRequest
        extends RequestMessage<DeleteRequest.Handler> {

    public DeleteRequest(String uri, String version, Header[] headers, InputStream body) {
        super(version, uri, headers, body);
    }

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

    @Override
    public String toString() {
        return "DeleteRequest {"
               + "uri='" + this.uri + '\''
               + ", protocolVersion='" + this.protocolVersion + '\''
               + ", headers=" + Arrays.toString(this.headers)
               + ", body=" + this.body
               + '}';
    }

    public interface Handler
            extends RequestMessage.HandlerBase {

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

    }
}
