info.magnolia.module.rssaggregator.generator
Class CollectStatisticsCommand

java.lang.Object
  extended by info.magnolia.commands.MgnlCommand
      extended by info.magnolia.module.rssaggregator.generator.CollectStatisticsCommand
All Implemented Interfaces:
info.magnolia.commands.chain.Command, Cloneable

public class CollectStatisticsCommand
extends info.magnolia.commands.MgnlCommand

Collects and generates statistics for imported RSS feed data.

Author:
lfischer

Field Summary
 
Fields inherited from interface info.magnolia.commands.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
CollectStatisticsCommand()
           
 
Method Summary
protected  void createMapEntry(org.apache.commons.collections.map.MultiKeyMap mkm, javax.jcr.Node blogEntry)
          Add blog entries from the planet archive to a multi key map.
protected  void createStatisticsNodes(org.apache.commons.collections.map.MultiKeyMap statEntries, javax.jcr.Node topNode)
          Store collected statistics in JCR tree.
 boolean execute(info.magnolia.context.Context context)
           
protected  Date getStatisticsStartDate()
          Get relevant date for statistics from Magnolia config workspace.
 
Methods inherited from class info.magnolia.commands.MgnlCommand
clone, execute, isEnabled, release, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectStatisticsCommand

public CollectStatisticsCommand()
Method Detail

execute

public boolean execute(info.magnolia.context.Context context)
                throws Exception
Specified by:
execute in class info.magnolia.commands.MgnlCommand
Throws:
Exception

getStatisticsStartDate

protected Date getStatisticsStartDate()
Get relevant date for statistics from Magnolia config workspace.

Returns:
Date relevant for inclusion of blog entries in statistics.

createMapEntry

protected void createMapEntry(org.apache.commons.collections.map.MultiKeyMap mkm,
                              javax.jcr.Node blogEntry)
Add blog entries from the planet archive to a multi key map.

Parameters:
mkm - Map with blog entries stored with a key consisting of author name and rss feed link.
blogEntry - Single blog entry retrieved from planet archive.

createStatisticsNodes

protected void createStatisticsNodes(org.apache.commons.collections.map.MultiKeyMap statEntries,
                                     javax.jcr.Node topNode)
Store collected statistics in JCR tree.

Parameters:
statEntries - Map with author and feed key containing blog entries.
topNode - Top node for the planet statistics feed.


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.