org.apache.droids.robot.crawler
Class CrawlingDroid

java.lang.Object
  extended by org.apache.droids.helper.Loggable
      extended by org.apache.droids.AbstractDroid<Link>
          extended by org.apache.droids.robot.crawler.CrawlingDroid
All Implemented Interfaces:
Droid<Link>

public class CrawlingDroid
extends AbstractDroid<Link>


Field Summary
 
Fields inherited from class org.apache.droids.AbstractDroid
queue, taskMaster
 
Fields inherited from class org.apache.droids.helper.Loggable
log
 
Constructor Summary
CrawlingDroid(TaskQueue<Link> queue, TaskMaster<Link> taskMaster)
           
 
Method Summary
 void finished()
          Invoke when the droid has completed
 URLFiltersFactory getFiltersFactory()
           
 HandlerFactory getHandlerFactory()
           
 CrawlingWorker getNewWorker()
          Ask the droid for a new worker
 ParserFactory getParserFactory()
           
 ProtocolFactory getProtocolFactory()
           
 void init()
          Initialize the queue.
static void main(java.lang.String[] args)
           
 void setFiltersFactory(URLFiltersFactory filtersFactory)
           
 void setHandlerFactory(HandlerFactory handlerFactory)
           
 void setInitialLocations(java.util.Collection<java.lang.String> initialLocations)
           
 void setParserFactory(ParserFactory parserFactory)
           
 void setProtocolFactory(ProtocolFactory protocolFactory)
           
 void start()
          Invoke an instance of the worker used in the droid
 
Methods inherited from class org.apache.droids.AbstractDroid
getQueue, getTaskMaster
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrawlingDroid

public CrawlingDroid(TaskQueue<Link> queue,
                     TaskMaster<Link> taskMaster)
Method Detail

setInitialLocations

public void setInitialLocations(java.util.Collection<java.lang.String> initialLocations)

init

public void init()
          throws InvalidTaskException
Description copied from interface: Droid
Initialize the queue. Can have different implementation but the main groups normally are
  1. add only one url, from which we then start crawling
  2. add an array of start urls and then crawl them
  3. add an array of urls as fixed subset (no further crawling done)

    Throws:
    InvalidTaskException

start

public void start()
Description copied from interface: Droid
Invoke an instance of the worker used in the droid

Specified by:
start in interface Droid<Link>
Overrides:
start in class AbstractDroid<Link>

finished

public void finished()
Description copied from interface: Droid
Invoke when the droid has completed


getNewWorker

public CrawlingWorker getNewWorker()
Description copied from interface: Droid
Ask the droid for a new worker


getProtocolFactory

public ProtocolFactory getProtocolFactory()

setProtocolFactory

public void setProtocolFactory(ProtocolFactory protocolFactory)

getParserFactory

public ParserFactory getParserFactory()

setParserFactory

public void setParserFactory(ParserFactory parserFactory)

getHandlerFactory

public HandlerFactory getHandlerFactory()

setHandlerFactory

public void setHandlerFactory(HandlerFactory handlerFactory)

getFiltersFactory

public URLFiltersFactory getFiltersFactory()

setFiltersFactory

public void setFiltersFactory(URLFiltersFactory filtersFactory)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007-2009. All Rights Reserved.