Interface SpiderDetectorService

All Known Implementing Classes:
SpiderDetectorServiceImpl

public interface SpiderDetectorService
Interface to implement a SpiderDetectorService.
Author:
frederic at atmire.com
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    isSpider(jakarta.servlet.http.HttpServletRequest request)
    Service Method for testing spiders against existing spider files.
    boolean
    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
    Loader 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

      boolean isSpider(String clientIP, String proxyIPs, String hostname, String agent)
      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

      boolean isSpider(String ip)
      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

      Set<String> readPatterns(File patternFile) throws IOException
      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.