Package org.forgerock.http.handler
Class HttpClientHandler.ProxyInfo
java.lang.Object
org.forgerock.http.handler.HttpClientHandler.ProxyInfo
- Enclosing class:
- HttpClientHandler
Encapsulates the details of the proxy if one is required when making outgoing requests.
-
Method Summary
Modifier and TypeMethodDescriptionasyncProxyInfo
(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.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.Returns theSupplier
containing the username and password to use when authenticating to the proxy.Deprecated.Returns theURI
of the proxy.Deprecated.UsegetCredentials()
insteadboolean
Returns true if there is a set of username/password credentials defined.static HttpClientHandler.ProxyInfo
Creates an instance of ProxyInfo for a proxy that does not require authentication.static HttpClientHandler.ProxyInfo
Deprecated.UseblockingProxyInfo(URI, CredentialPair)
} insteadstatic HttpClientHandler.ProxyInfo
proxyInfo
(URI proxyUri, Supplier<PrincipalAndSecret<GenericSecret>> supplier) Creates an instance of ProxyInfo for a proxy that does not require authentication.
-
Method Details
-
proxyInfo
Creates an instance of ProxyInfo for a proxy that does not require authentication.- Parameters:
proxyUri
- theURI
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
- theURI
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
- theURI
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
- theURI
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
Returns theURI
of the proxy.- Returns:
- the URI of the proxy.
-
getCredentials
Returns theSupplier
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.UsegetCredentials()
insteadReturns the username to use when authenticating to the proxy.- Returns:
- the username to use when authenticating to the proxy.
-
getPassword
Deprecated.UsegetCredentials()
insteadReturns 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.UseblockingProxyInfo(URI, CredentialPair)
} insteadCreates an instance ofHttpClientHandler.ProxyInfo
for a proxy that requires authentication.- Parameters:
proxyUri
- theURI
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.
-
getCredentials()
instead