Package org.restlet.engine.adapter
Class HttpServerHelper
- java.lang.Object
-
- org.restlet.engine.Helper
-
- org.restlet.engine.RestletHelper<T>
-
- org.restlet.engine.connector.ConnectorHelper<org.restlet.Server>
-
- org.restlet.engine.connector.ServerHelper
-
- org.restlet.engine.adapter.HttpServerHelper
-
- Direct Known Subclasses:
NetServerHelper
public class HttpServerHelper extends ServerHelper
Base HTTP server connector. Here is the list of parameters that are supported. They should be set in the Server's context before it is started:list of supported parameters 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. adapter String org.restlet.engine.adapter.ServerAdapter Class name of the adapter of low-level HTTP calls into high level requests and responses. - Author:
- Jerome Louvel
-
-
Constructor Summary
Constructors Constructor Description HttpServerHelper()
Default constructor.HttpServerHelper(org.restlet.Server server)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerAdapter
getAdapter()
Returns the adapter from HTTP calls to uniform calls.void
handle(ServerCall httpCall)
Handles the connector call.void
setAdapter(ServerAdapter adapter)
Sets the adapter from HTTP calls to uniform calls.-
Methods inherited from class org.restlet.engine.connector.ServerHelper
handle, setEphemeralPort, setEphemeralPort, stop
-
Methods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, start, update
-
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
-
-
-
Constructor Detail
-
HttpServerHelper
public HttpServerHelper()
Default constructor. Note that many methods assume that a non-null server is set to work properly. You can use the setHelped(Server) method for this purpose or better rely on the other constructor.
-
HttpServerHelper
public HttpServerHelper(org.restlet.Server server)
Constructor.- Parameters:
server
- The server to help.
-
-
Method Detail
-
getAdapter
public ServerAdapter getAdapter()
Returns the adapter from HTTP calls to uniform calls.- Returns:
- the adapter from HTTP calls to uniform calls.
-
handle
public void handle(ServerCall httpCall)
Handles the connector call. The default behavior is to create an REST call and delegate it to the attached Restlet.- Parameters:
httpCall
- The HTTP server call.
-
setAdapter
public void setAdapter(ServerAdapter adapter)
Sets the adapter from HTTP calls to uniform calls.- Parameters:
adapter
- The converter to set.
-
-