public class AccessPoint extends AbstractRequestHandler implements ShutdownListener, CollectionContext
Modifier and Type | Class and Description |
---|---|
static class |
AccessPoint.PerfStat |
protected static class |
AccessPoint.SingleLoadResourceStore
Per-request, decorating ResourceStore that throws
ResourceNotAvailableException if retrieval of the
archive has failed previously within the session. |
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_VALUE |
static String |
INTERSTITIAL_DATE
argument for Interstitial.jsp msse for replay date
|
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
|
static String |
INTERSTITIAL_URL
argument for Interstitial.jsp URL being loaded
|
static String |
REVISIT_STR |
static String |
RUNTIME_ERROR_HEADER |
Constructor and Description |
---|
AccessPoint() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkAccessPointAware(Object... os) |
protected void |
closeResources(Resource payloadResource,
Resource httpHeadersResource) |
ExclusionFilter |
createExclusionFilter()
Return new instance of
ExclusionFilter instance for this AccessPoint. |
protected boolean |
dispatchLocal(javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse) |
BooleanOperator<WaybackRequest> |
getAuthentication() |
WaybackCollection |
getCollection() |
String |
getCollectionContextName()
Default implementation returns
null . |
Properties |
getConfigs() |
long |
getEmbargoMS() |
String |
getErrorMsgHeader() |
ExceptionRenderer |
getException() |
ExclusionFilterFactory |
getExclusionFactory() |
List<String> |
getFileExcludePrefixes() |
List<String> |
getFileIncludePrefixes() |
List<String> |
getFilePatterns() |
CustomResultFilterFactory |
getFilterFactory() |
String |
getInterstitialJsp() |
String |
getLiveWebPrefix() |
LiveWebRedirector |
getLiveWebRedirector() |
Locale |
getLocale() |
int |
getMaxRedirectAttempts() |
MementoHandler |
getMementoHandler() |
RequestParser |
getParser() |
String |
getPerfStatsHeader() |
QueryRenderer |
getQuery() |
int |
getQueryCollapseTime() |
String |
getQueryPrefix() |
String |
getRefererAuth() |
ReplayDispatcher |
getReplay() |
String |
getReplayPrefix() |
String |
getRewriteDirective(CaptureSearchResult capture)
Return rewrite directive for
capture . |
RewriteDirector |
getRewriteDirector() |
UrlCanonicalizer |
getSelfRedirectCanonicalizer()
URL canonicalizer for testing self-redirect.
|
String |
getStaticPrefix() |
ResultURIConverter |
getUriConverter() |
String |
getUrlRoot()
Deprecated.
use getQueryPrefix, getReplayPrefix, getStaticPrefix
|
String |
getWarcFileHeader() |
protected void |
handleQuery(WaybackRequest wbRequest,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse) |
protected void |
handleReplay(WaybackRequest wbRequest,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse) |
protected void |
handleReplayRedirect(WaybackRequest wbRequest,
javax.servlet.http.HttpServletResponse httpResponse,
CaptureSearchResults captureResults,
CaptureSearchResult closest)
if capture
closest is of timestamp different from the one requested,
redirect to exact Archival-URL for closest . |
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.
|
void |
init() |
boolean |
isBounceToQueryPrefix() |
boolean |
isBounceToReplayPrefix() |
boolean |
isEnableErrorMsgHeader() |
boolean |
isEnableMemento() |
boolean |
isEnablePerfStatsHeader() |
boolean |
isEnableWarcFileHeader() |
boolean |
isExactHostMatch() |
boolean |
isExactSchemeMatch() |
boolean |
isFixedEmbeds() |
boolean |
isForceCleanQueries() |
boolean |
isRequestAuth() |
protected boolean |
isSelfRedirect(Resource resource,
CaptureSearchResult closest,
WaybackRequest wbRequest,
String canonRequestURL) |
boolean |
isServeStatic() |
boolean |
isTimestampSearch() |
boolean |
isUseAnchorWindow() |
boolean |
isUseServerName()
Deprecated.
no longer used, use {replay,query,static}Prefix
|
boolean |
isWaybackReferer(String referer,
String path) |
boolean |
isWaybackReferer(WaybackRequest wbRequest,
String path) |
void |
logError(javax.servlet.http.HttpServletResponse httpResponse,
String header,
Exception e,
WaybackRequest request) |
String |
makeCaptureQueryUrl(String url,
String startdate,
String enddate)
Build a self-referencing URL that will perform a query for all copies
of URL
url . |
SearchResults |
queryIndex(WaybackRequest wbRequest) |
protected CaptureSearchResult |
retrievePayloadForIdenticalContentRevisit(WaybackRequest currRequest,
Resource revisitRecord,
CaptureSearchResult closest)
If closest
|
protected CaptureSearchResults |
searchCaptures(WaybackRequest wbr) |
void |
setAuthentication(BooleanOperator<WaybackRequest> auth) |
void |
setBounceToQueryPrefix(boolean bounceToQueryPrefix) |
void |
setBounceToReplayPrefix(boolean bounceToReplayPrefix) |
void |
setCollection(WaybackCollection collection) |
void |
setConfigs(Properties configs) |
void |
setEmbargoMS(long ms) |
void |
setEnableErrorMsgHeader(boolean enableErrorMsgHeader) |
void |
setEnableMemento(boolean enableMemento) |
void |
setEnablePerfStatsHeader(boolean enablePerfStatsHeader) |
void |
setEnableWarcFileHeader(boolean enableWarcFileHeader) |
void |
setErrorMsgHeader(String errorMsgHeader) |
void |
setExactHostMatch(boolean exactHostMatch) |
void |
setExactSchemeMatch(boolean exactSchemeMatch) |
void |
setException(ExceptionRenderer exception) |
void |
setExclusionFactory(ExclusionFilterFactory exclusionFactory) |
void |
setFileExcludePrefixes(List<String> fileExcludePrefixes) |
void |
setFileIncludePrefixes(List<String> fileIncludePrefixes) |
void |
setFilePatterns(List<String> filePatterns) |
void |
setFilterFactory(CustomResultFilterFactory filterFactory)
CustomResultFilterFactory to be applied on CDX query result. |
void |
setFixedEmbeds(boolean fixedEmbeds) |
void |
setForceCleanQueries(boolean forceCleanQueries) |
void |
setInterstitialJsp(String interstitialJsp) |
void |
setLiveWebPrefix(String liveWebPrefix) |
void |
setLiveWebRedirector(LiveWebRedirector liveWebRedirector) |
void |
setLocale(Locale locale) |
void |
setMaxRedirectAttempts(int maxRedirectAttempts) |
void |
setMementoHandler(MementoHandler mementoHandler) |
void |
setParser(RequestParser parser) |
void |
setPerfStatsHeader(String perfStatsHeader) |
void |
setPerfStatsHeaderFormat(PerfStats.OutputFormat perfStatsHeaderFormat)
Format of profiling header field.
|
void |
setQuery(QueryRenderer query) |
void |
setQueryCollapseTime(int queryCollapseTime)
CDXServer
collapseTime parameter for capture query. |
void |
setQueryPrefix(String queryPrefix) |
void |
setRefererAuth(String refererAuth) |
void |
setReplay(ReplayDispatcher replay) |
void |
setReplayPrefix(String replayPrefix) |
void |
setRequestAuth(boolean requestAuth) |
void |
setRewriteDirector(RewriteDirector rewriteDirector) |
void |
setSelfRedirectCanonicalizer(UrlCanonicalizer selfRedirectCanonicalizer)
Optional
|
void |
setServeStatic(boolean serveStatic) |
void |
setStaticPrefix(String staticPrefix) |
void |
setTimestampSearch(boolean timestampSearch) |
void |
setUriConverter(ResultURIConverter uriConverter)
Refactoring: remove this method. let
getUriConverter() create
ResultURIConverter with factory (like AccessPointAdapter does). |
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 |
setWarcFileHeader(String warcFileHeader) |
void |
shutdown()
Release any resources associated with this AccessPoint, including
stopping any background processing threads
|
getAccessPointPath, getBeanName, getInternalPort, getMapParam, getMapParamOrEmpty, getRequiredMapParam, getServletContext, registerPortListener, setAccessPointPath, setBeanName, setInternalPort, setServletContext, translateRequestPath, translateRequestPathQuery
public static final String INTERSTITIAL_JSP
public static final String INTERSTITIAL_TARGET
public static final String INTERSTITIAL_SECONDS
public static final String INTERSTITIAL_DATE
public static final String INTERSTITIAL_URL
public static final String REVISIT_STR
public static final String EMPTY_VALUE
public static final String RUNTIME_ERROR_HEADER
public void init()
protected boolean dispatchLocal(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
public boolean handleRequest(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException, IOException
RequestHandler
handleRequest
in interface RequestHandler
httpRequest
- HttpServletRequest which is being handledhttpResponse
- HttpServletResponse which is being handledjavax.servlet.ServletException
- per usualIOException
- per usualpublic ExclusionFilter createExclusionFilter() throws AccessControlException
ExclusionFilter
instance for this AccessPoint.AccessControlException
- If it cannot instantiate ExclusionFilter when
it's supposed to (i.e. configured but failed to complete because of network
error etc.)public RewriteDirector getRewriteDirector()
public void setRewriteDirector(RewriteDirector rewriteDirector)
public String getRewriteDirective(CaptureSearchResult capture)
capture
.capture
- public String getCollectionContextName()
null
.getCollectionContextName
in interface CollectionContext
public void logError(javax.servlet.http.HttpServletResponse httpResponse, String header, Exception e, WaybackRequest request)
protected void checkAccessPointAware(Object... os)
protected boolean isSelfRedirect(Resource resource, CaptureSearchResult closest, WaybackRequest wbRequest, String canonRequestURL)
public SearchResults queryIndex(WaybackRequest wbRequest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException, ConfigurationException
public boolean isWaybackReferer(WaybackRequest wbRequest, String path)
protected void handleReplayRedirect(WaybackRequest wbRequest, javax.servlet.http.HttpServletResponse httpResponse, CaptureSearchResults captureResults, CaptureSearchResult closest) throws BetterRequestException
closest
is of timestamp different from the one requested,
redirect to exact Archival-URL for closest
.
Memento Timegate request is always redirected regardless of timestamp.
Needs better method name.wbRequest
- httpResponse
- captureResults
- closest
- BetterRequestException
protected void handleReplay(WaybackRequest wbRequest, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws IOException, javax.servlet.ServletException, WaybackException
IOException
javax.servlet.ServletException
WaybackException
protected CaptureSearchResults searchCaptures(WaybackRequest wbr) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException, ConfigurationException, ResourceNotAvailableException
protected CaptureSearchResult retrievePayloadForIdenticalContentRevisit(WaybackRequest currRequest, Resource revisitRecord, CaptureSearchResult closest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException, ConfigurationException, ResourceNotAvailableException
currRequest
- revisitRecord
- closest
- ResourceNotAvailableException
ConfigurationException
AccessControlException
BadQueryException
ResourceNotInArchiveException
ResourceIndexNotAvailableException
WARCRevisitAnnotationFilter
public void setQueryCollapseTime(int queryCollapseTime)
collapseTime
parameter for capture query.queryCollapseTime
- integer, negative value instructs
CDXServer to use the default value.public int getQueryCollapseTime()
protected void handleQuery(WaybackRequest wbRequest, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse) throws javax.servlet.ServletException, IOException, WaybackException
javax.servlet.ServletException
IOException
WaybackException
public void shutdown()
shutdown
in interface ShutdownListener
protected void closeResources(Resource payloadResource, Resource httpHeadersResource)
public boolean isExactHostMatch()
public void setExactHostMatch(boolean exactHostMatch)
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.)public boolean isExactSchemeMatch()
public void setExactSchemeMatch(boolean exactSchemeMatch)
exactSchemeMatch
- the exactSchemeMatch to setpublic boolean isUseAnchorWindow()
public void setUseAnchorWindow(boolean useAnchorWindow)
useAnchorWindow
- , when set to true, causes this AccessPoint to
only replay documents if they are within a certain proximity to
the users requested AnchorDatepublic boolean isUseServerName()
public void setUseServerName(boolean useServerName)
useServerName
- the useServerName to setpublic boolean isServeStatic()
public void setServeStatic(boolean serveStatic)
serveStatic
- if set to true, this AccessPoint will serve static
content, and .jsp filespublic LiveWebRedirector getLiveWebRedirector()
public void setLiveWebRedirector(LiveWebRedirector liveWebRedirector)
liveWebRedirector
- Set the LiveWebRedirector
to use to try and retrieve documents
from the live web on demand when missing from the collection.public void setLiveWebPrefix(String liveWebPrefix)
public String getLiveWebPrefix()
public String getStaticPrefix()
public void setStaticPrefix(String staticPrefix)
staticPrefix
- explicit URL prefix to use when creating self referencing
static URLspublic String getReplayPrefix()
public void setReplayPrefix(String replayPrefix)
replayPrefix
- explicit URL prefix to use when creating self referencing
replay URLspublic void setQueryPrefix(String queryPrefix)
queryPrefix
- explicit URL prefix to use when creating self referencing
query URLspublic String getQueryPrefix()
public String makeCaptureQueryUrl(String url, String startdate, String enddate)
url
.url
- URL to search for copies ofstartdate
- start of date range in DT14 format (may be null
for no date range.enddate
- end of date range in DT14 format (may be null
, ignored
if startdate
is null
)url
.public void setInterstitialJsp(String interstitialJsp)
interstitialJsp
- the interstitialJsp to setpublic String getInterstitialJsp()
public void setUrlRoot(String urlRoot)
urlRoot
- explicit URL prefix to use when creating ANY self
referencing URLspublic String getUrlRoot()
public Locale getLocale()
public void setLocale(Locale locale)
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 headerspublic Properties getConfigs()
public void setConfigs(Properties configs)
configs
- the generic customization Properties to use with this
AccessPoint, generally used to tune the UIpublic List<String> getFilePatterns()
public void setFilePatterns(List<String> filePatterns)
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.public List<String> getFileIncludePrefixes()
public void setFileIncludePrefixes(List<String> fileIncludePrefixes)
fileIncludePrefixes
- 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.public List<String> getFileExcludePrefixes()
public void setFileExcludePrefixes(List<String> fileExcludePrefixes)
fileExcludePrefixes
- 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.public WaybackCollection getCollection()
public void setCollection(WaybackCollection collection)
collection
- the WaybackCollection to use with this AccessPointpublic ExceptionRenderer getException()
public void setException(ExceptionRenderer exception)
exception
- the ExceptionRender to use with this AccessPointpublic QueryRenderer getQuery()
public void setQuery(QueryRenderer query)
query
- the QueryRenderer responsible for returning query data to
clients.public RequestParser getParser()
public void setParser(RequestParser parser)
parser
- the RequestParser to use with this AccessPointpublic ReplayDispatcher getReplay()
public void setReplay(ReplayDispatcher replay)
replay
- the ReplayDispatcher to use with this AccessPoint.public ResultURIConverter getUriConverter()
public void setUriConverter(ResultURIConverter uriConverter)
Refactoring: remove this method. let getUriConverter()
create
ResultURIConverter with factory (like AccessPointAdapter does).
uriConverter
- the ResultURIConverter to use with this AccessPoint
to construct Replay URLspublic ExclusionFilterFactory getExclusionFactory()
public void setExclusionFactory(ExclusionFilterFactory exclusionFactory)
exclusionFactory
- all requests to this AccessPoint will create an
exclusionFilter from this factory when handling requestspublic BooleanOperator<WaybackRequest> getAuthentication()
public void setAuthentication(BooleanOperator<WaybackRequest> auth)
auth
- the BooleanOperator which determines if incoming
requests are allowed to connect to this AccessPoint.public boolean isRequestAuth()
public void setRequestAuth(boolean requestAuth)
public String getRefererAuth()
public void setRefererAuth(String refererAuth)
refererAuth
- the refererAuth to setpublic boolean isBounceToReplayPrefix()
public void setBounceToReplayPrefix(boolean bounceToReplayPrefix)
bounceToReplayPrefix
- the bounceToReplayPrefix to setpublic boolean isBounceToQueryPrefix()
public void setBounceToQueryPrefix(boolean bounceToQueryPrefix)
bounceToQueryPrefix
- the bounceToQueryPrefix to setpublic long getEmbargoMS()
public void setEmbargoMS(long ms)
ms
- minimum number of MS age for content to be served from the indexpublic boolean isForceCleanQueries()
public void setForceCleanQueries(boolean forceCleanQueries)
forceCleanQueries
- the forceCleanQueries to setpublic void setFilterFactory(CustomResultFilterFactory filterFactory)
CustomResultFilterFactory
to be applied on CDX query result.
AccessPoint itself does not use this object.
ResourceIndex
implementation needs to implement filtering
using this property. ClusterResourceIndex
is the only
implementation known at this moment.
Note: this property will likely be removed in the future.
filterFactory
- the filterFactory to setpublic CustomResultFilterFactory getFilterFactory()
public void setSelfRedirectCanonicalizer(UrlCanonicalizer selfRedirectCanonicalizer)
selfRedirectCanonicalizer
- public UrlCanonicalizer getSelfRedirectCanonicalizer()
UrlCanonicalizer
public int getMaxRedirectAttempts()
public void setMaxRedirectAttempts(int maxRedirectAttempts)
public boolean isFixedEmbeds()
public void setFixedEmbeds(boolean fixedEmbeds)
public boolean isTimestampSearch()
public void setTimestampSearch(boolean timestampSearch)
public String getPerfStatsHeader()
public void setPerfStatsHeader(String perfStatsHeader)
public String getWarcFileHeader()
public void setWarcFileHeader(String warcFileHeader)
public String getErrorMsgHeader()
public void setErrorMsgHeader(String errorMsgHeader)
public boolean isEnableErrorMsgHeader()
public void setEnableErrorMsgHeader(boolean enableErrorMsgHeader)
public boolean isEnablePerfStatsHeader()
public void setEnablePerfStatsHeader(boolean enablePerfStatsHeader)
public boolean isEnableWarcFileHeader()
public void setEnableWarcFileHeader(boolean enableWarcFileHeader)
public boolean isEnableMemento()
public void setEnableMemento(boolean enableMemento)
public MementoHandler getMementoHandler()
public void setMementoHandler(MementoHandler mementoHandler)
public void setPerfStatsHeaderFormat(PerfStats.OutputFormat perfStatsHeaderFormat)
perfStatsHeaderFormat
- PerfStats.OutputFormat
Copyright © 2005–2015 IIPC. All rights reserved.