Class PageElementCacheStatsGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.web.cache.monitoring.ui.PageElementCacheStatsGenerator
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
public class PageElementCacheStatsGenerator extends ServiceableGenerator
Cache stats generator for related to the back-office (pages and page elements)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PageElementCacheStatsGenerator.PageElementStatsEntry
Object model representing an entry of stats for a PageElementprotected class
PageElementCacheStatsGenerator.PageStatsEntry
Object model representing an entry of stats for a Page
-
Field Summary
Fields Modifier and Type Field Description protected InputDataExtensionPoint
_inputDataExt
Input Data extension pointprotected Multimap<String,PageElementCacheStatsGenerator.PageStatsEntry>
_pageIdMap
Map linking page Id to page stats entriesprotected ResourceStatisticsComponent
_resourceStatisticsCmp
Resource statistics componentprotected SiteManager
_siteManager
Ametys resolverprotected Multimap<PageElementCacheStatsGenerator.PageStatsEntry,PageElementCacheStatsGenerator.PageElementStatsEntry>
_statsMap
Map of stats entries-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
-
Constructor Summary
Constructors Constructor Description PageElementCacheStatsGenerator()
-
Method Summary
-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
setup
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
_resourceStatisticsCmp
protected ResourceStatisticsComponent _resourceStatisticsCmp
Resource statistics component
-
_inputDataExt
protected InputDataExtensionPoint _inputDataExt
Input Data extension point
-
_siteManager
protected SiteManager _siteManager
Ametys resolver
-
_pageIdMap
protected Multimap<String,PageElementCacheStatsGenerator.PageStatsEntry> _pageIdMap
Map linking page Id to page stats entries
-
_statsMap
protected Multimap<PageElementCacheStatsGenerator.PageStatsEntry,PageElementCacheStatsGenerator.PageElementStatsEntry> _statsMap
Map of stats entries
-
-
Constructor Detail
-
PageElementCacheStatsGenerator
public PageElementCacheStatsGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager sm) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
recycle
public void recycle()
- Specified by:
recycle
in interfaceRecyclable
- Overrides:
recycle
in classAbstractGenerator
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
_initializePECacheStats
private void _initializePECacheStats() throws ProcessingException
Initialize statistics by retrieving data from the monitoring database.- Throws:
ProcessingException
- if an error occurs
-
_processCacheStatsResultSet
private void _processCacheStatsResultSet(List<Map<String,Object>> rawCacheStats)
-
_getContextsFilter
private List<String> _getContextsFilter(String contexts)
Analyse the 'contexts' parameter to filter the data to sax depending on requested contexts. A context is a couple as follows : 'renderingContext' - 'workspaceJcr'- Parameters:
contexts
- The contexts- Returns:
- the list of filters for the given contexts
-
_saxStats
private void _saxStats(Site site, List<String> contexts) throws SAXException
- Throws:
SAXException
-
_saxStats
private void _saxStats(Sitemap sitemap, List<String> contexts) throws SAXException
- Throws:
SAXException
-
_saxPageStats
private void _saxPageStats(Page page, List<String> contexts) throws SAXException
- Throws:
SAXException
-
_saxPageStatsContexts
private void _saxPageStatsContexts(Page page, List<Zone> zones, List<String> contexts) throws SAXException
- Throws:
SAXException
-
_saxPageStatsContext
private void _saxPageStatsContext(PageElementCacheStatsGenerator.PageStatsEntry pageStats, List<Zone> zones) throws SAXException
- Throws:
SAXException
-
_saxZoneStats
private void _saxZoneStats(Zone zone, Collection<PageElementCacheStatsGenerator.PageElementStatsEntry> pageElementStats) throws SAXException
- Throws:
SAXException
-
_saxZoneItemStats
private void _saxZoneItemStats(ZoneItem zoneItem, PageElementCacheStatsGenerator.PageElementStatsEntry entry, int index) throws SAXException
- Throws:
SAXException
-
_addZoneItemSaxInfo
private void _addZoneItemSaxInfo(AttributesImpl attrs, ZoneItem zoneItem)
-
_saxInputDataStats
private void _saxInputDataStats(Collection<PageElementCacheStatsGenerator.PageElementStatsEntry> pageElementStats) throws SAXException
- Throws:
SAXException
-
_saxInputDataStatsEntry
private void _saxInputDataStatsEntry(PageElementCacheStatsGenerator.PageElementStatsEntry entry, String inputDataId) throws SAXException
- Throws:
SAXException
-
_findPageElementStatsEntry
private PageElementCacheStatsGenerator.PageElementStatsEntry _findPageElementStatsEntry(Collection<PageElementCacheStatsGenerator.PageElementStatsEntry> pageElementStats, String id)
-
-