public static class ProxyPoolClient.ProxyPoolClientBuilder
extends java.lang.Object
Constructor and Description |
---|
ProxyPoolClientBuilder()
Creates a builder with default values
|
Modifier and Type | Method and Description |
---|---|
ProxyPoolClient |
build()
Builds the proxy client with the current parameters
|
ProxyPoolClient.ProxyPoolClientBuilder |
countryCode(java.lang.String countryCode)
Sets the countries that proxies must be in to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
countryCodes(java.util.Collection<java.lang.String> countryCodes)
Sets the countries that proxies must be in to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
countryCodes(java.lang.String... countryCodes)
Sets the countries that proxies must be in to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
domain(java.lang.String domain)
Sets the domain the proxies will be used for
|
ProxyPoolClient.ProxyPoolClientBuilder |
numTries(int numTries)
Sets how many times the client will attempt to get a new proxy before failing
|
ProxyPoolClient.ProxyPoolClientBuilder |
password(java.lang.String password)
Sets the password for accessing the proxy service
|
ProxyPoolClient.ProxyPoolClientBuilder |
proxyServiceUrl(java.lang.String proxyServiceUrl)
Sets the URL the proxy service is located at
|
ProxyPoolClient.ProxyPoolClientBuilder |
proxyType(ProxyPoolClient.ProxyType proxyType)
Sets the type that proxies must be to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
proxyTypes(java.util.Collection<ProxyPoolClient.ProxyType> proxyTypes)
Sets the types that proxies must be in to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
proxyTypes(ProxyPoolClient.ProxyType... proxyTypes)
Sets the types that proxies must be in to be set by the proxy pool client
|
ProxyPoolClient.ProxyPoolClientBuilder |
session(ScrapingSession session)
Sets the session
|
ProxyPoolClient.ProxyPoolClientBuilder |
terminateScrapeOnError(boolean terminateScrapeOnError)
Sets whether or not the client will terminate the scrape if it fails to get a proxy
|
java.lang.String |
toString() |
ProxyPoolClient.ProxyPoolClientBuilder |
username(java.lang.String username)
Sets the username for accessing the proxy service
|
public ProxyPoolClientBuilder()
@NotNull public ProxyPoolClient.ProxyPoolClientBuilder session(@Nullable ScrapingSession session)
session
- The scraping session being run@NotNull public ProxyPoolClient.ProxyPoolClientBuilder numTries(int numTries)
numTries
- How many times to attempt finding a new proxy before failing@NotNull public ProxyPoolClient.ProxyPoolClientBuilder proxyServiceUrl(@Nullable java.lang.String proxyServiceUrl)
proxyServiceUrl
- The URL where the proxy service is located@NotNull public ProxyPoolClient.ProxyPoolClientBuilder terminateScrapeOnError(boolean terminateScrapeOnError)
terminateScrapeOnError
- True if the proxy pool client should terminate the scrape if it fails to find a (new) proxy.@NotNull public ProxyPoolClient.ProxyPoolClientBuilder domain(@Nullable java.lang.String domain)
domain
- The domain the proxy pool will request proxies for@NotNull public ProxyPoolClient.ProxyPoolClientBuilder countryCodes(@Nullable java.util.Collection<java.lang.String> countryCodes)
countryCodes
- The country codes to get proxies in, or null (or empty) to indicate any country is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder countryCodes(@Nullable java.lang.String... countryCodes)
countryCodes
- The country codes to get proxies in, or null (or empty) to indicate any country is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder countryCode(@Nullable java.lang.String countryCode)
countryCode
- The country code to get proxies in, or null to indicate any country is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder proxyTypes(@Nullable java.util.Collection<ProxyPoolClient.ProxyType> proxyTypes)
proxyTypes
- The country codes to get proxies in, or null (or empty) to indicate any type is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder proxyTypes(@Nullable ProxyPoolClient.ProxyType... proxyTypes)
proxyTypes
- The country codes to get proxies in, or null (or empty) to indicate any type is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder proxyType(@Nullable ProxyPoolClient.ProxyType proxyType)
proxyType
- The country code to get proxies in, or null to indicate any type is fine@NotNull public ProxyPoolClient.ProxyPoolClientBuilder username(@Nullable java.lang.String username)
username
- The username required for the service@NotNull public ProxyPoolClient.ProxyPoolClientBuilder password(@Nullable java.lang.String password)
password
- The password for using the proxy service@NotNull public ProxyPoolClient build()
@NotNull public java.lang.String toString()
toString
in class java.lang.Object