org.erowid.sperowider
Class SperowiderContext

java.lang.Object
  extended byorg.erowid.sperowider.SperowiderContext

public class SperowiderContext
extends Object

This class holds references to all of the high level "global" objects used in Sperowider. The following methods must be called with valid components before this class can be used :

Once all of these are called, isInitialized() will return true. Objects of this class should not be used for any functionality until isInitialized() returns true.

Version:
: $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/SperowiderContext.java,v 1.16 2005/06/02 06:07:58 gurustu Exp $
Author:
: $Author: gurustu $

Constructor Summary
SperowiderContext()
          Creates a new SperowiderContext.
 
Method Summary
 void addURLToModel(String sourceURL, URL foundURL)
          All requests to add URLs to the queue come through here, so we do the filtering and logging at this point.
 String getDownloadRoot()
           
 FileNameManager getFileNameManager()
           
 HandlerPool getHandlerPool()
           
 int getIndexLimit()
          Returns the number of characters to be indexed.
 ISperowiderModel getSperowiderModel()
           
 IThrottle getThrottle()
           
 ISperowiderFilter getURLFilter()
           
 boolean isCompressIndex()
          Returns the compressIndex.
 boolean isInitialized()
          Returns true if all sets have been called appropriately.
 void setCompressIndex(boolean compressIndex)
          Sets the compressIndex.
 void setDownloadRoot(String downloadRoot)
           
 void setFileNameManager(FileNameManager fileNameManager)
           
 void setHandlerPool(HandlerPool handlerPool)
           
 void setIndexLimit(int indexLimit)
          Sets the number of characters to be indexed.
 void setSperowiderModel(ISperowiderModel sperowiderModel)
           
 void setThrottle(IThrottle throttle)
           
 void setURLFilter(ISperowiderFilter filter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SperowiderContext

public SperowiderContext()
                  throws SperowiderInstantiationException
Creates a new SperowiderContext.

Method Detail

isInitialized

public boolean isInitialized()
Returns true if all sets have been called appropriately.


getSperowiderModel

public ISperowiderModel getSperowiderModel()
Returns:
Returns the sperowiderModel.

setSperowiderModel

public void setSperowiderModel(ISperowiderModel sperowiderModel)
Parameters:
sperowiderModel - The sperowiderModel to set.

getURLFilter

public ISperowiderFilter getURLFilter()
Returns:
Returns the uRLFilter.

setURLFilter

public void setURLFilter(ISperowiderFilter filter)
Parameters:
filter - The uRLFilter to set.

getHandlerPool

public HandlerPool getHandlerPool()
Returns:
Returns the handlerPool.

setHandlerPool

public void setHandlerPool(HandlerPool handlerPool)
Parameters:
handlerPool - The handlerPool to set.

getFileNameManager

public FileNameManager getFileNameManager()
Returns:
Returns the fileNameManager.

setFileNameManager

public void setFileNameManager(FileNameManager fileNameManager)
Parameters:
fileNameManager - The fileNameManager to set.

getThrottle

public IThrottle getThrottle()
Returns:
Returns the throttle.

setThrottle

public void setThrottle(IThrottle throttle)
Parameters:
throttle - The throttle to set.

getDownloadRoot

public String getDownloadRoot()
Returns:
Returns the downloadRoot.

setDownloadRoot

public void setDownloadRoot(String downloadRoot)
Parameters:
downloadRoot - The downloadRoot to set.

addURLToModel

public void addURLToModel(String sourceURL,
                          URL foundURL)
All requests to add URLs to the queue come through here, so we do the filtering and logging at this point.


getIndexLimit

public int getIndexLimit()
Returns the number of characters to be indexed. If all characters are to be indexed, a -1 will be returned.


setIndexLimit

public void setIndexLimit(int indexLimit)
Sets the number of characters to be indexed. If all characters are to be indexed, set this to -1.


isCompressIndex

public boolean isCompressIndex()
Returns the compressIndex.


setCompressIndex

public void setCompressIndex(boolean compressIndex)
Sets the compressIndex.


spero logo small Sperowider is
© 2005 Erowid.org