Top Inners Fields Constructors Methods
jdk.internal.net.http.websocket

public Class OpeningHandshake

extends Object
Class Inheritance
Imports
java.net.http.HttpClient, .HttpClient.Version, .HttpHeaders, .HttpResponse, .HttpResponse.BodyHandlers, .WebSocketHandshakeException, jdk.internal.net.http.HttpRequestBuilderImpl, .HttpRequestImpl, jdk.internal.net.http.common.MinimalFuture, .Pair, .Utils, java.io.IOException, java.net.InetSocketAddress, .Proxy, .ProxySelector, .URI, .URISyntaxException, .URLPermission, java.nio.charset.StandardCharsets, java.security.AccessController, .MessageDigest, .NoSuchAlgorithmException, .PrivilegedAction, .SecureRandom, java.time.Duration, java.util.Base64, .Collection, .Collections, .LinkedHashSet, .List, .Optional, .Set, .TreeSet, java.util.concurrent.CompletableFuture, java.util.stream.Stream

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final HttpClient
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final Set<String>
private final String
private static final SecureRandom
private final HttpRequestImpl
private final MessageDigest
private final Collection<String>
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
private static CheckFailedException
pack-priv static void
checkPermissions(BuilderImpl b, Proxy proxy)

Performs the necessary security permissions checks to connect ( possibly through a proxy ) to the builders WebSocket URI.

private static URI
private static String
private static Collection<String>
pack-priv static URI
private OpeningHandshake.Result
private static IllegalArgumentException
illegal(String message)

private static Proxy
proxyFor(Optional<ProxySelector> selector, URI uri)

Returns the proxy for the given URI when sent through the given client, or null if none is required or applicable.

private static void
requireAbsent(HttpHeaders responseHeaders, String headerName)

private static Optional<String>
requireAtMostOne(HttpHeaders responseHeaders, String headerName)

private static String
requireSingle(HttpHeaders responseHeaders, String headerName)

private CompletableFuture<OpeningHandshake.Result>
resultFrom(HttpResponse<?> response)

public CompletableFuture<OpeningHandshake.Result>
send()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientback to summary
private final HttpClient client
HEADER_ACCEPTback to summary
private static final String HEADER_ACCEPT
HEADER_CONNECTIONback to summary
private static final String HEADER_CONNECTION
HEADER_EXTENSIONSback to summary
private static final String HEADER_EXTENSIONS
HEADER_KEYback to summary
private static final String HEADER_KEY
HEADER_PROTOCOLback to summary
private static final String HEADER_PROTOCOL
HEADER_UPGRADEback to summary
private static final String HEADER_UPGRADE
HEADER_VERSIONback to summary
private static final String HEADER_VERSION
ILLEGAL_HEADERSback to summary
private static final Set<String> ILLEGAL_HEADERS
nonceback to summary
private final String nonce
randomback to summary
private static final SecureRandom random
requestback to summary
private final HttpRequestImpl request
sha1back to summary
private final MessageDigest sha1
subprotocolsback to summary
private final Collection<String> subprotocols
VERSIONback to summary
private static final String VERSION

Constructor Detail

OpeningHandshakeback to summary
public OpeningHandshake(BuilderImpl b)

Method Detail

checkAndReturnSubprotocolback to summary
private String checkAndReturnSubprotocol(HttpHeaders responseHeaders) throws CheckFailedException
checkFailedback to summary
private static CheckFailedException checkFailed(String message)
checkPermissionsback to summary
pack-priv static void checkPermissions(BuilderImpl b, Proxy proxy)

Performs the necessary security permissions checks to connect ( possibly through a proxy ) to the builders WebSocket URI.

Exceptions
SecurityException:
if the security manager denies access
checkURIback to summary
private static URI checkURI(URI uri)
createNonceback to summary
private static String createNonce()
createRequestSubprotocolsback to summary
private static Collection<String> createRequestSubprotocols(Collection<String> subprotocols)
createRequestURIback to summary
pack-priv static URI createRequestURI(URI uri)
handleResponseback to summary
private OpeningHandshake.Result handleResponse(HttpResponse<?> response) throws IOException
illegalback to summary
private static IllegalArgumentException illegal(String message)
proxyForback to summary
private static Proxy proxyFor(Optional<ProxySelector> selector, URI uri)

Returns the proxy for the given URI when sent through the given client, or null if none is required or applicable.

requireAbsentback to summary
private static void requireAbsent(HttpHeaders responseHeaders, String headerName)
requireAtMostOneback to summary
private static Optional<String> requireAtMostOne(HttpHeaders responseHeaders, String headerName)
requireSingleback to summary
private static String requireSingle(HttpHeaders responseHeaders, String headerName)
resultFromback to summary
private CompletableFuture<OpeningHandshake.Result> resultFrom(HttpResponse<?> response)
sendback to summary
public CompletableFuture<OpeningHandshake.Result> send()
Annotations
@SuppressWarnings:removal
jdk.internal.net.http.websocket back to summary

pack-priv final Class OpeningHandshake.Result

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final TransportFactory

Constructor Summary

AccessConstructor and Description
private
Result(String subprotocol, TransportFactory transport)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

subprotocolback to summary
pack-priv final String subprotocol
transportback to summary
pack-priv final TransportFactory transport

Constructor Detail

Resultback to summary
private Result(String subprotocol, TransportFactory transport)