Class Flux


  • public class Flux
    extends Object
    Static accessor to FluentHttpClient with option to set default configuration.
    • Constructor Detail

      • Flux

        public Flux()
    • Method Detail

      • 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

        public static void setDefaultTimeout​(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.
        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

        public static void setDefaultTimeoutConnection​(String 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 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

        public static void setDefaultTimeoutRead​(String 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 human time.
      • clearTimeouts

        public static void clearTimeouts()
        Clears all default timeouts
      • addDefaultHeader

        public static void addDefaultHeader​(String key,
                                            String value)
        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

        public static FluentHttpClient.HttpBuilder request​(String resource)
        Specifies the resource to be requested.
        Parameters:
        resource - The URL to request, including protocol.
        Returns:
        The HttpBuilder
      • request

        public static FluentHttpClient.HttpBuilder request​(URL resource)
        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 resource
        host - Host of the resource
        port - Port the host is listening on
        path - Path for the resource
        Returns:
        The HttpBuilder
      • setHttpClientFactory

        public static void setHttpClientFactory​(Supplier<HttpClient> clientFactory)
      • resetHttpClientFactory

        public static void resetHttpClientFactory()
      • createDefaultHttpClientSupplier

        protected static Supplier<HttpClient> createDefaultHttpClientSupplier()