|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.archive.crawler.settings.SettingsCache
public class SettingsCache
This class keeps a map of host names to settings objects. It is implemented with soft references which implies that the elements can be garbage collected when there's no strong references to the elements. Even if there's no strong references left elements will not be garbage collected unless the memory is needed.
Constructor Summary | |
---|---|
SettingsCache(CrawlerSettings globalSettings)
Creates a new instance of the settings cache |
Method Summary | |
---|---|
void |
clear()
Clear all cached settings. |
void |
deleteSettingsObject(CrawlerSettings settings)
Delete a settings object from the cache. |
CrawlerSettings |
getGlobalSettings()
|
CrawlerSettings |
getSettings(java.lang.String host,
java.lang.String refinement)
Get the effective settings for a host. |
CrawlerSettings |
getSettingsObject(java.lang.String scope,
java.lang.String refinement)
Get a settings object. |
void |
putSettings(java.lang.String host,
CrawlerSettings settings)
Add a settings object to the cache. |
void |
refreshHostToSettings()
Make sure that no host strings points to wrong settings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SettingsCache(CrawlerSettings globalSettings)
Method Detail |
---|
public CrawlerSettings getSettings(java.lang.String host, java.lang.String refinement)
host
- the host to get settings for.
public CrawlerSettings getSettingsObject(java.lang.String scope, java.lang.String refinement)
scope
- the scope of the settings object to get.
public void putSettings(java.lang.String host, CrawlerSettings settings)
host
- the host for which the settings object is valid.settings
- the settings object.public void deleteSettingsObject(CrawlerSettings settings)
settings
- the settings object to remove.public void refreshHostToSettings()
public void clear()
public CrawlerSettings getGlobalSettings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |