com.jalios.jcms.analytics
Class AbstractStatisticAgent

java.lang.Object
  extended by com.jalios.jcms.analytics.AbstractStatisticAgent
All Implemented Interfaces:
Cloneable, Comparable<AbstractStatisticAgent>
Direct Known Subclasses:
AccountReportAgent, AdminReportAgent, DayAccessAgent, SearchReportAgent, TechnicalReportAgent, WriteReportAgent

public abstract class AbstractStatisticAgent
extends Object
implements Comparable<AbstractStatisticAgent>, Cloneable


Nested Class Summary
static class AbstractStatisticAgent.AbstractReportMetricComparator
           
 
Constructor Summary
AbstractStatisticAgent()
           
AbstractStatisticAgent(AbstractStatisticAgent parent)
           
 
Method Summary
protected  void addElement(String elt, Map<String,Integer> eltMap)
           
abstract  AbstractStatisticAgent clone()
           
 int compareTo(AbstractStatisticAgent o)
           
abstract  void doProcess(EventData data, StatisticContext context)
           
abstract  boolean endAnalyze(AbstractReportMetric reportMetric, StatisticContext context)
           
 String getDisplayJSP()
           
 Date getLatestAnalyzeDate()
           
static Set<AbstractReportMetric> getMetricObjectSet(Workspace workspace, Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz)
           
 String getName(String userLang)
          Get Agent name
 int getOrder()
           
 Date getReportDay()
           
abstract  Class<? extends AbstractReportMetric> getReportMetricClass()
           
 Workspace getWorkspace()
           
static Set<AbstractReportMetric> getWorkspacesMetricObjectSet(Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz)
           
 void init(StatisticContext context)
           
 boolean isReportDisplayed(Workspace displayedWS, Date beginDate, Date endDate)
          Indicates if this agent have a display available for the provided parameters
 void process(EventData data, StatisticContext context)
          process the current data Default implementation check : - if data is not null - if urid is not null in analyze configuration, canUse check if the evenData urid is the same - if workspaceId is not null in analyze configuration, canUse check if the evenData workspaceId is the same - if startDate or endDate in eventData is null it return false - if the startDate is in the same day than the agent report day
 void setDisplayJSP(String displayJSP)
           
 void setOrder(int order)
           
 void setReportDay(Date reportDay)
           
 void setWorkspace(Workspace workspace)
           
abstract  void startAnalyze(StatisticContext context)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatisticAgent

public AbstractStatisticAgent()

AbstractStatisticAgent

public AbstractStatisticAgent(AbstractStatisticAgent parent)
Method Detail

init

public void init(StatisticContext context)

getWorkspace

public Workspace getWorkspace()

setWorkspace

public void setWorkspace(Workspace workspace)

getReportDay

public Date getReportDay()

setReportDay

public void setReportDay(Date reportDay)

getDisplayJSP

public String getDisplayJSP()

setDisplayJSP

public void setDisplayJSP(String displayJSP)

getOrder

public int getOrder()

setOrder

public void setOrder(int order)

getName

public String getName(String userLang)
Get Agent name

Parameters:
userLang - the language to compute agent name
Returns:
the agent name

getMetricObjectSet

public static Set<AbstractReportMetric> getMetricObjectSet(Workspace workspace,
                                                           Date startDate,
                                                           Date endDate,
                                                           String urid,
                                                           Class<? extends AbstractReportMetric> clazz)

getWorkspacesMetricObjectSet

public static Set<AbstractReportMetric> getWorkspacesMetricObjectSet(Date startDate,
                                                                     Date endDate,
                                                                     String urid,
                                                                     Class<? extends AbstractReportMetric> clazz)

getLatestAnalyzeDate

public Date getLatestAnalyzeDate()

isReportDisplayed

public boolean isReportDisplayed(Workspace displayedWS,
                                 Date beginDate,
                                 Date endDate)
Indicates if this agent have a display available for the provided parameters

Parameters:
displayedWS - the Workspace (can be null for all workspaces)
beginDate - the begin date of te displayed interval
endDate - the end date of te displayed interval
Returns:
true if the agent will be displayed, false otherwise

process

public void process(EventData data,
                    StatisticContext context)
process the current data Default implementation check : - if data is not null - if urid is not null in analyze configuration, canUse check if the evenData urid is the same - if workspaceId is not null in analyze configuration, canUse check if the evenData workspaceId is the same - if startDate or endDate in eventData is null it return false - if the startDate is in the same day than the agent report day

Parameters:
context - the StatisticContext
data - the EventData

clone

public abstract AbstractStatisticAgent clone()
Overrides:
clone in class Object

startAnalyze

public abstract void startAnalyze(StatisticContext context)

doProcess

public abstract void doProcess(EventData data,
                               StatisticContext context)

endAnalyze

public abstract boolean endAnalyze(AbstractReportMetric reportMetric,
                                   StatisticContext context)

getReportMetricClass

public abstract Class<? extends AbstractReportMetric> getReportMetricClass()

compareTo

public int compareTo(AbstractStatisticAgent o)
Specified by:
compareTo in interface Comparable<AbstractStatisticAgent>

addElement

protected void addElement(String elt,
                          Map<String,Integer> eltMap)


Copyright © 2001-2010 Jalios SA. All Rights Reserved.