org.erowid.sperowider.simple
Interface ISimpleSpiderModel

All Known Implementing Classes:
SimpleSpiderModel, SperowiderModel

public interface ISimpleSpiderModel

The interface for the model that the SimpleSpider uses.

Version:
: $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/simple/ISimpleSpiderModel.java,v 1.2 2005/01/16 06:47:27 gurustu Exp $
Author:
: $Author: gurustu $

Method Summary
 void addFoundURL(String foundIn, String found)
          Proposes a URL for future parsing.
 void destroy()
          Called by the Sperowider to close all open resources
 List getFoundURLs(String sourceURL)
          Returns a List of String objects that are the URLs that the passed in URL reference.
 Collection getInvalidURLs()
          Returns the list of invalid URLs
 List getSourceURLs(String foundURL)
          Returns a List of String objects that are the URLs in which the passed in URL is found.
 int getSpiderQueueSize()
          The number of URLs left in the queue.
 String getUnspideredUrl()
          Returns a URL for parsing.
 boolean isSpiderMapSupported()
          Implementing classes should return true if they are capable of handling calls to getSourceURLs(String) and getFoundURLs(String), false otherwise.
 void markInvalidURL(String givenURL, int responseCode, String message)
          Mark a URL as invalid
 

Method Detail

addFoundURL

public void addFoundURL(String foundIn,
                        String found)
Proposes a URL for future parsing.


getUnspideredUrl

public String getUnspideredUrl()
Returns a URL for parsing. If that URL redirects, it should be discarded.


getSpiderQueueSize

public int getSpiderQueueSize()
The number of URLs left in the queue.


markInvalidURL

public void markInvalidURL(String givenURL,
                           int responseCode,
                           String message)
Mark a URL as invalid


getSourceURLs

public List getSourceURLs(String foundURL)
                   throws UnsupportedOperationException
Returns a List of String objects that are the URLs in which the passed in URL is found. This is especially useful in circumstances when you want to know what pages a specific URL was referenced from.

This is expensive data to track, so models can throw the UnsupportedOperationException rather than return a valid value. Those models that do throw the exception should return false for isSpiderMapSupported().

Throws:
UnsupportedOperationException - If the model does not support this method

getFoundURLs

public List getFoundURLs(String sourceURL)
                  throws UnsupportedOperationException
Returns a List of String objects that are the URLs that the passed in URL reference.

This is expensive data to track, so models can throw the UnsupportedOperationException rather than return a valid value. Those models that do throw the exception should return false for isSpiderMapSupported().

Throws:
UnsupportedOperationException - If the model does not support this method

isSpiderMapSupported

public boolean isSpiderMapSupported()
Implementing classes should return true if they are capable of handling calls to getSourceURLs(String) and getFoundURLs(String), false otherwise.


getInvalidURLs

public Collection getInvalidURLs()
Returns the list of invalid URLs


destroy

public void destroy()
Called by the Sperowider to close all open resources


spero logo small Sperowider is
© 2005 Erowid.org