Top Description Inners Fields Constructors Methods
io.undertow.server.handlers.proxy

public Class SimpleProxyClientProvider

extends Object
implements ProxyClient
Class Inheritance
All Implemented Interfaces
io.undertow.server.handlers.proxy.ProxyClient
Annotations
@Deprecated
Imports
io.undertow.client.ClientCallback, .ClientConnection, .UndertowClient, io.undertow.server.HttpServerExchange, .ServerConnection, io.undertow.util.AttachmentKey, org.xnio.ChannelListener, .IoUtils, .OptionMap, java.io.IOException, java.net.URI, java.nio.channels.Channel, java.util.concurrent.TimeUnit

Deprecated

Simple proxy client provider. This provider simply proxies to another server, using a a one to one connection strategy. LoadBalancingProxyClient should be used instead. This proxy client is too simplistic for real world use cases, and it not set up to use SSL.
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final UndertowClient
private final AttachmentKey<ClientConnection>
private static final ProxyClient.ProxyTarget
private final URI

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ProxyClient.ProxyTarget
findTarget(HttpServerExchange
The exchange
exchange
)

Implements io.undertow.server.handlers.proxy.ProxyClient.findTarget.

Finds a proxy target for this request, returning null if none can be found.

public void
getConnection(ProxyClient.ProxyTarget target, HttpServerExchange
The exchange
exchange
,
ProxyCallback<ProxyConnection>
The callback
callback
,
long
The timeout
timeout
,
TimeUnit
Time unit for the timeout
timeUnit
)

Implements io.undertow.server.handlers.proxy.ProxyClient.getConnection.

Gets a proxy connection for the given request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientback to summary
private final UndertowClient client
clientAttachmentKeyback to summary
private final AttachmentKey<ClientConnection> clientAttachmentKey
TARGETback to summary
private static final ProxyClient.ProxyTarget TARGET
uriback to summary
private final URI uri

Constructor Detail

SimpleProxyClientProviderback to summary
public SimpleProxyClientProvider(URI uri)

Method Detail

findTargetback to summary
public ProxyClient.ProxyTarget findTarget(HttpServerExchange exchange)

Implements io.undertow.server.handlers.proxy.ProxyClient.findTarget.

Doc from io.undertow.server.handlers.proxy.ProxyClient.findTarget.

Finds a proxy target for this request, returning null if none can be found. If this method returns null it means that there is no backend available to handle this request, and it should proceed as normal.

Parameters
exchange:HttpServerExchange

The exchange

Returns:ProxyClient.ProxyTarget

The proxy target

Annotations
@Override
getConnectionback to summary
public void getConnection(ProxyClient.ProxyTarget target, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit)

Implements io.undertow.server.handlers.proxy.ProxyClient.getConnection.

Doc from io.undertow.server.handlers.proxy.ProxyClient.getConnection.

Gets a proxy connection for the given request.

Parameters
exchange:HttpServerExchange

The exchange

callback:ProxyCallback<ProxyConnection>

The callback

timeout:long

The timeout

timeUnit:TimeUnit

Time unit for the timeout

Annotations
@Override
io.undertow.server.handlers.proxy back to summary

private final Class SimpleProxyClientProvider.ConnectNotifier

extends Object
implements ClientCallback<ClientConnection>
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.SimpleProxyClientProvider.ConnectNotifier
All Implemented Interfaces
io.undertow.client.ClientCallback

Field Summary

Modifier and TypeField and Description
private final ProxyCallback<ProxyConnection>
private final HttpServerExchange

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
completed(final ClientConnection
the operation result
connection
)

Implements io.undertow.client.ClientCallback.completed.

Invoked when an operation completed.

public void
failed(IOException
the exception
e
)

Implements io.undertow.client.ClientCallback.failed.

Invoked when the operation failed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private final ProxyCallback<ProxyConnection> callback
exchangeback to summary
private final HttpServerExchange exchange

Constructor Detail

ConnectNotifierback to summary
private ConnectNotifier(ProxyCallback<ProxyConnection> callback, HttpServerExchange exchange)

Method Detail

completedback to summary
public void completed(final ClientConnection connection)

Implements io.undertow.client.ClientCallback.completed.

Doc from io.undertow.client.ClientCallback.completed.

Invoked when an operation completed.

Parameters
connection:ClientConnection

the operation result

Annotations
@Override
failedback to summary
public void failed(IOException e)

Implements io.undertow.client.ClientCallback.failed.

Doc from io.undertow.client.ClientCallback.failed.

Invoked when the operation failed.

Parameters
e:IOException

the exception

Annotations
@Override