Package org.restlet.engine.connector
Class HttpClientHelper
java.lang.Object
org.restlet.engine.Helper
org.restlet.engine.RestletHelper<T>
org.restlet.engine.connector.ConnectorHelper<Client>
org.restlet.engine.connector.ClientHelper
org.restlet.engine.adapter.HttpClientHelper
org.restlet.engine.connector.HttpClientHelper
Deprecated.
Will be removed in the next 2.7/3.0 release.
HTTP client connector using the
For the default SSL parameters see the Javadocs of the
HttpUrlConnectionCall. Here is the
list of parameters that are supported. They should be set in the Client's
context before it is started:
| Parameter name | Value type | Default value | Description |
|---|---|---|---|
| allowUserInteraction | boolean | false | If true, this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog. |
| chunkLength | int | 0 (uses HttpURLConnection's default) | The chunk-length when using chunked encoding streaming mode for response entities. A value of -1 means chunked encoding is disabled for response entities. |
| followRedirects | boolean | false | If true, the protocol will automatically follow redirects. If false, the protocol will not automatically follow redirects. |
| readTimeout | int | 60000 | Sets the read timeout to a specified timeout, in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
| socketConnectTimeoutMs | int | 15000 | The socket connection timeout or 0 for unlimited wait. |
| sslContextFactory | String | org.restlet.engine.ssl.DefaultSslContextFactory | Let you specify a SslContextFactory
qualified class name as a parameter, or an instance as an attribute for a
more complete and flexible SSL context setting. |
| useCaches | boolean | false | If true, the protocol is allowed to use caching whenever it can. |
DefaultSslContextFactory class.
It is also possible to specify a hostname verifier for HTTPS connections. See
the getHostnameVerifier() method for details.
Note that by default, the HttpURLConnection class as implemented by
Sun will retry a request if an IO exception is caught, for example, due to a
connection reset by the server. This can be annoying, especially because the
HTTP semantics of non-idempotent methods like POST can be broken, but also
because the new request won't include an entity. There is one way to disable
this behavior for POST requests only by setting the system property
"sun.net.http.retryPost" to "false".
- Author:
- Jerome Louvel
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Creates a low-level HTTP client call from a high-level uniform call.intDeprecated.Returns the chunk-length when using chunked encoding streaming mode for response entities.Deprecated.Returns the hostname verifier by looking up the "hostnameVerifier" attribute of the client's context.intDeprecated.Returns the read timeout value.booleanDeprecated.Indicates if this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog.booleanDeprecated.Indicates if the protocol automatically follows redirects.booleanDeprecated.Indicates if the protocol is allowed to use caching whenever it can.voidstart()Deprecated.Start callback.voidstop()Deprecated.Stop callback.Methods inherited from class org.restlet.engine.adapter.HttpClientHelper
getAdapter, getSocketConnectTimeoutMs, handle, setAdapterMethods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, updateMethods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
Constructor Details
-
HttpClientHelper
Deprecated.Constructor.- Parameters:
client- The client to help.
-
-
Method Details
-
create
Deprecated.Creates a low-level HTTP client call from a high-level uniform call.- Specified by:
createin classHttpClientHelper- Parameters:
request- The high-level request.- Returns:
- A low-level HTTP client call.
-
getChunkLength
public int getChunkLength()Deprecated.Returns the chunk-length when using chunked encoding streaming mode for response entities. A value of -1 means chunked encoding is disabled for response entities.- Returns:
- The chunk-length when using chunked encoding streaming mode for response entities.
-
getHostnameVerifier
Deprecated.Returns the hostname verifier by looking up the "hostnameVerifier" attribute of the client's context.- Returns:
- The hostname verifier or null.
-
getReadTimeout
public int getReadTimeout()Deprecated.Returns the read timeout value. A timeout of zero is interpreted as an infinite timeout. Default to 60000.- Returns:
- The read timeout value.
-
isAllowUserInteraction
public boolean isAllowUserInteraction()Deprecated.Indicates if this URL is being examined in a context in which it makes sense to allow user interactions such as popping up an authentication dialog.- Returns:
- True if it makes sense to allow user interactions.
-
isFollowRedirects
public boolean isFollowRedirects()Deprecated.Indicates if the protocol automatically follows redirects.- Returns:
- True if the protocol automatically follows redirects.
-
isUseCaches
public boolean isUseCaches()Deprecated.Indicates if the protocol is allowed to use caching whenever it can.- Returns:
- True if the protocol is allowed to use caching whenever it can.
-
start
Deprecated.Description copied from class:RestletHelperStart callback.- Overrides:
startin classConnectorHelper<Client>- Throws:
Exception
-
stop
Deprecated.Description copied from class:RestletHelperStop callback.- Overrides:
stopin classConnectorHelper<Client>- Throws:
Exception
-