Package de.galan.commons.net.flux
Class Flux
java.lang.Object
de.galan.commons.net.flux.Flux
Static accessor to FluentHttpClient with option to set default configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDefaultHeader(String key, String value) Added default headers will always be send, can still be overriden using the builder.static voidRemoves all default http-headersstatic voidClears all default timeoutsprotected static FluentHttpClientprotected static Supplier<HttpClient>static FluentHttpClient.HttpBuilderSpecifies the resource to be requested.static FluentHttpClient.HttpBuilderSpecifies the resource to be requested.static FluentHttpClient.HttpBuilderSpecifies the resource to be requested.static voidstatic voidsetDefaultTimeout(long timeout) If no timeout is passed via the builder, a default timeout can be set for read and connection timeouts with this method for further requests.static voidsetDefaultTimeout(String timeout) If no timeout is passed via the builder, a default timeout can be set for read and connection timeouts with this method for further requests.static voidsetDefaultTimeoutConnection(long timeoutConnection) If no connection timeout is passed via the builder, a default connection timeout can be set with this method for further requests.static voidsetDefaultTimeoutConnection(String timeoutConnection) If no connection timeout is passed via the builder, a default connection timeout can be set with this method for further requests.static voidsetDefaultTimeoutRead(long timeoutRead) If no read timeout is passed via the builder, a default read timeout can be set with this method for further requests.static voidsetDefaultTimeoutRead(String timeoutRead) If no read timeout is passed via the builder, a default read timeout can be set with this method for further requests.static voidsetHttpClientFactory(Supplier<HttpClient> clientFactory)
-
Constructor Details
-
Flux
public Flux()
-
-
Method Details
-
setDefaultTimeout
public static void setDefaultTimeout(long timeout) If no timeout is passed via the builder, a default timeout can be set for read and connection timeouts with this method for further requests.- Parameters:
timeout- Timeout in milliseconds
-
setDefaultTimeout
If no timeout is passed via the builder, a default timeout can be set for read and connection timeouts with this method for further requests.- Parameters:
timeout- Timeout in human time.
-
setDefaultTimeoutConnection
public static void setDefaultTimeoutConnection(long timeoutConnection) If no connection timeout is passed via the builder, a default connection timeout can be set with this method for further requests.- Parameters:
timeoutConnection- Connection timeout in milliseconds
-
setDefaultTimeoutConnection
If no connection timeout is passed via the builder, a default connection timeout can be set with this method for further requests.- Parameters:
timeoutConnection- Connection timeout in human time.
-
setDefaultTimeoutRead
public static void setDefaultTimeoutRead(long timeoutRead) If no read timeout is passed via the builder, a default read timeout can be set with this method for further requests.- Parameters:
timeoutRead- Read timeout in milliseconds
-
setDefaultTimeoutRead
If no read timeout is passed via the builder, a default read timeout can be set with this method for further requests.- Parameters:
timeoutRead- Read timeout in human time.
-
clearTimeouts
public static void clearTimeouts()Clears all default timeouts -
addDefaultHeader
Added default headers will always be send, can still be overriden using the builder. -
clearDefaultHeader
public static void clearDefaultHeader()Removes all default http-headers -
request
Specifies the resource to be requested.- Parameters:
resource- The URL to request, including protocol.- Returns:
- The HttpBuilder
-
request
Specifies the resource to be requested.- Parameters:
resource- The URL to request.- Returns:
- The HttpBuilder
-
request
public static FluentHttpClient.HttpBuilder request(String protocol, String host, Integer port, String path) Specifies the resource to be requested.- Parameters:
protocol- Protocol of the resourcehost- Host of the resourceport- Port the host is listening onpath- Path for the resource- Returns:
- The HttpBuilder
-
createClient
-
setHttpClientFactory
-
resetHttpClientFactory
public static void resetHttpClientFactory() -
createDefaultHttpClientSupplier
-