Class HttpTunnelServer.HttpConnection

java.lang.Object
org.springframework.boot.devtools.tunnel.server.HttpTunnelServer.HttpConnection
Enclosing class:
HttpTunnelServer

protected static class HttpTunnelServer.HttpConnection extends Object
Encapsulates an HTTP request/response pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpConnection(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Called when a request is complete.
    final org.springframework.http.server.ServerHttpRequest
    Return the underlying request.
    protected final org.springframework.http.server.ServerHttpResponse
    Return the underlying response.
    boolean
    Detect if the request is actually a signal to disconnect.
    boolean
    isOlderThan(int time)
    Determine if a connection is older than the specified time.
    void
    Send a payload response.
    void
    respond(org.springframework.http.HttpStatus status)
    Send an HTTP status response.
    protected org.springframework.http.server.ServerHttpAsyncRequestControl
    Start asynchronous support or if unavailable return null to cause waitForResponse() to block.
    void
    Cause the request to block or use asynchronous methods to wait until a response is available.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpConnection

      public HttpConnection(org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)
  • Method Details

    • startAsync

      protected org.springframework.http.server.ServerHttpAsyncRequestControl startAsync()
      Start asynchronous support or if unavailable return null to cause waitForResponse() to block.
      Returns:
      the async request control
    • getRequest

      public final org.springframework.http.server.ServerHttpRequest getRequest()
      Return the underlying request.
      Returns:
      the request
    • getResponse

      protected final org.springframework.http.server.ServerHttpResponse getResponse()
      Return the underlying response.
      Returns:
      the response
    • isOlderThan

      public boolean isOlderThan(int time)
      Determine if a connection is older than the specified time.
      Parameters:
      time - the time to check
      Returns:
      true if the request is older than the time
    • waitForResponse

      public void waitForResponse()
      Cause the request to block or use asynchronous methods to wait until a response is available.
    • isDisconnectRequest

      public boolean isDisconnectRequest()
      Detect if the request is actually a signal to disconnect.
      Returns:
      if the request is a signal to disconnect
    • respond

      public void respond(org.springframework.http.HttpStatus status) throws IOException
      Send an HTTP status response.
      Parameters:
      status - the status to send
      Throws:
      IOException - in case of I/O errors
    • respond

      public void respond(HttpTunnelPayload payload) throws IOException
      Send a payload response.
      Parameters:
      payload - the payload to send
      Throws:
      IOException - in case of I/O errors
    • complete

      protected void complete()
      Called when a request is complete.