|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.crawler.datamodel.ServerCache
public class ServerCache
Server and Host cache.
Field Summary | |
---|---|
protected ObjectIdentityCache<java.lang.String,CrawlHost> |
hosts
hostname -> CrawlHost. |
protected ObjectIdentityCache<java.lang.String,CrawlServer> |
servers
hostname[:port] -> CrawlServer. |
protected SettingsHandler |
settingsHandler
|
Constructor Summary | |
---|---|
protected |
ServerCache()
Constructor. |
|
ServerCache(CrawlController c)
Create a ServerCache that uses the given CrawlController to initialize the maps of servers and hosts. |
|
ServerCache(SettingsHandler sh)
This constructor creates a ServerCache that is all memory-based using Hashtables. |
Method Summary | |
---|---|
void |
cleanup()
Called when shutting down the cache so we can do clean up. |
boolean |
containsHost(java.lang.String hostKey)
|
boolean |
containsServer(java.lang.String serverKey)
|
void |
forAllHostsDo(org.apache.commons.collections.Closure c)
|
CrawlHost |
getHostFor(CandidateURI cauri)
Get the CrawlHost associated with curi . |
CrawlHost |
getHostFor(java.lang.String hostname)
Get the CrawlHost associated with name . |
CrawlServer |
getServerFor(CandidateURI cauri)
Get the CrawlServer associated with curi . |
CrawlServer |
getServerFor(java.lang.String serverKey)
Get the CrawlServer associated with name ,
creating if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SettingsHandler settingsHandler
protected ObjectIdentityCache<java.lang.String,CrawlServer> servers
protected ObjectIdentityCache<java.lang.String,CrawlHost> hosts
Constructor Detail |
---|
protected ServerCache()
public ServerCache(SettingsHandler sh) throws java.lang.Exception
ServerCache(CrawlController)
when crawling).
sh
-
java.lang.Exception
public ServerCache(CrawlController c) throws java.lang.Exception
c
-
java.lang.Exception
Method Detail |
---|
public CrawlServer getServerFor(java.lang.String serverKey)
CrawlServer
associated with name
,
creating if necessary.
serverKey
- Server name we're to return server for.
public CrawlServer getServerFor(CandidateURI cauri)
CrawlServer
associated with curi
.
cauri
- CandidateURI we're to get server from.
public CrawlHost getHostFor(java.lang.String hostname)
CrawlHost
associated with name
.
hostname
- Host name we're to return Host for.
public CrawlHost getHostFor(CandidateURI cauri)
CrawlHost
associated with curi
.
cauri
- CandidateURI we're to return Host for.
public boolean containsServer(java.lang.String serverKey)
serverKey
- Key to use doing lookup.
public boolean containsHost(java.lang.String hostKey)
hostKey
- Key to use doing lookup.
public void cleanup()
public void forAllHostsDo(org.apache.commons.collections.Closure c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |