public class WSClientProxySelector extends ProxySelector implements AutoCloseable
| Constructor and Description |
|---|
WSClientProxySelector(@NotNull URI[] routedResources,
org.apache.http.HttpHost... proxies)
Initializes a custom proxy selector, that prepares proxy settings for webPDF calls.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProxy(@NotNull org.apache.http.HttpHost proxy)
Adds the given proxy to the list of usable proxy servers.
|
void |
addRoutedResource(URI routedResource)
Adds the given URI to the list of URIs, that must be resolved using a proxy route from this selector.
|
void |
close()
Restores the previously found proxy selector as the VM's default.
|
void |
connectFailed(@Nullable URI uri,
@Nullable SocketAddress socketAddress,
@Nullable IOException exception)
Called to indicate that a connection could not be established to a proxy/socks server.
|
@NotNull List<Proxy> |
select(@Nullable URI uri)
Selects all the applicable proxies based on the protocol to access the resource with and a destination address to
access the resource at.
|
getDefault, setDefaultpublic WSClientProxySelector(@NotNull
@NotNull URI[] routedResources,
@NotNull
org.apache.http.HttpHost... proxies)
proxies - The proxy server hosts, that shall be used.routedResources - A list of all base URIs, that shall be routed via this selector. All URIs a proxy is requested
for, shall start with one of the hereby given URIs.public void addProxy(@NotNull
@NotNull org.apache.http.HttpHost proxy)
proxy - A proxy server, that shall be used.public void addRoutedResource(URI routedResource)
routedResource - The URI, that shall be routed via this selector.@NotNull public @NotNull List<Proxy> select(@Nullable @Nullable URI uri)
socket://host:portIf the URI does not point to a routed resource, the previously known default proxy selector shall be used, to select the proxies.
select in class ProxySelectoruri - The URI that a connection is required toProxy; when no proxy
is available, the list will contain one element of type Proxy that represents a direct
connection.IllegalArgumentException - if the argument is nullpublic void connectFailed(@Nullable
@Nullable URI uri,
@Nullable
@Nullable SocketAddress socketAddress,
@Nullable
@Nullable IOException exception)
select(URI),
using the address and the IOException caught when trying to connect.connectFailed in class ProxySelectoruri - The URI that the proxy at sa failed to serve.socketAddress - The socket address of the proxy/SOCKS serverexception - The I/O exception thrown when the connect failed.IllegalArgumentException - if either argument is nullpublic void close()
close in interface AutoCloseableCopyright © 2017–2022 SoftVision Development GmbH, Fulda, Germany. All rights reserved.