Class LocalHttpServerResponse

  • All Implemented Interfaces:
    io.vertx.core.http.HttpServerResponse, io.vertx.core.streams.StreamBase, io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>, FastFailHttpServerResponse

    public class LocalHttpServerResponse
    extends BufferBridge
    implements FastFailHttpServerResponse
    Bridges the reponses of a LocalHttpClientRequest.
    Author:
    https://github.com/lbovet [Laurent Bovet]
    • Field Detail

      • clientResponse

        public io.vertx.core.http.HttpClientResponse clientResponse
    • Constructor Detail

      • LocalHttpServerResponse

        public LocalHttpServerResponse​(io.vertx.core.Vertx vertx)
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Specified by:
        getStatusCode in interface FastFailHttpServerResponse
        Specified by:
        getStatusCode in interface io.vertx.core.http.HttpServerResponse
      • setStatusCode

        public io.vertx.core.http.HttpServerResponse setStatusCode​(int statusCode)
        Specified by:
        setStatusCode in interface FastFailHttpServerResponse
        Specified by:
        setStatusCode in interface io.vertx.core.http.HttpServerResponse
      • setStatusMessage

        public io.vertx.core.http.HttpServerResponse setStatusMessage​(String statusMessage)
        Specified by:
        setStatusMessage in interface FastFailHttpServerResponse
        Specified by:
        setStatusMessage in interface io.vertx.core.http.HttpServerResponse
      • setChunked

        public io.vertx.core.http.HttpServerResponse setChunked​(boolean chunked)
        Specified by:
        setChunked in interface FastFailHttpServerResponse
        Specified by:
        setChunked in interface io.vertx.core.http.HttpServerResponse
      • isChunked

        public boolean isChunked()
        Specified by:
        isChunked in interface FastFailHttpServerResponse
        Specified by:
        isChunked in interface io.vertx.core.http.HttpServerResponse
      • headers

        public io.vertx.core.MultiMap headers()
        Specified by:
        headers in interface FastFailHttpServerResponse
        Specified by:
        headers in interface io.vertx.core.http.HttpServerResponse
      • putHeader

        public io.vertx.core.http.HttpServerResponse putHeader​(String name,
                                                               String value)
        Specified by:
        putHeader in interface FastFailHttpServerResponse
        Specified by:
        putHeader in interface io.vertx.core.http.HttpServerResponse
      • closeHandler

        public io.vertx.core.http.HttpServerResponse closeHandler​(io.vertx.core.Handler<Void> handler)
        Specified by:
        closeHandler in interface FastFailHttpServerResponse
        Specified by:
        closeHandler in interface io.vertx.core.http.HttpServerResponse
      • write

        public io.vertx.core.Future<Void> write​(io.vertx.core.buffer.Buffer data)
        Specified by:
        write in interface FastFailHttpServerResponse
        Specified by:
        write in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • write

        public void write​(io.vertx.core.buffer.Buffer data,
                          io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Specified by:
        write in interface FastFailHttpServerResponse
        Specified by:
        write in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • write

        public void write​(String chunk,
                          String enc,
                          io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Specified by:
        write in interface FastFailHttpServerResponse
        Specified by:
        write in interface io.vertx.core.http.HttpServerResponse
      • write

        public void write​(String chunk,
                          io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Specified by:
        write in interface FastFailHttpServerResponse
        Specified by:
        write in interface io.vertx.core.http.HttpServerResponse
      • end

        public io.vertx.core.Future<Void> end​(String chunk)
        Specified by:
        end in interface io.vertx.core.http.HttpServerResponse
      • end

        public io.vertx.core.Future<Void> end​(io.vertx.core.buffer.Buffer chunk)
        Specified by:
        end in interface io.vertx.core.http.HttpServerResponse
        Specified by:
        end in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • end

        public io.vertx.core.Future<Void> end()
        Specified by:
        end in interface io.vertx.core.http.HttpServerResponse
        Specified by:
        end in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • sendFile

        public io.vertx.core.Future<Void> sendFile​(String filename,
                                                   long offset,
                                                   long length)
        Specified by:
        sendFile in interface FastFailHttpServerResponse
        Specified by:
        sendFile in interface io.vertx.core.http.HttpServerResponse
      • close

        public void close()
        Specified by:
        close in interface FastFailHttpServerResponse
        Specified by:
        close in interface io.vertx.core.http.HttpServerResponse
      • ended

        public boolean ended()
        Specified by:
        ended in interface FastFailHttpServerResponse
        Specified by:
        ended in interface io.vertx.core.http.HttpServerResponse
      • closed

        public boolean closed()
        Specified by:
        closed in interface FastFailHttpServerResponse
        Specified by:
        closed in interface io.vertx.core.http.HttpServerResponse
      • headWritten

        public boolean headWritten()
        Specified by:
        headWritten in interface FastFailHttpServerResponse
        Specified by:
        headWritten in interface io.vertx.core.http.HttpServerResponse
      • push

        public io.vertx.core.Future<io.vertx.core.http.HttpServerResponse> push​(io.vertx.core.http.HttpMethod method,
                                                                                String host,
                                                                                String path,
                                                                                io.vertx.core.MultiMap headers)
        Specified by:
        push in interface FastFailHttpServerResponse
        Specified by:
        push in interface io.vertx.core.http.HttpServerResponse
      • addCookie

        public io.vertx.core.http.HttpServerResponse addCookie​(io.vertx.core.http.Cookie cookie)
        Specified by:
        addCookie in interface FastFailHttpServerResponse
        Specified by:
        addCookie in interface io.vertx.core.http.HttpServerResponse
      • removeCookie

        public io.vertx.core.http.Cookie removeCookie​(String name,
                                                      boolean invalidate)
        Specified by:
        removeCookie in interface FastFailHttpServerResponse
        Specified by:
        removeCookie in interface io.vertx.core.http.HttpServerResponse
      • removeCookies

        public Set<io.vertx.core.http.Cookie> removeCookies​(String name,
                                                            boolean invalidate)
        Specified by:
        removeCookies in interface FastFailHttpServerResponse
        Specified by:
        removeCookies in interface io.vertx.core.http.HttpServerResponse
      • setWriteQueueMaxSize

        public io.vertx.core.http.HttpServerResponse setWriteQueueMaxSize​(int maxSize)
        Specified by:
        setWriteQueueMaxSize in interface FastFailHttpServerResponse
        Specified by:
        setWriteQueueMaxSize in interface io.vertx.core.http.HttpServerResponse
        Specified by:
        setWriteQueueMaxSize in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • writeQueueFull

        public boolean writeQueueFull()
        Specified by:
        writeQueueFull in interface FastFailHttpServerResponse
        Specified by:
        writeQueueFull in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • exceptionHandler

        public io.vertx.core.http.HttpServerResponse exceptionHandler​(io.vertx.core.Handler<Throwable> handler)
        Specified by:
        exceptionHandler in interface FastFailHttpServerResponse
        Specified by:
        exceptionHandler in interface io.vertx.core.http.HttpServerResponse
        Specified by:
        exceptionHandler in interface io.vertx.core.streams.StreamBase
        Specified by:
        exceptionHandler in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • setHttpClientResponseHandler

        public void setHttpClientResponseHandler​(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpClientResponse>> responseHandler)