Top Description Fields Constructors Methods
org.eclipse.jetty.client.transport.internal

public Class ProtocolHttpUpgrader

extends Object
implements HttpUpgrader
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.client.HttpUpgrader
Imports
java.util.HashMap, .List, .Map, org.eclipse.jetty.client.Destination, .HttpClient, .HttpClientTransport, .HttpResponseException, .HttpUpgrader, .Origin, .Request, .Response, org.eclipse.jetty.client.transport.HttpClientTransportDynamic, .HttpDestination, .HttpResponse, org.eclipse.jetty.http.HttpHeader, org.eclipse.jetty.io.EndPoint, org.eclipse.jetty.util.Callback, .Promise, org.slf4j.Logger, .LoggerFactory

A HttpUpgrader that upgrades to a given protocol.

Works in conjunction with HttpClientTransportDynamic so that the protocol to upgrade to must be one of the application protocols supported by HttpClientTransportDynamic.

Field Summary

Modifier and TypeField and Description
private final HttpDestination
private static final Logger
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
prepare(Request
the request to prepare
request
)

Implements org.eclipse.jetty.client.HttpUpgrader.prepare.

Prepares the request for the upgrade, for example by setting the HTTP method or by setting HTTP headers required for the upgrade.

public void
upgrade(Response
the response with the information about the upgrade
response
,
EndPoint
the EndPoint to upgrade
endPoint
,
Callback
a callback to notify of the success or failure of the upgrade
callback
)

Implements org.eclipse.jetty.client.HttpUpgrader.upgrade.

Upgrades the given endPoint to a different protocol.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

destinationback to summary
private final HttpDestination destination
LOGback to summary
private static final Logger LOG
protocolback to summary
private final String protocol

Constructor Detail

ProtocolHttpUpgraderback to summary
public ProtocolHttpUpgrader(HttpDestination destination, String protocol)

Method Detail

prepareback to summary
public void prepare(Request request)

Implements org.eclipse.jetty.client.HttpUpgrader.prepare.

Doc from org.eclipse.jetty.client.HttpUpgrader.prepare.

Prepares the request for the upgrade, for example by setting the HTTP method or by setting HTTP headers required for the upgrade.

Parameters
request:Request

the request to prepare

Annotations
@Override
upgradeback to summary
public void upgrade(Response response, EndPoint endPoint, Callback callback)

Implements org.eclipse.jetty.client.HttpUpgrader.upgrade.

Doc from org.eclipse.jetty.client.HttpUpgrader.upgrade.

Upgrades the given endPoint to a different protocol.

The success or failure of the upgrade should be communicated via the given callback.

An exception thrown by this method is equivalent to failing the callback.

Parameters
response:Response

the response with the information about the upgrade

endPoint:EndPoint

the EndPoint to upgrade

callback:Callback

a callback to notify of the success or failure of the upgrade

Annotations
@Override