@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, isSocketReuseAddress
control, 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, traceWorkerService
getConnectorService, getContext, getProtocols, update
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
protected 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
ConnectionHelper
createConnection
in class ConnectionHelper<Client>
socketChannel
- The underlying NIO socket channel.controller
- The underlying IO controller.socketAddress
- The associated IP address.java.io.IOException
protected org.restlet.ext.nio.internal.controller.ConnectionController createController()
BaseHelper
createController
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.UnknownHostException
java.io.IOException
protected 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.UnknownHostException
java.io.IOException
public void doHandleInbound(Response response)
BaseHelper
doHandleInbound
in class BaseHelper<Client>
response
- The response to handle.public void doHandleOutbound(Response response)
BaseHelper
doHandleOutbound
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.UnknownHostException
java.io.IOException
public 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)
BaseHelper
handleInbound
in class BaseHelper<Client>
response
- The message to handle.protected void handleOutbound(Response response)
BaseHelper
handleOutbound
in class BaseHelper<Client>
response
- The message to handle.public boolean isControllerDaemon()
BaseHelper
isControllerDaemon
in class BaseHelper<Client>
public boolean isProxying()
ConnectionHelper
isProxying
in class ConnectionHelper<Client>
public void start() throws java.lang.Exception
start
in class BaseHelper<Client>
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class BaseHelper<Client>
java.lang.Exception
protected void unblock(Response response)
response
- The response.Copyright © 2005-2024 Restlet.