org.apache.droids.robot.walker
Class SimpleWalkingDroid

java.lang.Object
  extended by org.apache.droids.helper.Loggable
      extended by org.apache.droids.AbstractDroid<FileTask>
          extended by org.apache.droids.robot.walker.SimpleWalkingDroid
All Implemented Interfaces:
Droid<FileTask>, WalkingDroid

public class SimpleWalkingDroid
extends AbstractDroid<FileTask>
implements WalkingDroid


Field Summary
 
Fields inherited from class org.apache.droids.AbstractDroid
queue, taskMaster
 
Fields inherited from class org.apache.droids.helper.Loggable
log
 
Constructor Summary
SimpleWalkingDroid(TaskQueue<FileTask> queue, TaskMaster<FileTask> taskMaster)
           
 
Method Summary
 void finished()
          Invoke when the droid has completed
 FileWorker getNewWorker()
          Ask the droid for a new worker
 void init()
          Initialize the queue.
static void main(java.lang.String[] args)
           
 void setInitialFiles(java.util.Collection<java.io.File> initialFiles)
           
 
Methods inherited from class org.apache.droids.AbstractDroid
getQueue, getTaskMaster, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.droids.api.Droid
getTaskMaster, start
 

Constructor Detail

SimpleWalkingDroid

public SimpleWalkingDroid(TaskQueue<FileTask> queue,
                          TaskMaster<FileTask> taskMaster)
Method Detail

setInitialFiles

public void setInitialFiles(java.util.Collection<java.io.File> initialFiles)
Specified by:
setInitialFiles in interface WalkingDroid

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)

    Specified by:
    init in interface Droid<FileTask>
    Throws:
    InvalidTaskException

finished

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

Specified by:
finished in interface Droid<FileTask>

getNewWorker

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

Specified by:
getNewWorker in interface Droid<FileTask>
Specified by:
getNewWorker in interface WalkingDroid

main

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


Copyright © 2007-2009. All Rights Reserved.