public abstract class AbstractIpAddressBasedQueue extends Object implements IpAddressBasedQueue
| Modifier and Type | Field and Description |
|---|---|
private Set<InetAddress> |
blockedIps |
private static org.slf4j.Logger |
LOGGER |
private Semaphore |
queueMutex |
| Constructor and Description |
|---|
AbstractIpAddressBasedQueue() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addToQueue(CrawleableUri uri) |
void |
addUri(CrawleableUri uri)
Adds the given
CrawleableUri instance to the queue. |
protected abstract Iterator<IpUriTypePair> |
getIterator() |
List<CrawleableUri> |
getNextUris()
Returns the next chunk of URIs that should be crawled or null.
|
int |
getNumberOfBlockedIps()
Returns the number of IP addresses that are currently blocked.
|
protected abstract List<CrawleableUri> |
getUris(IpUriTypePair pair) |
void |
markIpAddressAsAccessible(InetAddress ip)
Marks the given IP address as accessible.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIPURIIteratorprivate static final org.slf4j.Logger LOGGER
private Semaphore queueMutex
private Set<InetAddress> blockedIps
public void addUri(CrawleableUri uri)
UriQueueCrawleableUri instance to the queue.addUri in interface UriQueueuri - the CrawleableUri instance that should be added to the
queue.protected abstract void addToQueue(CrawleableUri uri)
public List<CrawleableUri> getNextUris()
UriQueuegetNextUris in interface UriQueueprotected abstract Iterator<IpUriTypePair> getIterator()
protected abstract List<CrawleableUri> getUris(IpUriTypePair pair)
public void markIpAddressAsAccessible(InetAddress ip)
IpAddressBasedQueuemarkIpAddressAsAccessible in interface IpAddressBasedQueueip - the IP address that should be marked as accessible.public int getNumberOfBlockedIps()
IpAddressBasedQueuegetNumberOfBlockedIps in interface IpAddressBasedQueueCopyright © 2017–2019. All rights reserved.