- java.lang.Object
-
- org.shredzone.acme4j.connector.HttpConnector
-
public class HttpConnector extends Object
A generic HTTP connector. It createsHttpClient.Builder
andHttpRequest.Builder
that can be individually customized according to the needs of the CA.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description HttpConnector(NetworkSettings networkSettings)
Creates a newHttpConnector
that is using the givenNetworkSettings
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClient.Builder
createClientBuilder()
Creates a newHttpClient.Builder
.HttpRequest.Builder
createRequestBuilder(URL url)
Creates a newHttpRequest.Builder
that is preconfigured and bound to the given URL.static String
defaultUserAgent()
Returns the default User-Agent to be used.
-
-
-
Constructor Detail
-
HttpConnector
public HttpConnector(NetworkSettings networkSettings)
Creates a newHttpConnector
that is using the givenNetworkSettings
.
-
-
Method Detail
-
defaultUserAgent
public static String defaultUserAgent()
Returns the default User-Agent to be used.- Returns:
- User-Agent
-
createRequestBuilder
public HttpRequest.Builder createRequestBuilder(URL url)
Creates a newHttpRequest.Builder
that is preconfigured and bound to the given URL. Subclasses can override this method to extend the configuration, or create a different builder.- Parameters:
url
-URL
to connect to- Returns:
HttpRequest.Builder
connected to theURL
-
createClientBuilder
public HttpClient.Builder createClientBuilder()
Creates a newHttpClient.Builder
.The
HttpClient.Builder
is already preconfigured with a reasonable timeout, the proxy settings, authenticator, and that it follows normal redirects. Subclasses can override this method to extend the configuration, or to create a different builder.
-
-