@Deprecated public abstract class ClientConnectionHelper extends ConnectionHelper<Client>
| Parameter name | Value type | Default value | Description |
|---|---|---|---|
| proxyHost | String | System property "http.proxyHost" | The host name of the HTTP proxy. |
| proxyPort | int | System property "http.proxyPort" | The port of the HTTP proxy. |
| socketConnectTimeoutMs | int | 0 | The socket connection timeout or 0 for unlimited wait. |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CONNECTOR_LATCH
Deprecated.
|
clientSide, controller, inboundMessages, outboundMessages| Constructor and Description |
|---|
ClientConnectionHelper(Client connector)
Deprecated.
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.restlet.ext.nio.internal.connection.Connection<Client> |
createConnection(java.nio.channels.SocketChannel socketChannel,
org.restlet.ext.nio.internal.controller.ConnectionController controller,
java.net.InetSocketAddress socketAddress)
Deprecated.
Creates a connection associated to the given socket.
|
protected org.restlet.ext.nio.internal.controller.ConnectionController |
createController()
Deprecated.
Creates a new controller.
|
protected java.nio.channels.SocketChannel |
createSocketChannel(boolean secure,
java.net.InetSocketAddress socketAddress)
Deprecated.
Creates the socket that will be used to send the request and get the
response.
|
protected java.nio.channels.SocketChannel |
createSocketChannel(boolean secure,
java.lang.String hostDomain,
int hostPort)
Deprecated.
Creates the socket channel that will be used to send the request and get
the response.
|
void |
doHandleInbound(Response response)
Deprecated.
Effectively handles an inbound message.
|
void |
doHandleOutbound(Response response)
Deprecated.
Effectively handles an outbound message.
|
protected org.restlet.ext.nio.internal.connection.Connection<Client> |
getBestConnection(Request request)
Deprecated.
Tries to reuse an existing connection for the given request, or creates a
new one.
|
java.lang.String |
getProxyHost()
Deprecated.
Returns the host name of the HTTP proxy, if specified.
|
int |
getProxyPort()
Deprecated.
Returns the port of the HTTP proxy, if specified, 3128 otherwise.
|
protected java.net.InetSocketAddress |
getSocketAddress(Request request)
Deprecated.
Returns an IP socket address representing the target host domain and port
for a given request.
|
int |
getSocketConnectTimeoutMs()
Deprecated.
Returns the socket connection timeout.
|
void |
handle(Request request,
Response response)
Deprecated.
|
protected void |
handleInbound(Response response)
Deprecated.
Handle the given inbound message.
|
protected void |
handleOutbound(Response response)
Deprecated.
Handle the given outbound message.
|
boolean |
isControllerDaemon()
Deprecated.
Indicates if the controller thread should be a daemon (not blocking JVM
exit).
|
boolean |
isProxying()
Deprecated.
Indicates if the helper is going through a client proxy or is a server
proxy.
|
void |
start()
Deprecated.
|
void |
stop()
Deprecated.
|
protected void |
unblock(Response response)
Deprecated.
Unblocks the thread that handles the given request/response pair.
|
addOutboundMessage, checkin, checkout, configure, createConnectionPool, createInboundWay, createOutboundWay, doFinishStop, doGracefulStop, getConnectionPool, getConnections, getInitialConnections, getMaxConnectionsPerHost, getMaxTotalConnections, getSocketLingerTimeMs, getSocketReceiveBufferSize, getSocketSendBufferSize, getSocketTrafficClass, isPersistingConnections, isPipeliningConnections, isPooledConnection, isSocketKeepAlive, isSocketNoDelay, isSocketOobInline, isSocketReuseAddresscontrol, createControllerService, createRequest, createWorkerService, execute, getController, getControllerSleepTimeMs, getInboundBufferSize, getInboundMessages, getLowThreads, getMaxIoIdleTimeMs, getMaxQueued, getMaxThreadIdleTimeMs, getMaxThreads, getMinThreads, getOutboundBufferSize, getOutboundMessages, getRequest, getThrottleTimeMs, getTraceStream, getTransport, getWorkerService, handleInbound, handleOutbound, hasWorkerThreads, isClientSide, isDirectBuffers, isServerSide, isTracing, isWorkerServiceOverloaded, onInboundError, onOutboundError, traceWorkerServicegetConnectorService, getContext, getProtocols, updategetAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelpedprotected static final java.lang.String CONNECTOR_LATCH
public ClientConnectionHelper(Client connector)
connector - The helped client connector.public org.restlet.ext.nio.internal.connection.Connection<Client> createConnection(java.nio.channels.SocketChannel socketChannel, org.restlet.ext.nio.internal.controller.ConnectionController controller, java.net.InetSocketAddress socketAddress) throws java.io.IOException
ConnectionHelpercreateConnection in class ConnectionHelper<Client>socketChannel - The underlying NIO socket channel.controller - The underlying IO controller.socketAddress - The associated IP address.java.io.IOExceptionprotected org.restlet.ext.nio.internal.controller.ConnectionController createController()
BaseHelpercreateController in class BaseHelper<Client>protected java.nio.channels.SocketChannel createSocketChannel(boolean secure,
java.net.InetSocketAddress socketAddress)
throws java.net.UnknownHostException,
java.io.IOException
getBestConnection(Request)
when a new connection is to be created. By default, calls the
createSocketChannel(boolean, String, int) method.secure - Indicates if messages will be exchanged confidentially, for
example via a SSL-secured connection.socketAddress - The holder of a host/port pair.java.net.UnknownHostExceptionjava.io.IOExceptionprotected java.nio.channels.SocketChannel createSocketChannel(boolean secure,
java.lang.String hostDomain,
int hostPort)
throws java.net.UnknownHostException,
java.io.IOException
secure - Indicates if messages will be exchanged confidentially, for
example via a SSL-secured connection.hostDomain - The target host domain name.hostPort - The target host port.java.net.UnknownHostExceptionjava.io.IOExceptionpublic void doHandleInbound(Response response)
BaseHelperdoHandleInbound in class BaseHelper<Client>response - The response to handle.public void doHandleOutbound(Response response)
BaseHelperdoHandleOutbound in class BaseHelper<Client>response - The response to handle.protected org.restlet.ext.nio.internal.connection.Connection<Client> getBestConnection(Request request) throws java.net.UnknownHostException, java.io.IOException
request - The request to handle.java.net.UnknownHostExceptionjava.io.IOExceptionpublic java.lang.String getProxyHost()
public int getProxyPort()
protected java.net.InetSocketAddress getSocketAddress(Request request) throws java.net.UnknownHostException
getBestConnection(Request) method.request - The given requestjava.net.UnknownHostException - If the proxy port is invalid or the host unresolved.public int getSocketConnectTimeoutMs()
public void handle(Request request, Response response)
handle in class RestletHelper<Client>protected void handleInbound(Response response)
BaseHelperhandleInbound in class BaseHelper<Client>response - The message to handle.protected void handleOutbound(Response response)
BaseHelperhandleOutbound in class BaseHelper<Client>response - The message to handle.public boolean isControllerDaemon()
BaseHelperisControllerDaemon in class BaseHelper<Client>public boolean isProxying()
ConnectionHelperisProxying in class ConnectionHelper<Client>public void start()
throws java.lang.Exception
start in class BaseHelper<Client>java.lang.Exceptionpublic void stop()
throws java.lang.Exception
stop in class BaseHelper<Client>java.lang.Exceptionprotected void unblock(Response response)
response - The response.Copyright © 2005-2020 Restlet.