Class CoreClientUpgradeRequest
- All Implemented Interfaces:
EventListener
,Request
,Response.CompleteListener
,Response.ResponseListener
,HttpUpgrader.Factory
- Direct Known Subclasses:
JavaxClientUpgradeRequest
,JettyClientUpgradeRequest
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.api.Request
Request.BeginListener, Request.CommitListener, Request.Content, Request.ContentListener, Request.FailureListener, Request.HeadersListener, Request.Listener, Request.QueuedListener, Request.RequestListener, Request.SuccessListener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCoreClientUpgradeRequest
(WebSocketCoreClient webSocketClient, URI requestURI) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtensions
(String... configs) void
addExtensions
(ExtensionConfig... configs) void
addListener
(UpgradeListener listener) protected void
Allow for overridden customization of endpoint (such as special transport level properties: e.g.static CoreClientUpgradeRequest
from
(WebSocketCoreClient webSocketClient, URI requestURI, FrameHandler frameHandler) abstract FrameHandler
protected void
handleException
(Throwable failure) newHttpUpgrader
(HttpVersion version) void
onComplete
(Result result) Callback method invoked when the request and the response have been processed, either successfully or not.void
void
send
(Response.CompleteListener listener) Sends this request and asynchronously notifies the given listener for response events.void
void
setExtensions
(List<ExtensionConfig> configs) void
setSubProtocols
(String... protocols) void
setSubProtocols
(List<String> protocols) void
upgrade
(HttpResponse response, EndPoint endPoint) Methods inherited from class org.eclipse.jetty.client.HttpRequest
abort, accept, addHeader, agent, attribute, body, content, content, cookie, file, file, followRedirects, getAbortCause, getAgent, getAttributes, getBody, getConnection, getContent, getConversation, getCookies, getHeaders, getHost, getIdleTimeout, getMethod, getParams, getPath, getPort, getPushListener, getQuery, getRequestListeners, getResponseListeners, getScheme, getTag, getTimeout, getTrailers, getUpgradeProtocol, getURI, getVersion, header, header, headers, host, idleTimeout, isFollowRedirects, isVersionExplicit, listener, method, method, onComplete, onRequestBegin, onRequestCommit, onRequestContent, onRequestFailure, onRequestHeaders, onRequestQueued, onRequestSuccess, onResponseBegin, onResponseContent, onResponseContentAsync, onResponseContentDemanded, onResponseFailure, onResponseHeader, onResponseHeaders, onResponseSuccess, param, path, port, pushListener, scheme, send, tag, timeout, toString, trailers, upgradeProtocol, version
-
Field Details
-
futureCoreSession
-
-
Constructor Details
-
CoreClientUpgradeRequest
-
-
Method Details
-
from
public static CoreClientUpgradeRequest from(WebSocketCoreClient webSocketClient, URI requestURI, FrameHandler frameHandler) -
setConfiguration
-
addListener
-
addExtensions
-
addExtensions
-
getExtensions
-
setExtensions
-
getSubProtocols
-
setSubProtocols
-
setSubProtocols
-
send
Description copied from interface:Request
Sends this request and asynchronously notifies the given listener for response events.
This method should be used when the application needs to be notified of the various response events as they happen, or when the application needs to efficiently manage the response content.
The listener passed to this method may implement not only
Response.CompleteListener
but also other response listener interfaces, and all the events implemented will be notified. This allows application code to write a single listener class to handle all relevant events.- Specified by:
send
in interfaceRequest
- Overrides:
send
in classHttpRequest
- Parameters:
listener
- the listener that receives response events
-
sendAsync
-
onComplete
Description copied from interface:Response.CompleteListener
Callback method invoked when the request and the response have been processed, either successfully or not.The
result
parameter contains the request, the response, and eventual failures.Requests may complete after response, for example in case of big uploads that are discarded or read asynchronously by the server. This method is always invoked after
Response.SuccessListener.onSuccess(Response)
orResponse.FailureListener.onFailure(Response, Throwable)
, and only when request indicates that it is completed.- Specified by:
onComplete
in interfaceResponse.CompleteListener
- Parameters:
result
- the result of the request / response exchange
-
handleException
-
newHttpUpgrader
- Specified by:
newHttpUpgrader
in interfaceHttpUpgrader.Factory
-
customize
Allow for overridden customization of endpoint (such as special transport level properties: e.g. TCP keepAlive) -
getFrameHandler
-
requestComplete
public void requestComplete() -
upgrade
-