public class DefaultLinkFilter extends java.lang.Object implements LinkFilter
LinkFilter implementation.| Constructor and Description |
|---|
DefaultLinkFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowRedirectLink(java.lang.String url,
java.lang.String originalUrl,
WebCrawlingContext context)
Check if it is allowed to follow a given redirect link.
|
java.util.Collection<Record> |
filterExtractedLinks(java.util.Collection<Record> extractedLinks,
java.lang.String sourceUrl,
WebCrawlingContext context)
filter links extracted from given source URL.
|
void |
setJobRunDataProvider(JobRunDataProvider jobRunDataProvider)
DS service reference injection method.
|
void |
unsetJobRunDataProvider(JobRunDataProvider jobRunDataProvider)
DS service reference removal method.
|
public java.util.Collection<Record> filterExtractedLinks(java.util.Collection<Record> extractedLinks, java.lang.String sourceUrl, WebCrawlingContext context) throws WebCrawlerException
LinkFilterfilterExtractedLinks in interface LinkFilterextractedLinks - result from LinkExtractor service.sourceUrl - the source URL from which the links were extractedcontext - the WebCrawlingContext.WebCrawlerExceptionpublic boolean allowRedirectLink(java.lang.String url,
java.lang.String originalUrl,
WebCrawlingContext context)
throws WebCrawlerException
LinkFilterallowRedirectLink in interface LinkFilterurl - a String containing the link to be checkedoriginalUrl - the original URL that was redirected.context - the WebCrawlingContext.WebCrawlerExceptionpublic void setJobRunDataProvider(JobRunDataProvider jobRunDataProvider)
public void unsetJobRunDataProvider(JobRunDataProvider jobRunDataProvider)