Package com.jalios.jcms.analytics
Class AbstractStatisticAgent
java.lang.Object
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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddElement(String elt, Map<String, Integer> eltMap) voidaggregateDataByPeriod(Workspace ws, Date startDate, Date endDate, Class<? extends AbstractReportMetric> clazz) booleanaggregateWeeklyData(String urid, Date startDate, Date endDate, Class<? extends AbstractReportMetric> clazz, Set<AbstractReportMetric> metricReports) abstract AbstractStatisticAgentclone()intabstract voiddoProcess(EventData data, StatisticContext context) abstract booleanendAnalyze(AbstractReportMetric reportMetric, StatisticContext context) static longgetDaysBetween(Date startDate, Date endDate) static Set<AbstractReportMetric> getMetricObjectSet(Workspace workspace, Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz) static Set<AbstractReportMetric> getMetricsByPeriodSet(Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz) Get Agent nameabstract Class<? extends AbstractReportMetric> static Set<AbstractReportMetric> getWorkspacesMetricObjectSet(Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz) Deprecated, for removal: This API element is subject to removal in a future version.voidinit(StatisticContext context) static booleanisDailyAnalyze(Date startDate, Date endDate) static booleanisDateRangeUnderMaxPeriod(Date startDate, Date endDate) booleanbooleanisReportDisplayed(Workspace displayedWS, Date beginDate, Date endDate) Indicates if this agent have a display available for the provided parametersprotected voidlogIncompleteDailyMetrics(Class<? extends AbstractReportMetric> clazz, String workspaceId, int foundCount, Date startDate, Date endDate) voidprocess(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(String displayJSP) voidsetPluginAgent(boolean isPluginAgent) voidsetReportDay(Date reportDay) voidsetWorkspace(Workspace workspace) abstract voidstartAnalyze(StatisticContext context)
-
Field Details
-
DAYS_IN_WEEK
public static final int DAYS_IN_WEEK- See Also:
-
-
Constructor Details
-
AbstractStatisticAgent
public AbstractStatisticAgent() -
AbstractStatisticAgent
-
-
Method Details
-
init
-
getWorkspace
-
setWorkspace
-
getReportDay
-
setReportDay
-
getDisplayJSP
-
setDisplayJSP
-
isPluginAgent
public boolean isPluginAgent() -
setPluginAgent
public void setPluginAgent(boolean isPluginAgent) -
getName
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
@Deprecated(forRemoval=true) public static Set<AbstractReportMetric> getWorkspacesMetricObjectSet(Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz) Deprecated, for removal: This API element is subject to removal in a future version. -
getLatestAnalyzeDate
-
getMetricsByPeriodSet
public static Set<AbstractReportMetric> getMetricsByPeriodSet(Date startDate, Date endDate, String urid, Class<? extends AbstractReportMetric> clazz) -
aggregateDataByPeriod
public void aggregateDataByPeriod(Workspace ws, Date startDate, Date endDate, Class<? extends AbstractReportMetric> clazz) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
isReportDisplayed
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
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:
data- theEventDatacontext- theStatisticContext
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
startAnalyze
-
doProcess
-
endAnalyze
-
getReportMetricClass
-
compareTo
- Specified by:
compareToin interfaceComparable<AbstractStatisticAgent>
-
addElement
-
aggregateWeeklyData
public boolean aggregateWeeklyData(String urid, Date startDate, Date endDate, Class<? extends AbstractReportMetric> clazz, Set<AbstractReportMetric> metricReports) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
isDailyAnalyze
-
getDaysBetween
-
isDateRangeUnderMaxPeriod
-
logIncompleteDailyMetrics
protected void logIncompleteDailyMetrics(Class<? extends AbstractReportMetric> clazz, String workspaceId, int foundCount, Date startDate, Date endDate)
-