public class SpiderDetectorServiceImpl extends Object implements SpiderDetectorService
| Constructor and Description |
|---|
SpiderDetectorServiceImpl(ConfigurationService configurationService) |
| Modifier and Type | Method and Description |
|---|---|
IPTable |
getTable() |
boolean |
isSpider(javax.servlet.http.HttpServletRequest request)
Service Method for testing spiders against existing spider files.
|
boolean |
isSpider(String ip)
Check individual IP is a spider.
|
boolean |
isSpider(String clientIP,
String proxyIPs,
String hostname,
String agent)
Service Method for testing spiders against existing spider files.
|
void |
loadSpiderIpAddresses() |
Set<String> |
readPatterns(File patternFile)
Utility method which reads lines from a file & returns them in a Set.
|
@Autowired(required=true) public SpiderDetectorServiceImpl(ConfigurationService configurationService)
public IPTable getTable()
getTable in interface SpiderDetectorServicepublic boolean isSpider(String clientIP, String proxyIPs, String hostname, String agent)
In future spiders HashSet may be optimized as byte offset array to improve performance and memory footprint further.
isSpider in interface SpiderDetectorServiceclientIP - address of the client.proxyIPs - comma-list of X-Forwarded-For addresses, or null.hostname - domain name of host, or null.agent - User-Agent header value, or null.public Set<String> readPatterns(File patternFile) throws IOException
readPatterns in interface SpiderDetectorServicepatternFile - the location of our spider fileIOException - could not happen since we check the file be4 we use itpublic boolean isSpider(javax.servlet.http.HttpServletRequest request)
isSpider in interface SpiderDetectorServicerequest - public boolean isSpider(String ip)
isSpider in interface SpiderDetectorServiceip - public void loadSpiderIpAddresses()
loadSpiderIpAddresses in interface SpiderDetectorServiceCopyright © 2022 LYRASIS. All rights reserved.