Top Description Inners Fields Constructors Methods
io.undertow.websockets.client

public Class WebSocketClient

extends Object
Class Inheritance
Imports
io.undertow.UndertowMessages, io.undertow.client.ClientCallback, .ClientConnection, .ClientExchange, .ClientRequest, .UndertowClient, io.undertow.protocols.ssl.UndertowXnioSsl, io.undertow.util.Headers, .Methods, .Protocols, io.undertow.websockets.core.WebSocketChannel, .WebSocketLogger, .WebSocketVersion, io.undertow.websockets.extensions.ExtensionHandshake, org.xnio.Cancellable, .ChannelListener, .FutureResult, .IoFuture, .OptionMap, .StreamConnection, .XnioWorker, io.undertow.connector.ByteBufferPool, org.xnio.http.HttpUpgrade, .RedirectException, org.xnio.ssl.XnioSsl, java.io.IOException, java.net.InetSocketAddress, .URI, .URISyntaxException, java.util.ArrayList, .HashMap, .List, .Map, .Set

The Web socket client.
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final String
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version)
Deprecated

public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version)
Deprecated

public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation)
Deprecated

public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation)
Deprecated

public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation, Set<ExtensionHandshake> clientExtensions)
Deprecated

public static IoFuture<WebSocketChannel>
connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, InetSocketAddress bindAddress, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation, Set<ExtensionHandshake> clientExtensions)
Deprecated

public static WebSocketClient.ConnectionBuilder

Returns:

The connection builder
connectionBuilder
(XnioWorker
The XnioWorker to use for the connection
worker
,
ByteBufferPool
The buffer pool
bufferPool
,
URI
The connection URI
uri
)

Creates a new connection builder that can be used to create a web socket connection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BIND_PROPERTYback to summary
public static final String BIND_PROPERTY
MAX_REDIRECTSback to summary
private static final int MAX_REDIRECTS

Constructor Detail

WebSocketClientback to summary
private WebSocketClient()

Method Detail

connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version)

Deprecated

Annotations
@Deprecated
connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version)

Deprecated

Annotations
@Deprecated
connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation)

Deprecated

Annotations
@Deprecated
connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation)

Deprecated

Annotations
@Deprecated
connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation, Set<ExtensionHandshake> clientExtensions)

Deprecated

Annotations
@Deprecated
connectback to summary
public static IoFuture<WebSocketChannel> connect(XnioWorker worker, XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap optionMap, InetSocketAddress bindAddress, final URI uri, WebSocketVersion version, WebSocketClientNegotiation clientNegotiation, Set<ExtensionHandshake> clientExtensions)

Deprecated

Annotations
@Deprecated
connectionBuilderback to summary
public static WebSocketClient.ConnectionBuilder connectionBuilder(XnioWorker worker, ByteBufferPool bufferPool, URI uri)

Creates a new connection builder that can be used to create a web socket connection.

Parameters
worker:XnioWorker

The XnioWorker to use for the connection

bufferPool:ByteBufferPool

The buffer pool

uri:URI

The connection URI

Returns:WebSocketClient.ConnectionBuilder

The connection builder

io.undertow.websockets.client back to summary

public Class WebSocketClient.ConnectionBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.websockets.client.WebSocketClient.ConnectionBuilder

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private InetSocketAddress
private final ByteBufferPool
private Set<ExtensionHandshake>
private WebSocketClientNegotiation
private OptionMap
private XnioSsl
private URI
private XnioSsl
private final URI
private WebSocketVersion
private final XnioWorker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public IoFuture<WebSocketChannel>
private IoFuture<WebSocketChannel>
connectImpl(final URI uri, final FutureResult<WebSocketChannel> ioFuture, final int redirectCount)

public InetSocketAddress
public ByteBufferPool
public Set<ExtensionHandshake>
public WebSocketClientNegotiation
public OptionMap
public XnioSsl
public URI
public XnioSsl
public URI
public WebSocketVersion
public XnioWorker
private boolean
isSecure(final URI uri)

public WebSocketClient.ConnectionBuilder
public WebSocketClient.ConnectionBuilder
public WebSocketClient.ConnectionBuilder
public WebSocketClient.ConnectionBuilder
public WebSocketClient.ConnectionBuilder
setProxySsl(XnioSsl proxySsl)

public WebSocketClient.ConnectionBuilder
setProxyUri(URI proxyUri)

public WebSocketClient.ConnectionBuilder
public WebSocketClient.ConnectionBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindAddressback to summary
private InetSocketAddress bindAddress
bufferPoolback to summary
private final ByteBufferPool bufferPool
clientExtensionsback to summary
private Set<ExtensionHandshake> clientExtensions
clientNegotiationback to summary
private WebSocketClientNegotiation clientNegotiation
optionMapback to summary
private OptionMap optionMap
proxySslback to summary
private XnioSsl proxySsl
proxyUriback to summary
private URI proxyUri
sslback to summary
private XnioSsl ssl
uriback to summary
private final URI uri
versionback to summary
private WebSocketVersion version
workerback to summary
private final XnioWorker worker

Constructor Detail

ConnectionBuilderback to summary
public ConnectionBuilder(XnioWorker worker, ByteBufferPool bufferPool, URI uri)

Method Detail

connectback to summary
public IoFuture<WebSocketChannel> connect()
connectImplback to summary
private IoFuture<WebSocketChannel> connectImpl(final URI uri, final FutureResult<WebSocketChannel> ioFuture, final int redirectCount)
getBindAddressback to summary
public InetSocketAddress getBindAddress()
getBufferPoolback to summary
public ByteBufferPool getBufferPool()
getClientExtensionsback to summary
public Set<ExtensionHandshake> getClientExtensions()
getClientNegotiationback to summary
public WebSocketClientNegotiation getClientNegotiation()
getOptionMapback to summary
public OptionMap getOptionMap()
getProxySslback to summary
public XnioSsl getProxySsl()
getProxyUriback to summary
public URI getProxyUri()
getSslback to summary
public XnioSsl getSsl()
getUriback to summary
public URI getUri()
getVersionback to summary
public WebSocketVersion getVersion()
getWorkerback to summary
public XnioWorker getWorker()
isSecureback to summary
private boolean isSecure(final URI uri)
setBindAddressback to summary
public WebSocketClient.ConnectionBuilder setBindAddress(InetSocketAddress bindAddress)
setClientExtensionsback to summary
public WebSocketClient.ConnectionBuilder setClientExtensions(Set<ExtensionHandshake> clientExtensions)
setClientNegotiationback to summary
public WebSocketClient.ConnectionBuilder setClientNegotiation(WebSocketClientNegotiation clientNegotiation)
setOptionMapback to summary
public WebSocketClient.ConnectionBuilder setOptionMap(OptionMap optionMap)
setProxySslback to summary
public WebSocketClient.ConnectionBuilder setProxySsl(XnioSsl proxySsl)
setProxyUriback to summary
public WebSocketClient.ConnectionBuilder setProxyUri(URI proxyUri)
setSslback to summary
public WebSocketClient.ConnectionBuilder setSsl(XnioSsl ssl)
setVersionback to summary
public WebSocketClient.ConnectionBuilder setVersion(WebSocketVersion version)
io.undertow.websockets.client back to summary

private Class WebSocketClient.ConnectionBuilder.WebsocketConnectionListener

extends Object
implements ChannelListener<StreamConnection>
Class Inheritance
  • java.lang.Object
  • io.undertow.websockets.client.WebSocketClient.ConnectionBuilder.WebsocketConnectionListener
All Implemented Interfaces
org.xnio.ChannelListener, java.util.EventListener

Field Summary

Modifier and TypeField and Description
private final WebSocketClientHandshake
private final FutureResult<WebSocketChannel>
private final URI
private final OptionMap

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
handleEvent(StreamConnection
the channel event
channel
)

Implements org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handshakeback to summary
private final WebSocketClientHandshake handshake
ioFutureback to summary
private final FutureResult<WebSocketChannel> ioFuture
newUriback to summary
private final URI newUri
optionsback to summary
private final OptionMap options

Constructor Detail

WebsocketConnectionListenerback to summary
pack-priv WebsocketConnectionListener(OptionMap options, WebSocketClientHandshake handshake, URI newUri, FutureResult<WebSocketChannel> ioFuture)

Method Detail

handleEventback to summary
public void handleEvent(StreamConnection channel)

Implements org.xnio.ChannelListener.handleEvent.

Doc from org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Parameters
channel:StreamConnection

the channel event

Annotations
@Override