org.niocchi.urlpools
Class SimpleFileURLPool

java.lang.Object
  extended by org.niocchi.urlpools.SimpleFileURLPool
All Implemented Interfaces:
URLPool

public class SimpleFileURLPool
extends java.lang.Object
implements URLPool

A simple URL pool that read URL from a file, one URL per line.


Constructor Summary
SimpleFileURLPool(java.lang.String path_)
           
 
Method Summary
 Query getNextQuery()
           
 boolean hasNextQuery()
           
 void setProcessed(Query resource_)
          This method is called by the crawler when the query has been processed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileURLPool

public SimpleFileURLPool(java.lang.String path_)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

hasNextQuery

public boolean hasNextQuery()
Specified by:
hasNextQuery in interface URLPool
Returns:
true if there is at least one query to crawl (i.e. getNextQuery will return a query at some point), false if no more queries to crawl (a call to getNextQuery will throw an URLPoolException).

setProcessed

public void setProcessed(Query resource_)
Description copied from interface: URLPool
This method is called by the crawler when the query has been processed. That gives the oportunity to the url pool to implement specific behaviors (for instance, send back the query to the crawler if it got a timeout.

Specified by:
setProcessed in interface URLPool

getNextQuery

public Query getNextQuery()
                   throws URLPoolException
Specified by:
getNextQuery in interface URLPool
Returns:
null if no query is yet available, otherwise return a Query. Throws URLPoolException is no query will be available (a call to hasNextQuery() must returns false).
Throws:
URLPoolException