Package org.restlet.engine.adapter
Class HttpClientHelper
- java.lang.Object
-
- org.restlet.engine.Helper
-
- org.restlet.engine.RestletHelper<T>
-
- org.restlet.engine.connector.ConnectorHelper<org.restlet.Client>
-
- org.restlet.engine.connector.ClientHelper
-
- org.restlet.engine.adapter.HttpClientHelper
-
- Direct Known Subclasses:
HttpClientHelper
public abstract class HttpClientHelper extends ClientHelper
Base HTTP client connector. Here is the list of parameters that are supported. They should be set in the Client's context before it is started:list of supported parameters Parameter name Value type Default value Description adapter String org.restlet.engine.adapter.ClientAdapter Class name of the adapter of low-level HTTP calls into high level requests and responses. - Author:
- Jerome Louvel
-
-
Constructor Summary
Constructors Constructor Description HttpClientHelper(org.restlet.Client client)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ClientCall
create(org.restlet.Request request)
Creates a low-level HTTP client call from a high-level request.ClientAdapter
getAdapter()
Returns the adapter from uniform calls to HTTP calls.int
getSocketConnectTimeoutMs()
Returns the connection timeout.void
handle(org.restlet.Request request, org.restlet.Response response)
Handles a call.void
setAdapter(ClientAdapter adapter)
Sets the adapter from uniform calls to HTTP calls.-
Methods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, start, stop, update
-
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
-
-
-
Method Detail
-
create
public abstract ClientCall create(org.restlet.Request request)
Creates a low-level HTTP client call from a high-level request.- Parameters:
request
- The high-level request.- Returns:
- A low-level HTTP client call.
-
getAdapter
public ClientAdapter getAdapter() throws java.lang.Exception
Returns the adapter from uniform calls to HTTP calls.- Returns:
- the adapter from uniform calls to HTTP calls.
- Throws:
java.lang.Exception
-
getSocketConnectTimeoutMs
public int getSocketConnectTimeoutMs()
Returns the connection timeout. Defaults to 15000.- Returns:
- The connection timeout.
-
handle
public void handle(org.restlet.Request request, org.restlet.Response response)
Description copied from class:RestletHelper
Handles a call.- Overrides:
handle
in classRestletHelper<org.restlet.Client>
- Parameters:
request
- The request to handle.response
- The response to update.
-
setAdapter
public void setAdapter(ClientAdapter adapter)
Sets the adapter from uniform calls to HTTP calls.- Parameters:
adapter
- The adapter to set.
-
-