Package org.dspace.statistics.util
Interface SpiderDetectorService
- All Known Implementing Classes:
SpiderDetectorServiceImpl
public interface SpiderDetectorService
Interface to implement a SpiderDetectorService.
- Author:
- frederic at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptiongetTable()booleanisSpider(jakarta.servlet.http.HttpServletRequest request) Service Method for testing spiders against existing spider files.booleanCheck individual IP is a spider.booleanService Method for testing spiders against existing spider files.voidLoader to populate the IP address table from files.readPatterns(File patternFile) Utility method which reads lines from a file & returns them in a Set.
-
Method Details
-
isSpider
Service Method for testing spiders against existing spider files.- Parameters:
clientIP- 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.- Returns:
- true if the client matches any spider characteristics list.
-
isSpider
boolean isSpider(jakarta.servlet.http.HttpServletRequest request) Service Method for testing spiders against existing spider files.- Parameters:
request- the current HTTP request.- Returns:
- true|false if the request was detected to be from a spider.
-
isSpider
Check individual IP is a spider.- Parameters:
ip- the IP address to be checked.- Returns:
- if is spider IP
-
loadSpiderIpAddresses
void loadSpiderIpAddresses()Loader to populate the IP address table from files. -
readPatterns
Utility method which reads lines from a file & returns them in a Set.- Parameters:
patternFile- the location of our spider file- Returns:
- a vector full of patterns
- Throws:
IOException- could not happen since we check the file be4 we use it
-
getTable
IPTable getTable()- Returns:
- the table of IP net blocks.
-