org.dspace.statistics.util
Class SpiderDetector

java.lang.Object
  extended by org.dspace.statistics.util.SpiderDetector

public class SpiderDetector
extends Object

SpiderDetector is used to find IP's that are spiders... In future someone may add UserAgents and Host Domains to the detection criteria here.

Author:
kevinvandevelde at atmire.com, ben at atmire.com, Mark Diggory (mdiggory at atmire.com)

Constructor Summary
SpiderDetector()
           
 
Method Summary
static Set<String> getSpiderIpAddresses()
          Get an immutable Set representing all the Spider Addresses here.
static boolean isSpider(javax.servlet.http.HttpServletRequest request)
          Static Service Method for testing spiders against existing spider files.
static boolean isSpider(String ip)
          Check individual IP is a spider.
static Set<String> readIpAddresses(File spiderIpFile)
          Utility method which Reads the ip addresses out a file & returns them in a Set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpiderDetector

public SpiderDetector()
Method Detail

readIpAddresses

public static Set<String> readIpAddresses(File spiderIpFile)
                                   throws IOException
Utility method which Reads the ip addresses out a file & returns them in a Set

Parameters:
spiderIpFile - the location of our spider file
Returns:
a vector full of ip's
Throws:
IOException - could not happen since we check the file be4 we use it

getSpiderIpAddresses

public static Set<String> getSpiderIpAddresses()
Get an immutable Set representing all the Spider Addresses here.


isSpider

public static boolean isSpider(javax.servlet.http.HttpServletRequest request)
Static Service Method for testing spiders against existing spider files.

In the future this will be extended to support User Agent and domain Name detection.

In future spiders HashSet may be optimized as byte offset array to improve performance and memory footprint further.

Parameters:
request -
Returns:
true|false if the request was detected to be from a spider

isSpider

public static boolean isSpider(String ip)
Check individual IP is a spider.

Parameters:
ip -
Returns:
if is spider IP


Copyright © 2012 DuraSpace. All Rights Reserved.