scone.robot
Interface URLQueue

All Known Implementing Classes:
BreadthSearchURLQueue, DepthSearchURLQueue, FairBreadthSearchURLQueue, GenericURLQueue

public interface URLQueue

This interface defines the functionaltity needed for the url queue. Different serving strategies can be defined by writing a class which implements this interface

Author:
Frank Wollenweber

Method Summary
 QueueEntry dequeue()
          Get the next entry from the queue
 int getNumberOfPendingQueueEntries(RobotTask robotTask)
          Get the number of entries belonging to the robotTask
 int getNumberOfPendingQueueEntries(SimpleUri uri)
          The number of queueEntries from different tasks waiting to download this url
 java.util.Vector getPendingQueueEntries(RobotTask robotTask)
          Get vector with all entries belonging to the robotTask
 java.util.Vector getPendingQueueEntries(SimpleUri uri)
          The vector with all queueEntries from different tasks waiting to download this url
 QueueEntry getPendingURL(SimpleUri uri, RobotTask robotTask)
          Get the entry belonging to robotTask and waiting to download url
 boolean isPendingURL(SimpleUri uri, RobotTask robotTask)
          Checks, if there is an entry belonging to robotTask, which is waiting to download url
 void queue(QueueEntry qe)
          Adds a new entry to the queue
 void removeAllQueueEntries(RobotTask robotTask)
          Remove all queueEntries belonging to this task
 void removeQueueEntry(QueueEntry qe)
          Remove the an entrie from the queue
 int size()
          Get the number of entries waiting in the queue
 

Method Detail

queue

void queue(QueueEntry qe)
Adds a new entry to the queue

Parameters:
qe - The new entry

dequeue

QueueEntry dequeue()
Get the next entry from the queue

Returns:
The next entry

size

int size()
Get the number of entries waiting in the queue

Returns:
Number of elements

getNumberOfPendingQueueEntries

int getNumberOfPendingQueueEntries(RobotTask robotTask)
Get the number of entries belonging to the robotTask

Parameters:
robotTask - only entries of this task are counted
Returns:
Number of entries

getPendingQueueEntries

java.util.Vector getPendingQueueEntries(RobotTask robotTask)
Get vector with all entries belonging to the robotTask

Parameters:
robotTask - only entries of this task are added to the vector
Returns:
Vector with queueEntries

removeAllQueueEntries

void removeAllQueueEntries(RobotTask robotTask)
Remove all queueEntries belonging to this task

Parameters:
robotTask - only entries of this task are removed

getNumberOfPendingQueueEntries

int getNumberOfPendingQueueEntries(SimpleUri uri)
The number of queueEntries from different tasks waiting to download this url

Parameters:
url - Only queueEntries with this url are counted
Returns:
Number of entries

getPendingQueueEntries

java.util.Vector getPendingQueueEntries(SimpleUri uri)
The vector with all queueEntries from different tasks waiting to download this url

Parameters:
url - Only queueEntries with this url are added to the vector
Returns:
Vector with queueEntries

isPendingURL

boolean isPendingURL(SimpleUri uri,
                     RobotTask robotTask)
Checks, if there is an entry belonging to robotTask, which is waiting to download url

Parameters:
url - The url to check
robotTask - Only entries of this task are checked
Returns:
True, if there is an entry waiting

getPendingURL

QueueEntry getPendingURL(SimpleUri uri,
                         RobotTask robotTask)
Get the entry belonging to robotTask and waiting to download url

Parameters:
url - The url to check
robotTask - Only entries of this task are checked
Returns:
The waiting queueEntry

removeQueueEntry

void removeQueueEntry(QueueEntry qe)
Remove the an entrie from the queue

Parameters:
qe - The entry to remove