Class UpgradeResponse

java.lang.Object
io.helidon.webclient.http1.UpgradeResponse

public final class UpgradeResponse extends Object
Response to an upgrade attempt.
  • Method Details

    • success

      public static UpgradeResponse success(HttpClientResponse response, ClientConnection connection)
      Create an upgrade success response.
      Parameters:
      response - the HTTP/1.1 response that was returned (successful upgrade)
      connection - client connection, now upgraded to the requested protocol on server side
      Returns:
      upgrade response that was successful
    • failure

      public static UpgradeResponse failure(HttpClientResponse response)
      Create an upgrade failure response.
      Parameters:
      response - the HTTP/1.1 client response that was returned instead of upgrading the connection
      Returns:
      upgrade response that failed to upgrade
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isUpgraded

      public boolean isUpgraded()
      Whether upgrade succeeded or not.
      Returns:
      whether we upgraded the connection
    • connection

      public ClientConnection connection()
      Upgraded connection. Only available on successful upgrade, will throw an exception otherwise.
      Returns:
      connection
      Throws:
      NoSuchElementException - in case the upgrade failed
      See Also:
    • response

      public HttpClientResponse response()
      The HTTP response we got from the server, always present.
      Returns:
      response as received by the HTTP/1 client