public final class RotatingIpRoutePlanner extends AbstractRoutePlanner
failingAddresses, ipBlock| Constructor and Description |
|---|
RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks) |
RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks,
java.util.function.Predicate<java.net.InetAddress> ipFilter) |
RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks,
java.util.function.Predicate<java.net.InetAddress> ipFilter,
boolean handleSearchFailure) |
| Modifier and Type | Method and Description |
|---|---|
protected Tuple<java.net.InetAddress,java.net.InetAddress> |
determineAddressPair(Tuple<java.net.Inet4Address,java.net.Inet6Address> remoteAddresses)
Determines the local and remote address pair to use
|
java.net.InetAddress |
getCurrentAddress() |
java.math.BigInteger |
getIndex() |
java.math.BigInteger |
getRotateIndex() |
void |
next() |
protected void |
onAddressFailure(java.net.InetAddress address)
Called when an address is marked as failing
|
determineRoute, freeAddress, freeAllAddresses, getFailingAddresses, getFailingIpsCacheDuration, getIpBlock, getLastAddress, isValidAddress, markAddressFailing, shouldHandleSearchFailurepublic RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks)
ipBlocks - the block to perform balancing over.public RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks, java.util.function.Predicate<java.net.InetAddress> ipFilter)
ipBlocks - the block to perform balancing over.ipFilter - function to filter out certain IP addresses picked from the IP block, causing another random to be chosen.public RotatingIpRoutePlanner(java.util.List<IpBlock> ipBlocks, java.util.function.Predicate<java.net.InetAddress> ipFilter, boolean handleSearchFailure)
ipBlocks - the block to perform balancing over.ipFilter - function to filter out certain IP addresses picked from the IP block, causing another random to be chosen.handleSearchFailure - whether a search 429 should trigger the ip as failingpublic void next()
public java.net.InetAddress getCurrentAddress()
public java.math.BigInteger getIndex()
public java.math.BigInteger getRotateIndex()
protected Tuple<java.net.InetAddress,java.net.InetAddress> determineAddressPair(Tuple<java.net.Inet4Address,java.net.Inet6Address> remoteAddresses) throws org.apache.http.HttpException
AbstractRoutePlannerdetermineAddressPair in class AbstractRoutePlannerremoteAddresses - The remote address pair containing IPv4 and IPv6 addresses - which can be nullTuple which contains l = localAddress & r = remoteAddressorg.apache.http.HttpException - when no route can be determinedprotected void onAddressFailure(java.net.InetAddress address)
AbstractRoutePlanneronAddressFailure in class AbstractRoutePlanneraddress - the failing address