Class HttpClientHandler.ProxyInfo

java.lang.Object
org.forgerock.http.handler.HttpClientHandler.ProxyInfo
Enclosing class:
HttpClientHandler

public static final class HttpClientHandler.ProxyInfo extends Object
Encapsulates the details of the proxy if one is required when making outgoing requests.
  • Method Details

    • proxyInfo

      public static HttpClientHandler.ProxyInfo proxyInfo(URI proxyUri)
      Creates an instance of ProxyInfo for a proxy that does not require authentication.
      Parameters:
      proxyUri - the URI of the proxy, only the scheme, host and port are used.
      Returns:
      an instance of ProxyInfo for a proxy that does not require authentication.
    • proxyInfo

      public static HttpClientHandler.ProxyInfo proxyInfo(URI proxyUri, Supplier<PrincipalAndSecret<GenericSecret>> supplier)
      Creates an instance of ProxyInfo for a proxy that does not require authentication.
      Parameters:
      proxyUri - the URI of the proxy, only the scheme, host and port are used.
      supplier - for the username and password to use when authenticating to the proxy.
      Returns:
      an instance of ProxyInfo for a proxy that does not require authentication.
    • asyncProxyInfo

      public static Promise<HttpClientHandler.ProxyInfo,NeverThrowsException> asyncProxyInfo(URI proxyUri, CredentialPair<GenericSecret> credentialPair, Clock clock, Duration refreshDuration)
      Creates an instance of ProxyInfo for a proxy that requires authentication, this will update its secrets in the background and will not block threads.
      Parameters:
      proxyUri - the URI of the proxy, only the scheme, host and port are used.
      credentialPair - containing the username and password to use when authenticating to the proxy.
      clock - the clock to use for determining when to refresh the credentials.
      refreshDuration - the duration between refreshes of the credentials.
      Returns:
      an instance of ProxyInfo for a proxy that requires authentication.
    • blockingProxyInfo

      public static HttpClientHandler.ProxyInfo blockingProxyInfo(URI proxyUri, CredentialPair<GenericSecret> credentialPair)
      Creates an instance of ProxyInfo for a proxy that requires authentication, this will block and wait for a credentialPair to return a value.
      Parameters:
      proxyUri - the URI of the proxy, only the scheme, host and port are used.
      credentialPair - containing the username and password to use when authenticating to the proxy.
      Returns:
      an instance of ProxyInfo for a proxy that requires authentication.
    • getProxyUri

      public URI getProxyUri()
      Returns the URI of the proxy.
      Returns:
      the URI of the proxy.
    • getCredentials

      public Supplier<PrincipalAndSecret<GenericSecret>> getCredentials()
      Returns the Supplier containing the username and password to use when authenticating to the proxy.
      Returns:
      supplier containing the username and password to use when authenticating to the proxy.
    • hasCredentials

      public boolean hasCredentials()
      Returns true if there is a set of username/password credentials defined.
      Returns:
      true if there is a set of username/password credentials defined.
    • getUsername

      @Deprecated public String getUsername()
      Deprecated.
      Use getCredentials() instead
      Returns the username to use when authenticating to the proxy.
      Returns:
      the username to use when authenticating to the proxy.
    • getPassword

      @Deprecated public String getPassword()
      Deprecated.
      Use getCredentials() instead
      Returns the password to use when authenticating to the proxy.
      Returns:
      the password to use when authenticating to the proxy.
    • proxyInfo

      @Deprecated public static HttpClientHandler.ProxyInfo proxyInfo(URI proxyUri, String username, String password)
      Deprecated.
      Creates an instance of HttpClientHandler.ProxyInfo for a proxy that requires authentication.
      Parameters:
      proxyUri - the URI of the proxy, only the scheme, host and port are used.
      username - the username to use when authenticating to the proxy.
      password - the password to use when authenticating to the proxy.
      Returns:
      an instance of ProxyInfo for a proxy that requires authentication.