- java.lang.Object
-
- org.eclipse.jetty.client.http.ProtocolHttpUpgrader
-
- All Implemented Interfaces:
HttpUpgrader
public class ProtocolHttpUpgrader extends java.lang.Object implements HttpUpgrader
A HttpUpgrader that upgrades to a given protocol.
Works in conjunction with
HttpClientTransportDynamicso that the protocol to upgrade to must be one of the application protocols supported by HttpClientTransportDynamic.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.HttpUpgrader
HttpUpgrader.Factory
-
-
Constructor Summary
Constructors Constructor Description ProtocolHttpUpgrader(HttpDestination destination, java.lang.String protocol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprepare(HttpRequest request)Prepares the request for the upgrade, for example by setting the HTTP method or by setting HTTP headers required for the upgrade.voidupgrade(HttpResponse response, org.eclipse.jetty.io.EndPoint endPoint, org.eclipse.jetty.util.Callback callback)Upgrades the givenendPointto a different protocol.
-
-
-
Constructor Detail
-
ProtocolHttpUpgrader
public ProtocolHttpUpgrader(HttpDestination destination, java.lang.String protocol)
-
-
Method Detail
-
prepare
public void prepare(HttpRequest request)
Description copied from interface:HttpUpgraderPrepares the request for the upgrade, for example by setting the HTTP method or by setting HTTP headers required for the upgrade.
- Specified by:
preparein interfaceHttpUpgrader- Parameters:
request- the request to prepare
-
upgrade
public void upgrade(HttpResponse response, org.eclipse.jetty.io.EndPoint endPoint, org.eclipse.jetty.util.Callback callback)
Description copied from interface:HttpUpgraderUpgrades the given
endPointto 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.
- Specified by:
upgradein interfaceHttpUpgrader- Parameters:
response- the response with the information about the upgradeendPoint- the EndPoint to upgradecallback- a callback to notify of the success or failure of the upgrade
-
-