@Deprecated public abstract class ServerConnectionHelper extends ConnectionHelper<Server>
Parameter name | Value type | Default value | Description |
---|---|---|---|
useForwardedForHeader | boolean | false | Lookup the "X-Forwarded-For" header supported by popular proxies and caches and uses it to populate the Request.getClientAddresses() method result. This information is only safe for intermediary components within your local network. Other addresses could easily be changed by setting a fake header and should not be trusted for serious security checks. |
reuseAddress | boolean | true | Enable/disable the SO_REUSEADDR socket option. See java.io.ServerSocket#reuseAddress property for additional details. |
clientSide, controller, inboundMessages, outboundMessages
Constructor and Description |
---|
ServerConnectionHelper(Server server)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
canHandle(org.restlet.ext.nio.internal.connection.Connection<Server> connection,
Response response)
Deprecated.
Indicates if the connection can handle the given response at this point
in time.
|
org.restlet.ext.nio.internal.connection.Connection<Server> |
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.ServerConnectionController |
createController()
Deprecated.
Creates a new controller.
|
abstract Request |
createRequest(org.restlet.ext.nio.internal.connection.Connection<Server> connection,
java.lang.String methodName,
java.lang.String resourceUri,
java.lang.String protocol)
Deprecated.
Creates a new request.
|
protected java.nio.channels.ServerSocketChannel |
createServerSocketChannel()
Deprecated.
Create a server socket channel and bind it to the given address
|
protected java.net.SocketAddress |
createSocketAddress()
Deprecated.
Creates a socket address to listen on.
|
void |
doHandleInbound(Response response)
Deprecated.
Effectively handles an inbound message.
|
void |
doHandleOutbound(Response response)
Deprecated.
Effectively handles an outbound message.
|
org.restlet.ext.nio.internal.controller.ServerConnectionController |
getController()
Deprecated.
Returns the controller task.
|
java.nio.channels.ServerSocketChannel |
getServerSocketChannel()
Deprecated.
Returns the server socket channel.
|
void |
handle(Request request,
Response response)
Deprecated.
Handles a call by invoking the helped Server's
Server.handle(Request, Response) method. |
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.
|
boolean |
isReuseAddress()
Deprecated.
Indicates if the controller thread should be a daemon (not blocking JVM
exit).
|
void |
setEphemeralPort(int localPort)
Deprecated.
Sets the ephemeral port in the attributes map if necessary.
|
void |
setEphemeralPort(java.net.ServerSocket socket)
Deprecated.
Sets the ephemeral port in the attributes map if necessary.
|
void |
start()
Deprecated.
|
void |
stop()
Deprecated.
|
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, 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
public ServerConnectionHelper(Server server)
server
- The server to help.protected abstract boolean canHandle(org.restlet.ext.nio.internal.connection.Connection<Server> connection, Response response) throws java.io.IOException
connection
- The parent connection.response
- The response to handle.java.io.IOException
public org.restlet.ext.nio.internal.connection.Connection<Server> 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<Server>
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.ServerConnectionController createController()
BaseHelper
createController
in class BaseHelper<Server>
public abstract Request createRequest(org.restlet.ext.nio.internal.connection.Connection<Server> connection, java.lang.String methodName, java.lang.String resourceUri, java.lang.String protocol)
connection
- The associated connection.methodName
- The method name.resourceUri
- The target resource URI.protocol
- The protocol name and version.protected java.nio.channels.ServerSocketChannel createServerSocketChannel() throws java.io.IOException
java.io.IOException
protected java.net.SocketAddress createSocketAddress() throws java.io.IOException
java.io.IOException
public void doHandleInbound(Response response)
BaseHelper
doHandleInbound
in class BaseHelper<Server>
response
- The response to handle.public void doHandleOutbound(Response response)
BaseHelper
doHandleOutbound
in class BaseHelper<Server>
response
- The response to handle.public org.restlet.ext.nio.internal.controller.ServerConnectionController getController()
BaseHelper
getController
in class BaseHelper<Server>
public java.nio.channels.ServerSocketChannel getServerSocketChannel()
public void handle(Request request, Response response)
Server.handle(Request, Response)
method.handle
in class RestletHelper<Server>
request
- The request to handle.response
- The response to update.protected void handleInbound(Response response)
BaseHelper
handleInbound
in class BaseHelper<Server>
response
- The message to handle.protected void handleOutbound(Response response)
BaseHelper
handleOutbound
in class BaseHelper<Server>
response
- The message to handle.public boolean isControllerDaemon()
BaseHelper
isControllerDaemon
in class BaseHelper<Server>
public boolean isProxying()
ConnectionHelper
isProxying
in class ConnectionHelper<Server>
public boolean isReuseAddress()
public void setEphemeralPort(int localPort)
localPort
- The ephemeral local port.public void setEphemeralPort(java.net.ServerSocket socket)
socket
- The bound server socket.public void start() throws java.lang.Exception
start
in class BaseHelper<Server>
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class BaseHelper<Server>
java.lang.Exception
Copyright © 2005-2020 Restlet.