Top Description Fields Constructors Methods
io.vertx.core.net.impl

public final Class ChannelProvider

extends Object
Class Inheritance
Imports
io.netty.bootstrap.Bootstrap, io.netty.channel.*, io.netty.handler.proxy.*, io.netty.handler.ssl.SslHandler, .SslHandshakeCompletionEvent, io.netty.resolver.NoopAddressResolverGroup, io.netty.util.concurrent.Future, .Promise, io.vertx.core.Handler, io.vertx.core.impl.ContextInternal, .VertxInternal, io.vertx.core.net.ProxyOptions, .ProxyType, .SocketAddress, javax.net.ssl.SSLHandshakeException, java.net.InetAddress, .InetSocketAddress

The logic for connecting to an host, this implementations performs a connection to the host after resolving its internet address. See if we can replace that by a Netty handler sometimes.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private String
private final Bootstrap
private final ContextInternal
private Handler<Channel>
private ProxyOptions
private final SslChannelProvider

Constructor Summary

AccessConstructor and Description
public
ChannelProvider(Bootstrap bootstrap, SslChannelProvider sslContextProvider, ContextInternal context)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the application protocol resulting from the ALPN negotiation
applicationProtocol
()

public Future<Channel>
connect(SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn)

private void
connect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> p)

private void
connected(Handler<Channel> handler, Channel
the channel
channel
,
boolean ssl, Promise<Channel>
the channel handler
channelHandler
)

Signal we are connected to the remote server.

private void
handleConnect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> channelHandler)

private void
handleProxyConnect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> channelHandler)

A channel provider that connects via a Proxy : HTTP or SOCKS

public ChannelProvider

Returns:

fluently this
handler
(Handler<Channel>
the channel handler
handler
)

Set a handler called when the channel has been established.

private void
initSSL(Handler<Channel> handler, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Channel ch, Promise<Channel> channelHandler)

public ChannelProvider

Returns:

fluently this
proxyOptions
(ProxyOptions
the proxy options to use
proxyOptions
)

Set the proxy options to use.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

applicationProtocolback to summary
private String applicationProtocol
bootstrapback to summary
private final Bootstrap bootstrap
contextback to summary
private final ContextInternal context
handlerback to summary
private Handler<Channel> handler
proxyOptionsback to summary
private ProxyOptions proxyOptions
sslContextProviderback to summary
private final SslChannelProvider sslContextProvider

Constructor Detail

ChannelProviderback to summary
public ChannelProvider(Bootstrap bootstrap, SslChannelProvider sslContextProvider, ContextInternal context)

Method Detail

applicationProtocolback to summary
public String applicationProtocol()
Returns:String

the application protocol resulting from the ALPN negotiation

connectback to summary
public Future<Channel> connect(SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn)
connectback to summary
private void connect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> p)
connectedback to summary
private void connected(Handler<Channel> handler, Channel channel, boolean ssl, Promise<Channel> channelHandler)

Signal we are connected to the remote server.

Parameters
channel:Channel

the channel

channelHandler:Promise<Channel>

the channel handler

handleConnectback to summary
private void handleConnect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> channelHandler)
handleProxyConnectback to summary
private void handleProxyConnect(Handler<Channel> handler, SocketAddress remoteAddress, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Promise<Channel> channelHandler)

A channel provider that connects via a Proxy : HTTP or SOCKS

handlerback to summary
public ChannelProvider handler(Handler<Channel> handler)

Set a handler called when the channel has been established.

Parameters
handler:Handler<Channel>

the channel handler

Returns:ChannelProvider

fluently this

initSSLback to summary
private void initSSL(Handler<Channel> handler, SocketAddress peerAddress, String serverName, boolean ssl, boolean useAlpn, Channel ch, Promise<Channel> channelHandler)
proxyOptionsback to summary
public ChannelProvider proxyOptions(ProxyOptions proxyOptions)

Set the proxy options to use.

Parameters
proxyOptions:ProxyOptions

the proxy options to use

Returns:ChannelProvider

fluently this