Interface FastFailHttpServerResponse

  • All Superinterfaces:
    io.vertx.core.http.HttpServerResponse, io.vertx.core.streams.StreamBase, io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
    All Known Implementing Classes:
    DummyHttpServerResponse, LocalHttpServerResponse

    public interface FastFailHttpServerResponse
    extends io.vertx.core.http.HttpServerResponse
    A HttpServerRequest throwing an exception no matter which method got called.

    This is useful for testing. For testing inherit from this and override the methods you need to mock.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String msg  
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default io.vertx.core.http.HttpServerResponse addCookie​(io.vertx.core.http.Cookie cookie)  
      default io.vertx.core.http.HttpServerResponse bodyEndHandler​(io.vertx.core.Handler<Void> handler)  
      default long bytesWritten()  
      default void close()  
      default boolean closed()  
      default io.vertx.core.http.HttpServerResponse closeHandler​(io.vertx.core.Handler<Void> handler)  
      default io.vertx.core.http.HttpServerResponse drainHandler​(io.vertx.core.Handler<Void> handler)  
      default void end​(io.vertx.core.buffer.Buffer buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default void end​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default void end​(String s, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default io.vertx.core.Future<Void> end​(String chunk, String enc)  
      default void end​(String s, String s1, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default boolean ended()  
      default io.vertx.core.http.HttpServerResponse endHandler​(io.vertx.core.Handler<Void> handler)  
      default io.vertx.core.http.HttpServerResponse exceptionHandler​(io.vertx.core.Handler<Throwable> handler)  
      default int getStatusCode()  
      default String getStatusMessage()  
      default io.vertx.core.MultiMap headers()  
      default io.vertx.core.http.HttpServerResponse headersEndHandler​(io.vertx.core.Handler<Void> handler)  
      default boolean headWritten()  
      default boolean isChunked()  
      default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method, String path, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)  
      default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method, String path, io.vertx.core.MultiMap headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)  
      default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method, String host, String path, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)  
      default 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)  
      default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method, String host, String path, io.vertx.core.MultiMap headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)  
      default io.vertx.core.http.HttpServerResponse putHeader​(CharSequence name, CharSequence value)  
      default io.vertx.core.http.HttpServerResponse putHeader​(CharSequence name, Iterable<CharSequence> values)  
      default io.vertx.core.http.HttpServerResponse putHeader​(String name, Iterable<String> values)  
      default io.vertx.core.http.HttpServerResponse putHeader​(String name, String value)  
      default io.vertx.core.http.HttpServerResponse putTrailer​(CharSequence name, CharSequence value)  
      default io.vertx.core.http.HttpServerResponse putTrailer​(CharSequence name, Iterable<CharSequence> value)  
      default io.vertx.core.http.HttpServerResponse putTrailer​(String name, Iterable<String> values)  
      default io.vertx.core.http.HttpServerResponse putTrailer​(String name, String value)  
      default io.vertx.core.http.Cookie removeCookie​(String name, boolean invalidate)  
      default io.vertx.core.http.Cookie removeCookie​(String name, String domain, String path, boolean invalidate)  
      default Set<io.vertx.core.http.Cookie> removeCookies​(String name, boolean invalidate)  
      default boolean reset​(long code)  
      default io.vertx.core.Future<Void> sendFile​(String filename, long offset, long length)  
      default io.vertx.core.http.HttpServerResponse sendFile​(String filename, long offset, long length, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)  
      default io.vertx.core.http.HttpServerResponse setChunked​(boolean chunked)  
      default io.vertx.core.http.HttpServerResponse setStatusCode​(int statusCode)  
      default io.vertx.core.http.HttpServerResponse setStatusMessage​(String statusMessage)  
      default io.vertx.core.http.HttpServerResponse setWriteQueueMaxSize​(int maxSize)  
      default int streamId()  
      default io.vertx.core.MultiMap trailers()  
      default io.vertx.core.Future<Void> write​(io.vertx.core.buffer.Buffer data)  
      default void write​(io.vertx.core.buffer.Buffer data, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default io.vertx.core.Future<Void> write​(String chunk)  
      default void write​(String chunk, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default io.vertx.core.Future<Void> write​(String chunk, String enc)  
      default void write​(String chunk, String enc, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)  
      default io.vertx.core.http.HttpServerResponse writeContinue()  
      default io.vertx.core.http.HttpServerResponse writeCustomFrame​(int type, int flags, io.vertx.core.buffer.Buffer payload)  
      default boolean writeQueueFull()  
      • Methods inherited from interface io.vertx.core.http.HttpServerResponse

        end, end, end, push, push, push, removeCookie, removeCookie, removeCookies, reset, send, send, send, send, send, send, send, send, sendFile, sendFile, sendFile, sendFile, setStreamPriority, writeCustomFrame
    • Method Detail

      • exceptionHandler

        default io.vertx.core.http.HttpServerResponse exceptionHandler​(io.vertx.core.Handler<Throwable> handler)
        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>
      • setWriteQueueMaxSize

        default io.vertx.core.http.HttpServerResponse setWriteQueueMaxSize​(int maxSize)
        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

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

        default io.vertx.core.http.HttpServerResponse drainHandler​(io.vertx.core.Handler<Void> handler)
        Specified by:
        drainHandler in interface io.vertx.core.http.HttpServerResponse
        Specified by:
        drainHandler in interface io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
      • getStatusCode

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

        default io.vertx.core.http.HttpServerResponse setStatusCode​(int statusCode)
        Specified by:
        setStatusCode in interface io.vertx.core.http.HttpServerResponse
      • getStatusMessage

        default String getStatusMessage()
        Specified by:
        getStatusMessage in interface io.vertx.core.http.HttpServerResponse
      • setStatusMessage

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

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

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

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

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

        default io.vertx.core.http.HttpServerResponse putHeader​(CharSequence name,
                                                                CharSequence value)
        Specified by:
        putHeader in interface io.vertx.core.http.HttpServerResponse
      • putHeader

        default io.vertx.core.http.HttpServerResponse putHeader​(String name,
                                                                Iterable<String> values)
        Specified by:
        putHeader in interface io.vertx.core.http.HttpServerResponse
      • putHeader

        default io.vertx.core.http.HttpServerResponse putHeader​(CharSequence name,
                                                                Iterable<CharSequence> values)
        Specified by:
        putHeader in interface io.vertx.core.http.HttpServerResponse
      • trailers

        default io.vertx.core.MultiMap trailers()
        Specified by:
        trailers in interface io.vertx.core.http.HttpServerResponse
      • putTrailer

        default io.vertx.core.http.HttpServerResponse putTrailer​(String name,
                                                                 String value)
        Specified by:
        putTrailer in interface io.vertx.core.http.HttpServerResponse
      • putTrailer

        default io.vertx.core.http.HttpServerResponse putTrailer​(CharSequence name,
                                                                 CharSequence value)
        Specified by:
        putTrailer in interface io.vertx.core.http.HttpServerResponse
      • putTrailer

        default io.vertx.core.http.HttpServerResponse putTrailer​(String name,
                                                                 Iterable<String> values)
        Specified by:
        putTrailer in interface io.vertx.core.http.HttpServerResponse
      • putTrailer

        default io.vertx.core.http.HttpServerResponse putTrailer​(CharSequence name,
                                                                 Iterable<CharSequence> value)
        Specified by:
        putTrailer in interface io.vertx.core.http.HttpServerResponse
      • closeHandler

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

        default io.vertx.core.http.HttpServerResponse endHandler​(io.vertx.core.Handler<Void> handler)
        Specified by:
        endHandler in interface io.vertx.core.http.HttpServerResponse
      • writeContinue

        default io.vertx.core.http.HttpServerResponse writeContinue()
        Specified by:
        writeContinue in interface io.vertx.core.http.HttpServerResponse
      • sendFile

        default io.vertx.core.http.HttpServerResponse sendFile​(String filename,
                                                               long offset,
                                                               long length,
                                                               io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
        Specified by:
        sendFile in interface io.vertx.core.http.HttpServerResponse
      • close

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

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

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

        default boolean headWritten()
        Specified by:
        headWritten in interface io.vertx.core.http.HttpServerResponse
      • headersEndHandler

        default io.vertx.core.http.HttpServerResponse headersEndHandler​(io.vertx.core.Handler<Void> handler)
        Specified by:
        headersEndHandler in interface io.vertx.core.http.HttpServerResponse
      • bodyEndHandler

        default io.vertx.core.http.HttpServerResponse bodyEndHandler​(io.vertx.core.Handler<Void> handler)
        Specified by:
        bodyEndHandler in interface io.vertx.core.http.HttpServerResponse
      • bytesWritten

        default long bytesWritten()
        Specified by:
        bytesWritten in interface io.vertx.core.http.HttpServerResponse
      • streamId

        default int streamId()
        Specified by:
        streamId in interface io.vertx.core.http.HttpServerResponse
      • push

        default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method,
                                                           String host,
                                                           String path,
                                                           io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)
        Specified by:
        push in interface io.vertx.core.http.HttpServerResponse
      • push

        default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method,
                                                           String path,
                                                           io.vertx.core.MultiMap headers,
                                                           io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)
        Specified by:
        push in interface io.vertx.core.http.HttpServerResponse
      • push

        default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method,
                                                           String path,
                                                           io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)
        Specified by:
        push in interface io.vertx.core.http.HttpServerResponse
      • push

        default io.vertx.core.http.HttpServerResponse push​(io.vertx.core.http.HttpMethod method,
                                                           String host,
                                                           String path,
                                                           io.vertx.core.MultiMap headers,
                                                           io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.http.HttpServerResponse>> handler)
        Specified by:
        push in interface io.vertx.core.http.HttpServerResponse
      • reset

        default boolean reset​(long code)
        Specified by:
        reset in interface io.vertx.core.http.HttpServerResponse
      • writeCustomFrame

        default io.vertx.core.http.HttpServerResponse writeCustomFrame​(int type,
                                                                       int flags,
                                                                       io.vertx.core.buffer.Buffer payload)
        Specified by:
        writeCustomFrame in interface io.vertx.core.http.HttpServerResponse
      • end

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

        default void end​(String s,
                         String s1,
                         io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Specified by:
        end in interface io.vertx.core.http.HttpServerResponse
      • end

        default void end​(io.vertx.core.buffer.Buffer buffer,
                         io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        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

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

        default io.vertx.core.Future<Void> write​(String chunk,
                                                 String enc)
        Specified by:
        write in interface io.vertx.core.http.HttpServerResponse
      • write

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

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

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

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

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

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

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

        default 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 io.vertx.core.http.HttpServerResponse
      • addCookie

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

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

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

        default io.vertx.core.http.Cookie removeCookie​(String name,
                                                       String domain,
                                                       String path,
                                                       boolean invalidate)
        Specified by:
        removeCookie in interface io.vertx.core.http.HttpServerResponse