public class StdRemoteLiveWebCache extends Object implements LiveWebCache
LiveWebCache
,
ArcRemoteLiveWebCache
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.httpclient.MultiThreadedHttpConnectionManager |
connectionManager |
protected org.apache.commons.httpclient.HostConfiguration |
hostConfiguration |
protected org.apache.commons.httpclient.HttpClient |
httpClient |
protected String |
requestPrefix |
Constructor and Description |
---|
StdRemoteLiveWebCache()
StdRemoteLiveWebCache constructor initializes and configures connection objects.
|
Modifier and Type | Method and Description |
---|---|
Resource |
getCachedResource(URL url,
long maxCacheMS,
boolean bUseOlder)
Gets resource object from the live web.
|
void |
setProxyHostPort(String hostPort)
Sets proxy and port (proxy:port).
|
void |
shutdown()
closes all resources
|
protected org.apache.commons.httpclient.MultiThreadedHttpConnectionManager connectionManager
protected org.apache.commons.httpclient.HostConfiguration hostConfiguration
protected org.apache.commons.httpclient.HttpClient httpClient
protected String requestPrefix
public StdRemoteLiveWebCache()
public Resource getCachedResource(URL url, long maxCacheMS, boolean bUseOlder) throws LiveDocumentNotAvailableException, LiveWebCacheUnavailableException, LiveWebTimeoutException, IOException
getCachedResource
in interface LiveWebCache
url
- to fetch from the live web.maxCacheMS
- maximum age of resource to return - optionally honoredbUseOlder
- if true, return documents older than maxCacheMS if
a more recent copy is not available.LiveDocumentNotAvailableException
- if the resource cannot be
retrieved from the live web, but all proxying and caching
mechanisms functioned properlyLiveWebCacheUnavailableException
- if there was a problem either
accessing the live web, in proxying to the live web, or in
maintaining the cache for the live webLiveWebTimeoutException
- if there is no response from the live
web cache before a timeout occurred.IOException
- for the usual reasonsLiveWebCache.getCachedResource(java.net.URL, long, boolean)
public void setProxyHostPort(String hostPort)
hostPort
- to proxy requests through - ex. "localhost:3128"public void shutdown()
LiveWebCache
shutdown
in interface LiveWebCache
LiveWebCache.shutdown()
Copyright © 2005–2017 IIPC. All rights reserved.