Package com.jalios.jcms.analytics
Class AbstractStatisticAgent
- java.lang.Object
-
- com.jalios.jcms.analytics.AbstractStatisticAgent
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Comparable<AbstractStatisticAgent>
- Direct Known Subclasses:
AccountReportAgent,AdminReportAgent,DayAccessAgent,SearchReportAgent,TechnicalReportAgent,WriteReportAgent
public abstract class AbstractStatisticAgent extends java.lang.Object implements java.lang.Comparable<AbstractStatisticAgent>, java.lang.Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractStatisticAgent.AbstractReportMetricComparator
-
Constructor Summary
Constructors Constructor Description AbstractStatisticAgent()AbstractStatisticAgent(AbstractStatisticAgent parent)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddElement(java.lang.String elt, java.util.Map<java.lang.String,java.lang.Integer> eltMap)abstract AbstractStatisticAgentclone()intcompareTo(AbstractStatisticAgent o)abstract voiddoProcess(EventData data, StatisticContext context)abstract booleanendAnalyze(AbstractReportMetric reportMetric, StatisticContext context)java.lang.StringgetDisplayJSP()java.util.DategetLatestAnalyzeDate()static java.util.Set<AbstractReportMetric>getMetricObjectSet(Workspace workspace, java.util.Date startDate, java.util.Date endDate, java.lang.String urid, java.lang.Class<? extends AbstractReportMetric> clazz)java.lang.StringgetName(java.lang.String userLang)Get Agent nameintgetOrder()Deprecated.java.util.DategetReportDay()abstract java.lang.Class<? extends AbstractReportMetric>getReportMetricClass()WorkspacegetWorkspace()static java.util.Set<AbstractReportMetric>getWorkspacesMetricObjectSet(java.util.Date startDate, java.util.Date endDate, java.lang.String urid, java.lang.Class<? extends AbstractReportMetric> clazz)voidinit(StatisticContext context)booleanisPluginAgent()booleanisReportDisplayed(Workspace displayedWS, java.util.Date beginDate, java.util.Date endDate)Indicates if this agent have a display available for the provided parametersvoidprocess(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 dayvoidsetDisplayJSP(java.lang.String displayJSP)voidsetOrder(int order)Deprecated.voidsetPluginAgent(boolean isPluginAgent)voidsetReportDay(java.util.Date reportDay)voidsetWorkspace(Workspace workspace)abstract voidstartAnalyze(StatisticContext context)
-
-
-
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 java.util.Date getReportDay()
-
setReportDay
public void setReportDay(java.util.Date reportDay)
-
getDisplayJSP
public java.lang.String getDisplayJSP()
-
setDisplayJSP
public void setDisplayJSP(java.lang.String displayJSP)
-
getOrder
@Deprecated public int getOrder()
Deprecated.
-
setOrder
@Deprecated public void setOrder(int order)
Deprecated.
-
isPluginAgent
public boolean isPluginAgent()
-
setPluginAgent
public void setPluginAgent(boolean isPluginAgent)
-
getName
public java.lang.String getName(java.lang.String userLang)
Get Agent name- Parameters:
userLang- the language to compute agent name- Returns:
- the agent name
-
getMetricObjectSet
public static java.util.Set<AbstractReportMetric> getMetricObjectSet(Workspace workspace, java.util.Date startDate, java.util.Date endDate, java.lang.String urid, java.lang.Class<? extends AbstractReportMetric> clazz)
-
getWorkspacesMetricObjectSet
public static java.util.Set<AbstractReportMetric> getWorkspacesMetricObjectSet(java.util.Date startDate, java.util.Date endDate, java.lang.String urid, java.lang.Class<? extends AbstractReportMetric> clazz)
-
getLatestAnalyzeDate
public java.util.Date getLatestAnalyzeDate()
-
isReportDisplayed
public boolean isReportDisplayed(Workspace displayedWS, java.util.Date beginDate, java.util.Date endDate)
Indicates if this agent have a display available for the provided parameters- Parameters:
displayedWS- theWorkspace(can be null for all workspaces)beginDate- the begin date of te displayed intervalendDate- 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- theStatisticContextdata- theEventData
-
clone
public abstract AbstractStatisticAgent clone() throws java.lang.CloneNotSupportedException
- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
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 java.lang.Class<? extends AbstractReportMetric> getReportMetricClass()
-
compareTo
public int compareTo(AbstractStatisticAgent o)
- Specified by:
compareToin interfacejava.lang.Comparable<AbstractStatisticAgent>
-
addElement
protected void addElement(java.lang.String elt, java.util.Map<java.lang.String,java.lang.Integer> eltMap)
-
-