Package ai.preferred.venom
Interface ProxyProvider
-
public interface ProxyProvider
This interface allows the user to define proxies to be used for requests.- Author:
- Truong Quoc Tuan, Maksim Tkachenko, Ween Jiann Lee
-
-
Field Summary
Fields Modifier and Type Field Description static ProxyProvider
EMPTY_PROXY_PROVIDER
An instance of proxy provider without any proxies.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(@NotNull org.apache.http.HttpHost proxy)
Add a proxy to the list.void
addAll(@NotNull java.util.Collection<org.apache.http.HttpHost> proxies)
Add a list of proxies to the list.org.apache.http.HttpHost
get(@NotNull Request request)
Returns the get proxy from the list.@NotNull java.util.List<org.apache.http.HttpHost>
getProxyList()
Returns a list of all proxies.void
remove(@NotNull org.apache.http.HttpHost proxy)
Remove a proxy from the list.
-
-
-
Field Detail
-
EMPTY_PROXY_PROVIDER
static final ProxyProvider EMPTY_PROXY_PROVIDER
An instance of proxy provider without any proxies.
-
-
Method Detail
-
getProxyList
@NotNull @NotNull java.util.List<org.apache.http.HttpHost> getProxyList()
Returns a list of all proxies.- Returns:
- list of proxies
-
add
void add(@NotNull @NotNull org.apache.http.HttpHost proxy)
Add a proxy to the list.- Parameters:
proxy
- the proxy to be added
-
addAll
void addAll(@NotNull @NotNull java.util.Collection<org.apache.http.HttpHost> proxies)
Add a list of proxies to the list.- Parameters:
proxies
- the list of proxies to be added
-
remove
void remove(@NotNull @NotNull org.apache.http.HttpHost proxy)
Remove a proxy from the list.- Parameters:
proxy
- the proxy to be removed
-
get
@Nullable org.apache.http.HttpHost get(@NotNull @NotNull Request request)
Returns the get proxy from the list.- Parameters:
request
- the request to be made- Returns:
- the proxy to use
-
-