org.archive.wayback.webapp
Class AccessPoint

java.lang.Object
  extended by org.archive.wayback.util.webapp.AbstractRequestHandler
      extended by org.archive.wayback.webapp.AccessPoint
All Implemented Interfaces:
RequestHandler, ShutdownListener, org.springframework.beans.factory.BeanNameAware

public class AccessPoint
extends AbstractRequestHandler
implements ShutdownListener

Retains all information about a particular Wayback configuration within a ServletContext, including holding references to the implementation instances of the primary Wayback classes: RequestParser ResourceIndex(via WaybackCollection) ResourceStore(via WaybackCollection) QueryRenderer ReplayDispatcher ExceptionRenderer ResultURIConverter

Version:
$Date: 2010-10-01 23:20:35 +0700 (Fri, 01 Oct 2010) $, $Revision: 3265 $
Author:
brad

Field Summary
static String INTERSTITIAL_JSP
          webapp relative location of Interstitial.jsp
static String INTERSTITIAL_SECONDS
          argument for Interstitial.jsp seconds to delay
static String INTERSTITIAL_TARGET
          argument for Interstitial.jsp target URL
 
Constructor Summary
AccessPoint()
           
 
Method Summary
protected  boolean dispatchLocal(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
           
 BooleanOperator<WaybackRequest> getAuthentication()
           
 WaybackCollection getCollection()
           
 Properties getConfigs()
           
 ExceptionRenderer getException()
           
 ExclusionFilterFactory getExclusionFactory()
           
 List<String> getFilePatterns()
           
 List<String> getFilePrefixes()
           
 String getInterstitialJsp()
           
 String getLiveWebPrefix()
           
 Locale getLocale()
           
 RequestParser getParser()
           
 QueryRenderer getQuery()
           
 String getQueryPrefix()
           
 String getRefererAuth()
           
 ReplayDispatcher getReplay()
           
 String getReplayPrefix()
           
 String getStaticPrefix()
           
 ResultURIConverter getUriConverter()
           
 String getUrlRoot()
          Deprecated. use getQueryPrefix, getReplayPrefix, getStaticPrefix
 boolean handleRequest(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Possibly handle an incoming HttpServletRequest, much like a normal HttpServlet, but includes a return value.
 boolean isBounceToQueryPrefix()
           
 boolean isBounceToReplayPrefix()
           
 boolean isExactHostMatch()
           
 boolean isExactSchemeMatch()
           
 boolean isServeStatic()
           
 boolean isUseAnchorWindow()
           
 boolean isUseServerName()
          Deprecated. no longer used, use {replay,query,static}Prefix
 void setAuthentication(BooleanOperator<WaybackRequest> auth)
           
 void setBounceToQueryPrefix(boolean bounceToQueryPrefix)
           
 void setBounceToReplayPrefix(boolean bounceToReplayPrefix)
           
 void setCollection(WaybackCollection collection)
           
 void setConfigs(Properties configs)
           
 void setExactHostMatch(boolean exactHostMatch)
           
 void setExactSchemeMatch(boolean exactSchemeMatch)
           
 void setException(ExceptionRenderer exception)
           
 void setExclusionFactory(ExclusionFilterFactory exclusionFactory)
           
 void setFilePatterns(List<String> filePatterns)
           
 void setFilePrefixes(List<String> filePrefixes)
           
 void setInterstitialJsp(String interstitialJsp)
           
 void setLiveWebPrefix(String liveWebPrefix)
           
 void setLocale(Locale locale)
           
 void setParser(RequestParser parser)
           
 void setQuery(QueryRenderer query)
           
 void setQueryPrefix(String queryPrefix)
           
 void setRefererAuth(String refererAuth)
           
 void setReplay(ReplayDispatcher replay)
           
 void setReplayPrefix(String replayPrefix)
           
 void setServeStatic(boolean serveStatic)
           
 void setStaticPrefix(String staticPrefix)
           
 void setUriConverter(ResultURIConverter uriConverter)
           
 void setUrlRoot(String urlRoot)
          Deprecated. use setQueryPrefix, setReplayPrefix, setStaticPrefix
 void setUseAnchorWindow(boolean useAnchorWindow)
           
 void setUseServerName(boolean useServerName)
          Deprecated. no longer used, use {replay,query,static}Prefix
 void shutdown()
          Release any resources associated with this AccessPoint, including stopping any background processing threads
 
Methods inherited from class org.archive.wayback.util.webapp.AbstractRequestHandler
getBeanName, getMapParam, getMapParamOrEmpty, getRequiredMapParam, getServletContext, registerPortListener, setBeanName, setServletContext, translateRequestPath, translateRequestPathQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERSTITIAL_JSP

public static final String INTERSTITIAL_JSP
webapp relative location of Interstitial.jsp

See Also:
Constant Field Values

INTERSTITIAL_TARGET

public static final String INTERSTITIAL_TARGET
argument for Interstitial.jsp target URL

See Also:
Constant Field Values

INTERSTITIAL_SECONDS

public static final String INTERSTITIAL_SECONDS
argument for Interstitial.jsp seconds to delay

See Also:
Constant Field Values
Constructor Detail

AccessPoint

public AccessPoint()
Method Detail

dispatchLocal

protected boolean dispatchLocal(javax.servlet.http.HttpServletRequest httpRequest,
                                javax.servlet.http.HttpServletResponse httpResponse)
                         throws javax.servlet.ServletException,
                                IOException
Throws:
javax.servlet.ServletException
IOException

handleRequest

public boolean handleRequest(javax.servlet.http.HttpServletRequest httpRequest,
                             javax.servlet.http.HttpServletResponse httpResponse)
                      throws javax.servlet.ServletException,
                             IOException
Description copied from interface: RequestHandler
Possibly handle an incoming HttpServletRequest, much like a normal HttpServlet, but includes a return value.

Specified by:
handleRequest in interface RequestHandler
Parameters:
httpRequest - HttpServletRequest which is being handled
httpResponse - HttpServletResponse which is being handled
Returns:
true if the request was actually handled
Throws:
javax.servlet.ServletException - per usual
IOException - per usual

shutdown

public void shutdown()
Release any resources associated with this AccessPoint, including stopping any background processing threads

Specified by:
shutdown in interface ShutdownListener

isExactHostMatch

public boolean isExactHostMatch()
Returns:
the exactHostMatch

setExactHostMatch

public void setExactHostMatch(boolean exactHostMatch)
Parameters:
exactHostMatch - if true, then only SearchResults exactly matching the requested hostname will be returned from this AccessPoint. If false, then hosts which canonicalize to the same host as requested hostname will be returned (www.)

isExactSchemeMatch

public boolean isExactSchemeMatch()
Returns:
the exactSchemeMatch

setExactSchemeMatch

public void setExactSchemeMatch(boolean exactSchemeMatch)
Parameters:
exactSchemeMatch - the exactSchemeMatch to set

isUseAnchorWindow

public boolean isUseAnchorWindow()
Returns:
true if this AccessPoint is configured to useAnchorWindow, that is, to replay documents only if they are within a certain proximity to the users requested AnchorDate

setUseAnchorWindow

public void setUseAnchorWindow(boolean useAnchorWindow)
Parameters:
useAnchorWindow - , when set to true, causes this AccessPoint to only replay documents if they are within a certain proximity to the users requested AnchorDate

isUseServerName

public boolean isUseServerName()
Deprecated. no longer used, use {replay,query,static}Prefix

Returns:
the useServerName

setUseServerName

public void setUseServerName(boolean useServerName)
Deprecated. no longer used, use {replay,query,static}Prefix

Parameters:
useServerName - the useServerName to set

isServeStatic

public boolean isServeStatic()
Returns:
true if this AccessPoint serves static content

setServeStatic

public void setServeStatic(boolean serveStatic)
Parameters:
serveStatic - if set to true, this AccessPoint will serve static content, and .jsp files

getLiveWebPrefix

public String getLiveWebPrefix()
Returns:
the liveWebPrefix String to use, or null, if this AccessPoint does not use the Live Web to fill in documents missing from the archive

setLiveWebPrefix

public void setLiveWebPrefix(String liveWebPrefix)
Parameters:
liveWebPrefix - the String URL prefix to use to attempt to retrieve documents missing from the collection from the live web, on demand.

getStaticPrefix

public String getStaticPrefix()
Returns:
the String url prefix to use when generating self referencing static URLs

setStaticPrefix

public void setStaticPrefix(String staticPrefix)
Parameters:
staticPrefix - explicit URL prefix to use when creating self referencing static URLs

getReplayPrefix

public String getReplayPrefix()
Returns:
the String url prefix to use when generating self referencing replay URLs

setReplayPrefix

public void setReplayPrefix(String replayPrefix)
Parameters:
replayPrefix - explicit URL prefix to use when creating self referencing replay URLs

setQueryPrefix

public void setQueryPrefix(String queryPrefix)
Parameters:
queryPrefix - explicit URL prefix to use when creating self referencing query URLs

getQueryPrefix

public String getQueryPrefix()
Returns:
the String url prefix to use when generating self referencing replay URLs

setInterstitialJsp

public void setInterstitialJsp(String interstitialJsp)
Parameters:
interstitialJsp - the interstitialJsp to set

getInterstitialJsp

public String getInterstitialJsp()
Returns:
the interstitialJsp

setUrlRoot

public void setUrlRoot(String urlRoot)
Deprecated. use setQueryPrefix, setReplayPrefix, setStaticPrefix

Parameters:
urlRoot - explicit URL prefix to use when creating ANY self referencing URLs

getUrlRoot

public String getUrlRoot()
Deprecated. use getQueryPrefix, getReplayPrefix, getStaticPrefix

Returns:
the String url prefix used when generating self referencing URLs

getLocale

public Locale getLocale()
Returns:
explicit Locale to use within this AccessPoint.

setLocale

public void setLocale(Locale locale)
Parameters:
locale - explicit Locale to use for requests within this AccessPoint. If not set, will attempt to use the one specified by each requests User Agent via HTTP headers

getConfigs

public Properties getConfigs()
Returns:
the generic customization Properties used with this AccessPoint, generally to tune the UI

setConfigs

public void setConfigs(Properties configs)
Parameters:
configs - the generic customization Properties to use with this AccessPoint, generally used to tune the UI

getFilePatterns

public List<String> getFilePatterns()
Returns:
List of file patterns that will be matched when querying the ResourceIndex

setFilePatterns

public void setFilePatterns(List<String> filePatterns)
Parameters:
filePatterns - List of file Patterns (regular expressions) that will be matched when querying the ResourceIndex - only SearchResults matching one of these patterns will be returned.

getFilePrefixes

public List<String> getFilePrefixes()
Returns:
List of file String prefixes that will be matched when querying the ResourceIndex

setFilePrefixes

public void setFilePrefixes(List<String> filePrefixes)
Parameters:
filePrefixes - List of String file prefixes that will be matched when querying the ResourceIndex - only SearchResults from files with a prefix matching one of those in this List will be returned.

getCollection

public WaybackCollection getCollection()
Returns:
the WaybackCollection used by this AccessPoint

setCollection

public void setCollection(WaybackCollection collection)
Parameters:
collection - the WaybackCollection to use with this AccessPoint

getException

public ExceptionRenderer getException()
Returns:
the ExceptionRenderer in use with this AccessPoint

setException

public void setException(ExceptionRenderer exception)
Parameters:
exception - the ExceptionRender to use with this AccessPoint

getQuery

public QueryRenderer getQuery()
Returns:
the QueryRenderer to use with this AccessPoint

setQuery

public void setQuery(QueryRenderer query)
Parameters:
query - the QueryRenderer responsible for returning query data to clients.

getParser

public RequestParser getParser()
Returns:
the RequestParser used by this AccessPoint to attempt to translate incoming HttpServletRequest objects into WaybackRequest objects

setParser

public void setParser(RequestParser parser)
Parameters:
parser - the RequestParser to use with this AccessPoint

getReplay

public ReplayDispatcher getReplay()
Returns:
the ReplayDispatcher to use with this AccessPoint, responsible for returning an appropriate ReplayRenderer given the user request and the returned document type.

setReplay

public void setReplay(ReplayDispatcher replay)
Parameters:
replay - the ReplayDispatcher to use with this AccessPoint.

getUriConverter

public ResultURIConverter getUriConverter()
Returns:
the ResultURIConverter used to construct Replay URLs within this AccessPoint

setUriConverter

public void setUriConverter(ResultURIConverter uriConverter)
Parameters:
uriConverter - the ResultURIConverter to use with this AccessPoint to construct Replay URLs

getExclusionFactory

public ExclusionFilterFactory getExclusionFactory()
Returns:
the ExclusionFilterFactory in use with this AccessPoint

setExclusionFactory

public void setExclusionFactory(ExclusionFilterFactory exclusionFactory)
Parameters:
exclusionFactory - all requests to this AccessPoint will create an exclusionFilter from this factory when handling requests

getAuthentication

public BooleanOperator<WaybackRequest> getAuthentication()
Returns:
the configured AuthenticationControl BooleanOperator in use with this AccessPoint.

setAuthentication

public void setAuthentication(BooleanOperator<WaybackRequest> auth)
Parameters:
auth - the BooleanOperator which determines if incoming requests are allowed to connect to this AccessPoint.

getRefererAuth

public String getRefererAuth()
Returns:
the refererAuth

setRefererAuth

public void setRefererAuth(String refererAuth)
Parameters:
refererAuth - the refererAuth to set

isBounceToReplayPrefix

public boolean isBounceToReplayPrefix()
Returns:
the bounceToReplayPrefix

setBounceToReplayPrefix

public void setBounceToReplayPrefix(boolean bounceToReplayPrefix)
Parameters:
bounceToReplayPrefix - the bounceToReplayPrefix to set

isBounceToQueryPrefix

public boolean isBounceToQueryPrefix()
Returns:
the bounceToQueryPrefix

setBounceToQueryPrefix

public void setBounceToQueryPrefix(boolean bounceToQueryPrefix)
Parameters:
bounceToQueryPrefix - the bounceToQueryPrefix to set


Copyright © 2005-2011 Internet Archive. All Rights Reserved.