HttpUpgrader prepares a HTTP request to upgrade from one protocol to another, and implements the upgrade mechanism.
The upgrade mechanism can be the HTTP/1.1 upgrade mechanism or the HTTP/2 extended CONNECT mechanism.
Given the differences among mechanism implementations, a request needs to be prepared before being sent to comply with the mechanism requirements (for example, add required headers, etc.).
| Modifier and Type | Class and Description |
|---|---|
| public static interface | HttpUpgrader.
A factory for |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | PROTOCOL_ATTRIBUTE
The request attribute key for the upgrade protocol, used by the HTTP/2 extended CONNECT mechanism. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| PROTOCOL_ATTRIBUTE | back to summary |
|---|---|
| public static final String PROTOCOL_ATTRIBUTE The request attribute key for the upgrade protocol, used by the HTTP/2 extended CONNECT mechanism. | |
| prepare | back to summary |
|---|---|
| public void prepare(Request request) Prepares the request for the upgrade, for example by setting the HTTP method or by setting HTTP headers required for the upgrade.
| |
| upgrade | back to summary |
|---|---|
| public void upgrade(Response response, EndPoint endPoint, Callback callback) Upgrades the given The success or failure of the upgrade should be communicated via the given An exception thrown by this method is equivalent to failing the callback. | |
A factory for HttpUpgraders.
A Request subclass should implement this interface
if it wants to create a specific HttpUpgrader.
| Modifier and Type | Method and Description |
|---|---|
| public HttpUpgrader |
| newHttpUpgrader | back to summary |
|---|---|
| public HttpUpgrader newHttpUpgrader(HttpVersion version) | |