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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCoreClientUpgradeRequest(WebSocketCoreClient webSocketClient, URI requestURI) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtensions(String... configs) voidaddExtensions(ExtensionConfig... configs) voidaddListener(UpgradeListener listener) protected voidAllow for overridden customization of endpoint (such as special transport level properties: e.g.static CoreClientUpgradeRequestfrom(WebSocketCoreClient webSocketClient, URI requestURI, FrameHandler frameHandler) abstract FrameHandlerprotected voidhandleException(Throwable failure) newHttpUpgrader(HttpVersion version) voidonComplete(Result result) Callback method invoked when the request and the response have been processed, either successfully or not.voidvoidsend(Response.CompleteListener listener) Sends this request and asynchronously notifies the given listener for response events.voidvoidsetExtensions(List<ExtensionConfig> configs) voidsetSubProtocols(String... protocols) voidsetSubProtocols(List<String> protocols) voidupgrade(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:RequestSends 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.CompleteListenerbut 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:
sendin interfaceRequest- Overrides:
sendin classHttpRequest- Parameters:
listener- the listener that receives response events
-
sendAsync
-
onComplete
Description copied from interface:Response.CompleteListenerCallback method invoked when the request and the response have been processed, either successfully or not.The
resultparameter 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:
onCompletein interfaceResponse.CompleteListener- Parameters:
result- the result of the request / response exchange
-
handleException
-
newHttpUpgrader
- Specified by:
newHttpUpgraderin 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
-