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 class
AbstractStatisticAgent.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 void
addElement(java.lang.String elt, java.util.Map<java.lang.String,java.lang.Integer> eltMap)
abstract AbstractStatisticAgent
clone()
int
compareTo(AbstractStatisticAgent o)
abstract void
doProcess(EventData data, StatisticContext context)
abstract boolean
endAnalyze(AbstractReportMetric reportMetric, StatisticContext context)
java.lang.String
getDisplayJSP()
java.util.Date
getLatestAnalyzeDate()
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.String
getName(java.lang.String userLang)
Get Agent nameint
getOrder()
Deprecated.java.util.Date
getReportDay()
abstract java.lang.Class<? extends AbstractReportMetric>
getReportMetricClass()
Workspace
getWorkspace()
static java.util.Set<AbstractReportMetric>
getWorkspacesMetricObjectSet(java.util.Date startDate, java.util.Date endDate, java.lang.String urid, java.lang.Class<? extends AbstractReportMetric> clazz)
void
init(StatisticContext context)
boolean
isPluginAgent()
boolean
isReportDisplayed(Workspace displayedWS, java.util.Date beginDate, java.util.Date endDate)
Indicates if this agent have a display available for the provided parametersvoid
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 dayvoid
setDisplayJSP(java.lang.String displayJSP)
void
setOrder(int order)
Deprecated.void
setPluginAgent(boolean isPluginAgent)
void
setReportDay(java.util.Date reportDay)
void
setWorkspace(Workspace workspace)
abstract void
startAnalyze(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
- theStatisticContext
data
- theEventData
-
clone
public abstract AbstractStatisticAgent clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in 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:
compareTo
in interfacejava.lang.Comparable<AbstractStatisticAgent>
-
addElement
protected void addElement(java.lang.String elt, java.util.Map<java.lang.String,java.lang.Integer> eltMap)
-
-