ProxyOptions Class
- java.
lang. Object - com.
azure. core. amqp. ProxyOptions
- com.
Implements
public class ProxyOptions
implements AutoCloseable
Properties for configuring proxies with Event Hubs.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final String |
PROXY_AUTHENTICATION_TYPE
The configuration key for containing the authentication type to be used by the proxy. |
| static final String |
PROXY_PASSWORD
The configuration key for containing the password for the username who authenticates with the proxy. |
| static final String |
PROXY_USERNAME
The configuration key for containing the username who authenticates with the proxy. |
|
static final
Proxy |
SYSTEM_DEFAULTS
Gets the system defaults for proxy configuration and authentication. |
Constructor Summary
| Constructor | Description |
|---|---|
| ProxyOptions(ProxyAuthenticationType authentication, Proxy proxyAddress, String username, String password) |
Creates a proxy configuration that uses the |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
close()
Disposes of the configuration along with potential credentials. |
|
static
Proxy |
fromConfiguration(Configuration configuration)
Attempts to load a proxy from the configuration. |
|
Proxy |
getAuthentication()
Gets the proxy authentication type. |
|
Password |
getCredential()
Gets the credentials user provided for authentication of proxy server. |
| Proxy |
getProxyAddress()
Gets the proxy address. |
| boolean |
hasUserDefinedCredentials()
Gets whether the user has defined credentials. |
| boolean |
isProxyAddressConfigured()
Gets whether the proxy address has been configured. |
Methods inherited from java.lang.Object
Field Details
PROXY_AUTHENTICATION_TYPE
public static final String PROXY_AUTHENTICATION_TYPE
The configuration key for containing the authentication type to be used by the proxy. This can one of three values - - NONE - BASIC - DIGEST as defined in ProxyAuthenticationType
PROXY_PASSWORD
public static final String PROXY_PASSWORD
The configuration key for containing the password for the username who authenticates with the proxy.
PROXY_USERNAME
public static final String PROXY_USERNAME
The configuration key for containing the username who authenticates with the proxy.
SYSTEM_DEFAULTS
public static final ProxyOptions SYSTEM_DEFAULTS
Gets the system defaults for proxy configuration and authentication.
Constructor Details
ProxyOptions
public ProxyOptions(ProxyAuthenticationType authentication, Proxy proxyAddress, String username, String password)
Creates a proxy configuration that uses the proxyAddress and authenticates with provided username, password and authentication.
Parameters:
Method Details
close
public void close()
Disposes of the configuration along with potential credentials.
fromConfiguration
public static ProxyOptions fromConfiguration(Configuration configuration)
Attempts to load a proxy from the configuration.
Parameters:
null is passed then Configuration#getGlobalConfiguration() will be used.
Returns:
null
will be returned.getAuthentication
public ProxyAuthenticationType getAuthentication()
Gets the proxy authentication type.
Returns:
null if no authentication type was set. This occurs
when user uses SYSTEM_DEFAULTS.getCredential
public PasswordAuthentication getCredential()
Gets the credentials user provided for authentication of proxy server.
Returns:
null if no credential was set. This occurs when user
uses SYSTEM_DEFAULTS.getProxyAddress
public Proxy getProxyAddress()
Gets the proxy address.
Returns:
null if no proxy address was set This occurs when user uses
SYSTEM_DEFAULTS.hasUserDefinedCredentials
public boolean hasUserDefinedCredentials()
Gets whether the user has defined credentials.
Returns:
isProxyAddressConfigured
public boolean isProxyAddressConfigured()
Gets whether the proxy address has been configured. Used to determine whether to use system-defined or user-defined proxy.
Returns: