public class SheetOverlaysManager extends Object implements org.springframework.beans.factory.BeanFactoryAware, OverlayMapsSource, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
Modifier and Type | Field and Description |
---|---|
protected org.springframework.beans.factory.BeanFactory |
beanFactory |
protected SortedSet<DecideRuledSheetAssociation> |
ruleAssociations
all SheetAssociations by DecideRule evaluation
|
protected NavigableMap<String,List<String>> |
sheetNamesBySurt |
protected Map<String,Sheet> |
sheetsByName
all sheets by (bean)name
|
Constructor and Description |
---|
SheetOverlaysManager() |
Modifier and Type | Method and Description |
---|---|
void |
addRuleAssociation(DecideRuledSheetAssociation assoc) |
void |
addRuleAssociations(Set<DecideRuledSheetAssociation> associations)
Collect all rule-based SheetAssociations.
|
void |
addSurtAssociation(String prefix,
String sheetName) |
void |
addSurtAssociations(List<SurtPrefixesSheetAssociation> associations)
Collect all SURT-based SheetAssociations.
|
void |
addSurtsAssociation(SurtPrefixesSheetAssociation assoc)
Add an individual surtsAssociation to the sheetNamesBySurt map.
|
void |
applyOverlaysTo(CrawlURI curi)
Apply the proper overlays (by Sheet beanName) to the given CrawlURI,
according to configured associations.
|
boolean |
deleteSheet(String sheetName)
Delete a named sheet from all associations and the master named
sheets map.
|
Sheet |
getOrCreateSheet(String name)
Get a Sheet of the given name, or create if it does not already
exist.
|
Map<String,Object> |
getOverlayMap(String name)
Retrieve the named overlay Map.
|
SortedSet<DecideRuledSheetAssociation> |
getRuleAssociations()
All DecideRuledSheetAssociations, in Ordered order
|
Map<String,Sheet> |
getSheetsByName()
Sheets, by name; starts with all autowired Sheets but others
may be added by other means (mid-crawl reconfiguration).
|
NavigableMap<String,List<String>> |
getSheetsNamesBySurt()
Sheet names, by the SURT prefix to which they should be applied.
|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Ensure all sheets are 'primed' after the entire ApplicatiotnContext
is assembled.
|
Object |
putSheetOverlay(String sheetName,
String beanPath,
Object value)
Add to named sheet an overlay of the given bean-path and new value.
|
Object |
removeSheetOverlay(String sheetName,
String beanPath)
Remove the given bean-path overlay in the named sheet.
|
boolean |
removeSurtAssociation(String prefix,
String sheetName) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setSheetsByName(Map<String,Sheet> map)
Collect all Sheets, by beanName.
|
protected org.springframework.beans.factory.BeanFactory beanFactory
protected SortedSet<DecideRuledSheetAssociation> ruleAssociations
protected NavigableMap<String,List<String>> sheetNamesBySurt
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public void setSheetsByName(Map<String,Sheet> map)
map
- public Map<String,Sheet> getSheetsByName()
public SortedSet<DecideRuledSheetAssociation> getRuleAssociations()
public NavigableMap<String,List<String>> getSheetsNamesBySurt()
public void addRuleAssociations(Set<DecideRuledSheetAssociation> associations)
ruleSheets
- public void addRuleAssociation(DecideRuledSheetAssociation assoc)
public void addSurtAssociations(List<SurtPrefixesSheetAssociation> associations)
surtSheets
- public void addSurtsAssociation(SurtPrefixesSheetAssociation assoc)
public Map<String,Object> getOverlayMap(String name)
getOverlayMap
in interface OverlayMapsSource
OverlayMapsSource.getOverlayMap(java.lang.String)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)
public Object putSheetOverlay(String sheetName, String beanPath, Object value)
sheetName
- sheet name to change (or create)beanPath
- target bean-path of overlayvalue
- new valuepublic Object removeSheetOverlay(String sheetName, String beanPath)
sheetName
- sheet name from which to remove overlaybeanPath
- overlay to removepublic boolean deleteSheet(String sheetName)
sheetName
- sheet name to deletepublic Sheet getOrCreateSheet(String name)
name
- Sheet name to create; must be uniquepublic void applyOverlaysTo(CrawlURI curi)
curi
- Copyright © 2003-2014 Internet Archive. All Rights Reserved.