Package com.jalios.jcms.analytics
Class AnalyticsManager
- java.lang.Object
-
- com.jalios.jcms.analytics.AnalyticsManager
-
- All Implemented Interfaces:
JPropertiesListener
public final class AnalyticsManager extends java.lang.Object implements JPropertiesListener
AnalyticsManager use for JCMS analytics
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnalyticsManager.ContentTopMapComparator
class
AnalyticsManager.DataMixInFilter
class
AnalyticsManager.DoubleEntryComparator
class
AnalyticsManager.DoubleMapComparator
class
AnalyticsManager.MemberMixInFilter
static class
AnalyticsManager.RatioSeriesDataMapComparator
static class
AnalyticsManager.TopDoubleMapComparator
static class
AnalyticsManager.TopMapComparator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AC_SEARCH
Deprecated.static java.lang.String
AC_SEARCH_TYPE
static java.lang.String
ACCESS
static java.lang.String
ANALYTICS_CONTEXT_MAP
static java.lang.String
ANALYTICS_RESOLVEHOST_PROP
static java.lang.String
APP_URI
static java.lang.String
AUDIENCEMENT
static java.lang.String
AUTH_FAIL
static java.lang.String
AUTHENTICATION_HANDLER
static java.lang.String
BELONGS_TO_WORKSPACE
static java.lang.String
BOT_PROP
static java.lang.String
BROWSER
static java.lang.String
BROWSERS_PROP
static java.lang.String
CHROME
static java.lang.String
CONTEXT_PATH
static java.lang.String
CORE
static java.lang.String
COUNTRY
static java.lang.String
CSRF_ERROR
static java.lang.String
CSV_COLUMN_PREFIX
static java.lang.String
CTXTCAT
static java.lang.String
CURRENTCAT
static java.lang.String
DATA
static java.lang.String
DATA_TYPE
static java.lang.String
DATA_WORKSPACES
static java.lang.String
DATEEND
static java.lang.String
DATESTART
static java.lang.String
DOWNLOAD
static java.lang.String
GROUPS
static java.lang.String
IPADDRESS
static java.lang.String
IS_BOT
static java.lang.String
JCMS_ANALYTICS_ALARM_MANAGER
static java.lang.String
LANGUAGE
static java.lang.String
LOCALE
static java.lang.String
MEMBER
static java.lang.String
MEMO
static java.lang.String
METHODE
static java.lang.String
NAME
static java.lang.String
NONE_SEARCH_TYPE
static java.lang.String
NORMAL_SEARCH_TYPE
static java.lang.String
OLD_DATA_WORKSPACES
static java.lang.String
OLD_PSTATUS
static java.lang.String
OLD_WF_ID
static java.lang.String
OPENAPI
static java.lang.String
OPENAPI_DISABLED
static java.lang.String
OPENAPI_ERROR
static java.lang.String
OPENAPI_GLOBAL_DATA_WRITE_DISABLED
static java.lang.String
OPENAPI_OK
static java.lang.String
OPENAPI_READ_ACCESS_DISABLED
static java.lang.String
OPENAPI_READ_ACCESS_FORBIDDEN
static java.lang.String
OPENAPI_UNAVAILABLE
static java.lang.String
OPENAPI_WRITE_ACCESS_DISABLED
static java.lang.String
OPENAPI_WRITE_ACCESS_FORBIDDEN
static java.lang.String
OS
static java.lang.String
OS_PROP
static org.apache.oro.text.regex.Pattern
PATTERN_BOT
static org.apache.oro.text.regex.Pattern
PATTERN_BROWSER
static int
PATTERN_NOT_PROCESSED
static org.apache.oro.text.regex.Pattern
PATTERN_OS
static int
PATTERN_PROCESSED_FALSE
static int
PATTERN_PROCESSED_TRUE
static java.lang.String
PORTAL
static java.lang.String
PORTAL_TITLE
static java.lang.String
PORTALCAT
static java.lang.String
PRINT_VIEW
static java.lang.String
PSTATUS
static java.lang.String
PUBLICATION
static java.lang.String
PUSH
static java.lang.String
QUERYSTRING
static java.lang.String
REFERER
static java.lang.String
SAFARI
static java.lang.String
SCHEME
static java.lang.String[]
SEARCH_ALLOWED_QS
static java.lang.String[]
SEARCH_ALLOWED_URI
static java.lang.String
SEARCH_CATEGORY
static java.lang.String
SEARCH_FULLTEXT
static java.lang.String
SEARCH_GROUPS
static java.lang.String
SEARCH_HIST
static java.lang.String
SEARCH_MEMBERS
static java.lang.String
SEARCH_MODE
static java.lang.String
SEARCH_SORT
static java.lang.String
SEARCH_TYPE_KEY
static java.lang.String
SEARCH_TYPES
static java.lang.String
SERVERNAME
static java.lang.String
SERVERPORT
static java.lang.String
SESSIONID
static java.lang.String
STORAGE_HANDLER_PROP_PREFIX
static java.lang.String
URI
static java.lang.String
URID
static java.lang.String
USERAGENT
static java.lang.String
WF_ID
static java.lang.String
WORKSPACE
static java.lang.String
XFORWARD
static java.lang.String
ZONE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAgent(AbstractStatisticAgent agent)
add aAbstractStatisticAgent
to agent listvoid
addEventDataListener(EventDataListener listener)
static java.util.Set<AbstractReportMetric>
aggregateAllUrid(java.util.Set<AbstractReportMetric> originalSet, java.lang.Class<? extends AbstractReportMetric> clazz)
Aggregate all urid report in global report (day by day)static void
aggregateDateKeyDoubleMap(java.util.Map<java.util.Date,java.lang.Double> origMap, java.util.Map<java.util.Date,java.lang.Double> mapToAdd)
static void
aggregateKeyContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap, java.util.Map<java.lang.String,ContentTopValue> mapToAdd)
static void
aggregateKeyIntegerMap(java.util.Map<java.lang.String,java.lang.Integer> origMap, java.util.Map<java.lang.String,java.lang.Integer> mapToAdd)
static void
aggregateKeyLongMap(java.util.Map<java.lang.String,java.lang.Long> origMap, java.util.Map<java.lang.String,java.lang.Long> mapToAdd)
static void
appendEventData(EventData eventData)
Append a data eventstatic void
appendEventData(EventData eventData, javax.servlet.http.HttpServletRequest request)
Append a data eventstatic void
appendPageEvent(javax.servlet.http.HttpServletRequest request, long startPageRequest)
Append a page event (like previous page stat mechanism)protected static void
appendPageEvent(javax.servlet.http.HttpServletRequest request, long startPageRequest, long endPageRequest, long eventDate)
Append a page event (like previous page stat mechanism)boolean
checkRequirements()
static void
completeMetricObjectSet(java.util.Set<AbstractReportMetric> originalSet, java.util.Date startDate, java.util.Date endDate, java.util.Locale locale, java.lang.Class<? extends AbstractReportMetric> clazz)
Update the provided set with some empty report metric instance if any are missing in specified intervalstatic RatioSeries
createRatioSeries(java.util.Map<java.lang.String,java.lang.Integer> map, java.lang.String prefix, java.lang.String userLang)
Util method use in analytics display (to avoid lambda in JSP)void
deleteAnalyze(AnalyzeListener listener)
boolean
displayAnonymousVisitorData()
static java.lang.String
encodeContentTopValueMapForJsonCsv(java.util.Map<java.lang.String,ContentTopValue> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.Class<?> keyClass)
static java.lang.String
encodeContentTopValueMapForJsonCsv(java.util.Map<java.lang.String,ContentTopValue> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.String keyType)
static java.lang.String
encodeForJsonCsv(java.lang.String userLang, PieChart chart)
static java.lang.String
encodeForJsonCsv(java.lang.String userLang, java.time.ZoneId zoneId, TimeChart chart)
static java.lang.String
encodeForJsonCsv(java.util.Map<java.lang.String,java.lang.Integer> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.Class<?> keyClass)
static java.lang.String
encodeForJsonCsv(java.util.Map<java.lang.String,java.lang.Integer> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.String keyType)
static java.util.Map<java.lang.String,java.lang.String>
generateAccessContextMap(javax.servlet.http.HttpServletRequest request, EventData eventData)
static java.lang.String
getActionFromOp(int opAction)
java.util.List<AbstractStatisticAgent>
getAgents()
GetAbstractStatisticAgent
list (a copy of internal agent list)long
getAjaxDisplayMinimumPeriod()
indicate when ajax display must be used in report displaystatic java.util.SortedSet<java.lang.String>
getBots(java.lang.String userAgent)
static java.util.SortedSet<java.lang.String>
getBrowsers(java.lang.String userAgent)
static java.util.Set<Workspace>
getCompatibleWorkspaceSet()
Get compatible workspaces for analyze (workspace model are ignored) (without any right check)static java.util.Set<Workspace>
getCompatibleWorkspaceSet(Member loggedMember)
Get compatible workspaces for analyze (workspace model are ignored)java.util.List<AnalyzeListener>
getCurrentAnalyzeListener()
Retrieve the current analyze listenerstatic java.util.Map<java.lang.String,ContentTopValue>
getDeserializedContentTopMap(java.util.Map<java.lang.String,java.lang.String> contentTopMap)
Convert a Map of String to map ofContentTopValue
java.util.LinkedHashSet<EventDataListener>
getEventDataListenerSet()
AbstractEventDataProvider
getEventDataProvider(StatisticContext context)
java.util.Date
getIgnoreBeforeDate()
static AnalyticsManager
getInstance()
org.codehaus.jackson.map.ObjectMapper
getObjectMapper()
get theObjectMapper
(cached in the class)java.util.Map<java.lang.String,java.lang.String>
getRequestCustomContextMap(javax.servlet.http.HttpServletRequest request)
Get the contextMap
which will be merge with existing context if it exists before writingEventData
static java.util.Map<java.lang.String,java.lang.String>
getSerializedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> contentTopMap)
Convert a Map ofContentTopValue
to map of Stringstatic java.util.SortedMap<java.lang.String,ContentTopValue>
getSortedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap)
static java.util.SortedMap<java.lang.String,ContentTopValue>
getSortedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap, int nbMaxElt)
static java.util.SortedMap<java.lang.String,java.lang.Double>
getSortedTopDoubleMap(java.util.Map<java.lang.String,java.lang.Double> topMap)
java.util.SortedMap<java.lang.String,java.lang.Double>
getSortedTopDoubleMap(java.util.Map<java.lang.String,java.lang.Double> topMap, int nbMaxElt)
static java.util.SortedMap<java.lang.String,java.lang.Integer>
getSortedTopMap(java.util.Map<java.lang.String,java.lang.Integer> topMap)
java.util.SortedMap<java.lang.String,java.lang.Integer>
getSortedTopMap(java.util.Map<java.lang.String,java.lang.Integer> topMap, int nbMaxElt)
java.util.Map<java.lang.String,java.lang.String>
getThreadLocalCustomContextMap()
Get the contextMap
which will be merge with existing context if it exists before writingEventData
context map will be get from a ThreadLocal objectstatic java.lang.String
getUrlSubString(java.lang.String value, int maxLength)
static java.util.Calendar
getUtcTime(java.util.Date reportDate, java.util.Locale userLocale)
Retrieve a UTC time from a datevoid
initAlarms()
init analytics alarm use to compute day aggregationstatic boolean
isBot(EventData data)
boolean
isDisable()
boolean
isEventDataProcessing()
static boolean
isSearchRequest(java.lang.String uri, java.lang.String queryString)
static boolean
isValidOperationAction(java.lang.String opAction)
static java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>>
keptBest(java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> dataMap, int nbElement, java.lang.String othersKey)
Compute a new map by top x data and grouping other data.static java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>>
normalizeMap(java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> dataMap)
Normalize a Map<String, Map<Date, Double>> Map to have value in percentage day by daystatic void
processQueries(java.util.Map<java.lang.String,java.lang.String> ctxMap)
void
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.void
reinitAlarms()
ReinitAlarms (remove all analytics alarms from analytics alarm manager and init alarms)void
removeAgent(AbstractStatisticAgent agent)
remove aAbstractStatisticAgent
from agent listboolean
removeEventDataListener(EventDataListener listener)
void
removeThreadLocalCustomContextMap()
Remove the contextMap
which will be merge with existing context if it exists before writingEventData
static void
removeToDayMetric(java.util.Set<AbstractReportMetric> originalSet)
Remove today metric, because this metric is not done.void
runDayAgent()
run day agent with management of missing aggregation (manual run)void
runDayAgent(java.util.Date startDate, java.util.Date endDate, Workspace workspace, java.lang.String urid, boolean scheduled, boolean globalAnalyze)
Run day agent in a specific periodvoid
runDayAgent(java.util.Date startDate, java.util.Date endDate, Workspace workspace, java.lang.String urid, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run day agent in a specific periodvoid
runDayAgent(java.util.Date startDate, java.util.Date endDate, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> dayAgentList, boolean scheduled, boolean globalAnalyze)
Run day agent in the specified periodvoid
runDayAgent(java.util.Date startDate, java.util.Date endDate, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> dayAgentList, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run day agent in the specified periodvoid
runDayAgentFromAlarm()
run day agent with management of missing aggregation (from an alarm).void
runPeriodAgent(java.util.Date startDate, java.util.Date endDate, AbstractPeriod period, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> agentList, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run agent with a custom period in a specified intervalvoid
runPeriodAgent2(java.util.Date startDate, java.util.Date endDate, AbstractPeriod period, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> agentList, boolean scheduled, boolean globalAnalyze)
Run agent with a custom period in a specified intervaljava.lang.String
serializeEvent(EventData data)
Serialize anEventData
in a stringstatic java.lang.String
toJSON(java.lang.Object obj)
-
-
-
Field Detail
-
STORAGE_HANDLER_PROP_PREFIX
public static final java.lang.String STORAGE_HANDLER_PROP_PREFIX
- See Also:
- Constant Field Values
-
JCMS_ANALYTICS_ALARM_MANAGER
public static final java.lang.String JCMS_ANALYTICS_ALARM_MANAGER
- See Also:
- Constant Field Values
-
ANALYTICS_CONTEXT_MAP
public static final java.lang.String ANALYTICS_CONTEXT_MAP
- See Also:
- Constant Field Values
-
CSV_COLUMN_PREFIX
public static final java.lang.String CSV_COLUMN_PREFIX
- See Also:
- Constant Field Values
-
ANALYTICS_RESOLVEHOST_PROP
public static final java.lang.String ANALYTICS_RESOLVEHOST_PROP
- See Also:
- Constant Field Values
-
SAFARI
public static final java.lang.String SAFARI
- See Also:
- Constant Field Values
-
CHROME
public static final java.lang.String CHROME
- See Also:
- Constant Field Values
-
DOWNLOAD
public static final java.lang.String DOWNLOAD
- See Also:
- Constant Field Values
-
IPADDRESS
public static final java.lang.String IPADDRESS
- See Also:
- Constant Field Values
-
METHODE
public static final java.lang.String METHODE
- See Also:
- Constant Field Values
-
REFERER
public static final java.lang.String REFERER
- See Also:
- Constant Field Values
-
SCHEME
public static final java.lang.String SCHEME
- See Also:
- Constant Field Values
-
SERVERNAME
public static final java.lang.String SERVERNAME
- See Also:
- Constant Field Values
-
URI
public static final java.lang.String URI
- See Also:
- Constant Field Values
-
CONTEXT_PATH
public static final java.lang.String CONTEXT_PATH
- See Also:
- Constant Field Values
-
APP_URI
public static final java.lang.String APP_URI
- See Also:
- Constant Field Values
-
QUERYSTRING
public static final java.lang.String QUERYSTRING
- See Also:
- Constant Field Values
-
SESSIONID
public static final java.lang.String SESSIONID
- See Also:
- Constant Field Values
-
USERAGENT
public static final java.lang.String USERAGENT
- See Also:
- Constant Field Values
-
ZONE
public static final java.lang.String ZONE
- See Also:
- Constant Field Values
-
MEMO
public static final java.lang.String MEMO
- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
SERVERPORT
public static final java.lang.String SERVERPORT
- See Also:
- Constant Field Values
-
LOCALE
public static final java.lang.String LOCALE
- See Also:
- Constant Field Values
-
DATESTART
public static final java.lang.String DATESTART
- See Also:
- Constant Field Values
-
DATEEND
public static final java.lang.String DATEEND
- See Also:
- Constant Field Values
-
DATA
public static final java.lang.String DATA
- See Also:
- Constant Field Values
-
DATA_TYPE
public static final java.lang.String DATA_TYPE
- See Also:
- Constant Field Values
-
MEMBER
public static final java.lang.String MEMBER
- See Also:
- Constant Field Values
-
GROUPS
public static final java.lang.String GROUPS
- See Also:
- Constant Field Values
-
PORTAL
public static final java.lang.String PORTAL
- See Also:
- Constant Field Values
-
PORTAL_TITLE
public static final java.lang.String PORTAL_TITLE
- See Also:
- Constant Field Values
-
WORKSPACE
public static final java.lang.String WORKSPACE
- See Also:
- Constant Field Values
-
CURRENTCAT
public static final java.lang.String CURRENTCAT
- See Also:
- Constant Field Values
-
PORTALCAT
public static final java.lang.String PORTALCAT
- See Also:
- Constant Field Values
-
CTXTCAT
public static final java.lang.String CTXTCAT
- See Also:
- Constant Field Values
-
PUBLICATION
public static final java.lang.String PUBLICATION
- See Also:
- Constant Field Values
-
BELONGS_TO_WORKSPACE
public static final java.lang.String BELONGS_TO_WORKSPACE
- See Also:
- Constant Field Values
-
BROWSER
public static final java.lang.String BROWSER
- See Also:
- Constant Field Values
-
OS
public static final java.lang.String OS
- See Also:
- Constant Field Values
-
COUNTRY
public static final java.lang.String COUNTRY
- See Also:
- Constant Field Values
-
LANGUAGE
public static final java.lang.String LANGUAGE
- See Also:
- Constant Field Values
-
SEARCH_MODE
public static final java.lang.String SEARCH_MODE
- See Also:
- Constant Field Values
-
SEARCH_FULLTEXT
public static final java.lang.String SEARCH_FULLTEXT
- See Also:
- Constant Field Values
-
SEARCH_CATEGORY
public static final java.lang.String SEARCH_CATEGORY
- See Also:
- Constant Field Values
-
SEARCH_GROUPS
public static final java.lang.String SEARCH_GROUPS
- See Also:
- Constant Field Values
-
SEARCH_MEMBERS
public static final java.lang.String SEARCH_MEMBERS
- See Also:
- Constant Field Values
-
SEARCH_TYPES
public static final java.lang.String SEARCH_TYPES
- See Also:
- Constant Field Values
-
SEARCH_SORT
public static final java.lang.String SEARCH_SORT
- See Also:
- Constant Field Values
-
SEARCH_HIST
public static final java.lang.String SEARCH_HIST
- See Also:
- Constant Field Values
-
URID
public static final java.lang.String URID
- See Also:
- Constant Field Values
-
AUDIENCEMENT
public static final java.lang.String AUDIENCEMENT
- See Also:
- Constant Field Values
-
XFORWARD
public static final java.lang.String XFORWARD
- See Also:
- Constant Field Values
-
PRINT_VIEW
public static final java.lang.String PRINT_VIEW
- See Also:
- Constant Field Values
-
AUTHENTICATION_HANDLER
public static final java.lang.String AUTHENTICATION_HANDLER
- See Also:
- Constant Field Values
-
IS_BOT
public static final java.lang.String IS_BOT
- See Also:
- Constant Field Values
-
DATA_WORKSPACES
public static final java.lang.String DATA_WORKSPACES
- See Also:
- Constant Field Values
-
OLD_DATA_WORKSPACES
public static final java.lang.String OLD_DATA_WORKSPACES
- See Also:
- Constant Field Values
-
WF_ID
public static final java.lang.String WF_ID
- See Also:
- Constant Field Values
-
PSTATUS
public static final java.lang.String PSTATUS
- See Also:
- Constant Field Values
-
OLD_WF_ID
public static final java.lang.String OLD_WF_ID
- See Also:
- Constant Field Values
-
OLD_PSTATUS
public static final java.lang.String OLD_PSTATUS
- See Also:
- Constant Field Values
-
PATTERN_NOT_PROCESSED
public static final int PATTERN_NOT_PROCESSED
- See Also:
- Constant Field Values
-
PATTERN_PROCESSED_TRUE
public static final int PATTERN_PROCESSED_TRUE
- See Also:
- Constant Field Values
-
PATTERN_PROCESSED_FALSE
public static final int PATTERN_PROCESSED_FALSE
- See Also:
- Constant Field Values
-
BROWSERS_PROP
public static final java.lang.String BROWSERS_PROP
-
OS_PROP
public static final java.lang.String OS_PROP
-
BOT_PROP
public static final java.lang.String BOT_PROP
-
PATTERN_BOT
public static final org.apache.oro.text.regex.Pattern PATTERN_BOT
-
PATTERN_BROWSER
public static final org.apache.oro.text.regex.Pattern PATTERN_BROWSER
-
PATTERN_OS
public static final org.apache.oro.text.regex.Pattern PATTERN_OS
-
CORE
public static final java.lang.String CORE
- See Also:
- Constant Field Values
-
ACCESS
public static final java.lang.String ACCESS
- See Also:
- Constant Field Values
-
OPENAPI
public static final java.lang.String OPENAPI
- See Also:
- Constant Field Values
-
PUSH
public static final java.lang.String PUSH
- See Also:
- Constant Field Values
-
AC_SEARCH
@Deprecated public static final java.lang.String AC_SEARCH
Deprecated.Deprecated field, the context mapSEARCH_TYPE_KEY
should be used instead- See Also:
- Constant Field Values
-
SEARCH_TYPE_KEY
public static final java.lang.String SEARCH_TYPE_KEY
- See Also:
- Constant Field Values
-
AC_SEARCH_TYPE
public static final java.lang.String AC_SEARCH_TYPE
- See Also:
- Constant Field Values
-
NORMAL_SEARCH_TYPE
public static final java.lang.String NORMAL_SEARCH_TYPE
- See Also:
- Constant Field Values
-
NONE_SEARCH_TYPE
public static final java.lang.String NONE_SEARCH_TYPE
- See Also:
- Constant Field Values
-
CSRF_ERROR
public static final java.lang.String CSRF_ERROR
- See Also:
- Constant Field Values
-
AUTH_FAIL
public static final java.lang.String AUTH_FAIL
- See Also:
- Constant Field Values
-
OPENAPI_UNAVAILABLE
public static final java.lang.String OPENAPI_UNAVAILABLE
- See Also:
- Constant Field Values
-
OPENAPI_DISABLED
public static final java.lang.String OPENAPI_DISABLED
- See Also:
- Constant Field Values
-
OPENAPI_ERROR
public static final java.lang.String OPENAPI_ERROR
- See Also:
- Constant Field Values
-
OPENAPI_READ_ACCESS_DISABLED
public static final java.lang.String OPENAPI_READ_ACCESS_DISABLED
- See Also:
- Constant Field Values
-
OPENAPI_READ_ACCESS_FORBIDDEN
public static final java.lang.String OPENAPI_READ_ACCESS_FORBIDDEN
- See Also:
- Constant Field Values
-
OPENAPI_WRITE_ACCESS_DISABLED
public static final java.lang.String OPENAPI_WRITE_ACCESS_DISABLED
- See Also:
- Constant Field Values
-
OPENAPI_WRITE_ACCESS_FORBIDDEN
public static final java.lang.String OPENAPI_WRITE_ACCESS_FORBIDDEN
- See Also:
- Constant Field Values
-
OPENAPI_GLOBAL_DATA_WRITE_DISABLED
public static final java.lang.String OPENAPI_GLOBAL_DATA_WRITE_DISABLED
- See Also:
- Constant Field Values
-
OPENAPI_OK
public static final java.lang.String OPENAPI_OK
- See Also:
- Constant Field Values
-
SEARCH_ALLOWED_QS
public static java.lang.String[] SEARCH_ALLOWED_QS
-
SEARCH_ALLOWED_URI
public static java.lang.String[] SEARCH_ALLOWED_URI
-
-
Method Detail
-
getInstance
public static AnalyticsManager getInstance()
-
isDisable
public boolean isDisable()
-
isEventDataProcessing
public boolean isEventDataProcessing()
-
addEventDataListener
public void addEventDataListener(EventDataListener listener)
-
removeEventDataListener
public boolean removeEventDataListener(EventDataListener listener)
-
getEventDataListenerSet
public java.util.LinkedHashSet<EventDataListener> getEventDataListenerSet()
-
propertiesChange
public void propertiesChange(JProperties properties)
Description copied from interface:JPropertiesListener
Invoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getProperties
orchannel.getProperty
.- Specified by:
propertiesChange
in interfaceJPropertiesListener
- Parameters:
properties
- the properties which have been submitted to change
-
displayAnonymousVisitorData
public boolean displayAnonymousVisitorData()
-
checkRequirements
public boolean checkRequirements()
-
serializeEvent
public java.lang.String serializeEvent(EventData data) throws java.io.IOException
Serialize anEventData
in a string- Parameters:
data
- theEventData
- Returns:
- the JSON value
- Throws:
java.io.IOException
- Exception thrown when eventData is save as JSON data
-
getObjectMapper
public org.codehaus.jackson.map.ObjectMapper getObjectMapper()
get theObjectMapper
(cached in the class)- Returns:
- the
ObjectMapper
-
addAgent
public void addAgent(AbstractStatisticAgent agent)
add aAbstractStatisticAgent
to agent list- Parameters:
agent
- theAbstractStatisticAgent
to add
-
removeAgent
public void removeAgent(AbstractStatisticAgent agent)
remove aAbstractStatisticAgent
from agent list- Parameters:
agent
- theAbstractStatisticAgent
to remove
-
getAgents
public java.util.List<AbstractStatisticAgent> getAgents()
GetAbstractStatisticAgent
list (a copy of internal agent list)- Returns:
- the copy of internal agent list
-
getRequestCustomContextMap
public java.util.Map<java.lang.String,java.lang.String> getRequestCustomContextMap(javax.servlet.http.HttpServletRequest request)
Get the contextMap
which will be merge with existing context if it exists before writingEventData
- Parameters:
request
- the currentHttpServletRequest
(if null, context map will be get from a ThreadLocal object)- Returns:
- the context Map
-
getThreadLocalCustomContextMap
public java.util.Map<java.lang.String,java.lang.String> getThreadLocalCustomContextMap()
Get the contextMap
which will be merge with existing context if it exists before writingEventData
context map will be get from a ThreadLocal object- Returns:
- the context Map
-
removeThreadLocalCustomContextMap
public void removeThreadLocalCustomContextMap()
Remove the contextMap
which will be merge with existing context if it exists before writingEventData
-
appendEventData
public static void appendEventData(EventData eventData) throws java.io.IOException
Append a data event- Parameters:
eventData
- theEventData
to save. Context map will be extended ifgetRequestCustomContextMap(HttpServletRequest)
orgetThreadLocalCustomContextMap()
contains something- Throws:
java.io.IOException
- thrown when savingEventData
-
appendEventData
public static void appendEventData(EventData eventData, javax.servlet.http.HttpServletRequest request) throws java.io.IOException
Append a data event- Parameters:
eventData
- theEventData
to save. Context map will be extended ifgetRequestCustomContextMap(HttpServletRequest)
orgetThreadLocalCustomContextMap()
contains somethingrequest
- the currentHttpServletRequest
used to get extendedContextMapgetRequestCustomContextMap(HttpServletRequest)
for more information- Throws:
java.io.IOException
- thrown when savingEventData
-
appendPageEvent
public static void appendPageEvent(javax.servlet.http.HttpServletRequest request, long startPageRequest) throws java.io.IOException
Append a page event (like previous page stat mechanism)- Parameters:
request
- the currentHttpServletRequest
startPageRequest
- the start time of the page request- Throws:
java.io.IOException
- thrown when savingEventData
-
appendPageEvent
protected static void appendPageEvent(javax.servlet.http.HttpServletRequest request, long startPageRequest, long endPageRequest, long eventDate) throws java.io.IOException
Append a page event (like previous page stat mechanism)- Parameters:
request
- the currentHttpServletRequest
rstartPageRequest
- the start time of the page requestendPageRequest
- the end time of the page requesteventDate
- the Date of the event- Throws:
java.io.IOException
- thrown when savingEventData
-
generateAccessContextMap
public static java.util.Map<java.lang.String,java.lang.String> generateAccessContextMap(javax.servlet.http.HttpServletRequest request, EventData eventData)
-
getBrowsers
public static java.util.SortedSet<java.lang.String> getBrowsers(java.lang.String userAgent)
-
getBots
public static java.util.SortedSet<java.lang.String> getBots(java.lang.String userAgent)
-
processQueries
public static void processQueries(java.util.Map<java.lang.String,java.lang.String> ctxMap)
-
isSearchRequest
public static boolean isSearchRequest(java.lang.String uri, java.lang.String queryString)
-
runDayAgent
public void runDayAgent(java.util.Date startDate, java.util.Date endDate, Workspace workspace, java.lang.String urid, boolean scheduled, boolean globalAnalyze)
Run day agent in a specific period- Parameters:
startDate
- the start day of the periodendDate
- the end day of the periodworkspace
-Workspace
to limit analyze (null for all workspaces)urid
- the urid used in analysisscheduled
- is the run a manual run or from a schedule (alarm)globalAnalyze
- do global analyze (workspace == null in agent and report)
-
runDayAgent
public void runDayAgent(java.util.Date startDate, java.util.Date endDate, Workspace workspace, java.lang.String urid, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run day agent in a specific period- Parameters:
startDate
- the start day of the periodendDate
- the end day of the periodworkspace
-Workspace
to limit analyze (null for all workspaces)urid
- the urid used in analysisscheduled
- is the run a manual run or from a schedule (alarm)globalAnalyze
- do global analyze (workspace == null in agent and report)ignoreBeforeDate
- the date used to lower limit of files used for analyze (may be null for no lower limit)
-
runDayAgent
public void runDayAgent(java.util.Date startDate, java.util.Date endDate, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> dayAgentList, boolean scheduled, boolean globalAnalyze)
Run day agent in the specified period- Parameters:
startDate
- the start day of the periodendDate
- the end day of the periodurid
- the urid used in analysisworkspaceSet
-Workspace
Set to limit analyze (null for all workspaces)dayAgentList
-Set
of agent to runscheduled
- is the run a manual run or from alarmglobalAnalyze
- do global analyze (workspace == null in agent and report)
-
runDayAgent
public void runDayAgent(java.util.Date startDate, java.util.Date endDate, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> dayAgentList, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run day agent in the specified period- Parameters:
startDate
- the start day of the periodendDate
- the end day of the periodurid
- the urid used in analysisworkspaceSet
-Workspace
Set to limit analyze (null for all workspaces)dayAgentList
-Set
of agent to runscheduled
- is the run a manual run or from alarmglobalAnalyze
- do global analyze (workspace == null in agent and report)ignoreBeforeDate
- the date used to lower limit of files used for analyze (may be null for no lower limit)
-
runPeriodAgent2
public void runPeriodAgent2(java.util.Date startDate, java.util.Date endDate, AbstractPeriod period, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> agentList, boolean scheduled, boolean globalAnalyze)
Run agent with a custom period in a specified interval- Parameters:
startDate
- the start day of the interval (also start date of the analyzed period)endDate
- the end day of the interval (if analyzed period is greater than endDate, the real end date will be the end of the period or today)period
- theAbstractPeriod
of the analysisurid
- the urid used in analysisworkspaceSet
-Workspace
Set to limit analyze (null for all workspaces)agentList
-Set
of agent to runscheduled
- is the run a manual run or from alarmglobalAnalyze
- do global analyze (workspace == null in agent and report)
-
runPeriodAgent
public void runPeriodAgent(java.util.Date startDate, java.util.Date endDate, AbstractPeriod period, java.util.Set<Workspace> workspaceSet, java.lang.String urid, java.util.Set<AbstractStatisticAgent> agentList, boolean scheduled, boolean globalAnalyze, java.util.Date ignoreBeforeDate)
Run agent with a custom period in a specified interval- Parameters:
startDate
- the start day of the interval (also start date of the analyzed period)endDate
- the end day of the interval (if analyzed period is greater than endDate, the real end date will be the end of the period or today)period
- theAbstractPeriod
of the analysisurid
- the urid used in analysisworkspaceSet
-Workspace
Set to limit analyze (null for all workspaces)agentList
-Set
of agent to runscheduled
- is the run a manual run or from alarmglobalAnalyze
- do global analyze (workspace == null in agent and report)ignoreBeforeDate
- the date used to lower limit of files used for analyze (may be null for no lower limit)
-
getCurrentAnalyzeListener
public java.util.List<AnalyzeListener> getCurrentAnalyzeListener()
Retrieve the current analyze listener- Returns:
- the
List
ofAnalyzeListener
-
deleteAnalyze
public void deleteAnalyze(AnalyzeListener listener)
- Parameters:
listener
- theAnalyzeListener
to remove
-
initAlarms
public void initAlarms()
init analytics alarm use to compute day aggregation
-
reinitAlarms
public void reinitAlarms()
ReinitAlarms (remove all analytics alarms from analytics alarm manager and init alarms)
-
runDayAgentFromAlarm
public void runDayAgentFromAlarm()
run day agent with management of missing aggregation (from an alarm).
-
runDayAgent
public void runDayAgent()
run day agent with management of missing aggregation (manual run)
-
getIgnoreBeforeDate
public java.util.Date getIgnoreBeforeDate()
-
getUtcTime
public static java.util.Calendar getUtcTime(java.util.Date reportDate, java.util.Locale userLocale)
Retrieve a UTC time from a date- Parameters:
reportDate
- the dateuserLocale
- the locale- Returns:
- the UTC time
-
completeMetricObjectSet
public static void completeMetricObjectSet(java.util.Set<AbstractReportMetric> originalSet, java.util.Date startDate, java.util.Date endDate, java.util.Locale locale, java.lang.Class<? extends AbstractReportMetric> clazz) throws java.lang.ReflectiveOperationException
Update the provided set with some empty report metric instance if any are missing in specified interval- Parameters:
originalSet
- the original Set of AbstractReportMetricstartDate
- the start date of the intervalendDate
- the end date of the intervallocale
- the current locale (used to compute Calendar object)clazz
- AbstractReportMetric subclass to instantiate- Throws:
java.lang.ReflectiveOperationException
- Exception thrown during the execution
-
aggregateAllUrid
public static java.util.Set<AbstractReportMetric> aggregateAllUrid(java.util.Set<AbstractReportMetric> originalSet, java.lang.Class<? extends AbstractReportMetric> clazz) throws java.lang.ReflectiveOperationException
Aggregate all urid report in global report (day by day)- Parameters:
originalSet
- the original Set of AbstractReportMetricclazz
- AbstractReportMetric subclass to instantiate- Returns:
- the new Set with report aggregated
- Throws:
java.lang.ReflectiveOperationException
- Exception thrown during the execution
-
aggregateKeyIntegerMap
public static void aggregateKeyIntegerMap(java.util.Map<java.lang.String,java.lang.Integer> origMap, java.util.Map<java.lang.String,java.lang.Integer> mapToAdd)
-
aggregateKeyLongMap
public static void aggregateKeyLongMap(java.util.Map<java.lang.String,java.lang.Long> origMap, java.util.Map<java.lang.String,java.lang.Long> mapToAdd)
-
aggregateDateKeyDoubleMap
public static void aggregateDateKeyDoubleMap(java.util.Map<java.util.Date,java.lang.Double> origMap, java.util.Map<java.util.Date,java.lang.Double> mapToAdd)
-
getSortedTopMap
public java.util.SortedMap<java.lang.String,java.lang.Integer> getSortedTopMap(java.util.Map<java.lang.String,java.lang.Integer> topMap, int nbMaxElt)
-
getSortedTopMap
public static java.util.SortedMap<java.lang.String,java.lang.Integer> getSortedTopMap(java.util.Map<java.lang.String,java.lang.Integer> topMap)
-
getSortedTopDoubleMap
public java.util.SortedMap<java.lang.String,java.lang.Double> getSortedTopDoubleMap(java.util.Map<java.lang.String,java.lang.Double> topMap, int nbMaxElt)
-
getSortedTopDoubleMap
public static java.util.SortedMap<java.lang.String,java.lang.Double> getSortedTopDoubleMap(java.util.Map<java.lang.String,java.lang.Double> topMap)
-
getDeserializedContentTopMap
public static java.util.Map<java.lang.String,ContentTopValue> getDeserializedContentTopMap(java.util.Map<java.lang.String,java.lang.String> contentTopMap)
Convert a Map of String to map ofContentTopValue
- Parameters:
contentTopMap
- theMap
- Returns:
- the converted
Map
-
getSerializedContentTopMap
public static java.util.Map<java.lang.String,java.lang.String> getSerializedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> contentTopMap)
Convert a Map ofContentTopValue
to map of String- Parameters:
contentTopMap
- theMap
- Returns:
- the converted
Map
-
aggregateKeyContentTopMap
public static void aggregateKeyContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap, java.util.Map<java.lang.String,ContentTopValue> mapToAdd)
-
getSortedContentTopMap
public static java.util.SortedMap<java.lang.String,ContentTopValue> getSortedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap, int nbMaxElt)
-
getSortedContentTopMap
public static java.util.SortedMap<java.lang.String,ContentTopValue> getSortedContentTopMap(java.util.Map<java.lang.String,ContentTopValue> origContentTopMap)
-
getActionFromOp
public static java.lang.String getActionFromOp(int opAction)
-
isValidOperationAction
public static boolean isValidOperationAction(java.lang.String opAction)
-
getUrlSubString
public static java.lang.String getUrlSubString(java.lang.String value, int maxLength)
-
toJSON
public static java.lang.String toJSON(java.lang.Object obj)
-
removeToDayMetric
public static void removeToDayMetric(java.util.Set<AbstractReportMetric> originalSet)
Remove today metric, because this metric is not done.- Parameters:
originalSet
- theAbstractReportMetric
Set
-
isBot
public static boolean isBot(EventData data)
-
getCompatibleWorkspaceSet
public static java.util.Set<Workspace> getCompatibleWorkspaceSet()
Get compatible workspaces for analyze (workspace model are ignored) (without any right check)- Returns:
- the
Set
of compatibleWorkspace
-
getCompatibleWorkspaceSet
public static java.util.Set<Workspace> getCompatibleWorkspaceSet(Member loggedMember)
Get compatible workspaces for analyze (workspace model are ignored)- Parameters:
loggedMember
- Member to check rights- Returns:
- the
Set
of compatibleWorkspace
-
normalizeMap
public static java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> normalizeMap(java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> dataMap)
Normalize a Map<String, Map<Date, Double>> Map to have value in percentage day by day- Parameters:
dataMap
- the map to normalize- Returns:
- the new normalized Map
-
keptBest
public static java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> keptBest(java.util.Map<java.lang.String,java.util.Map<java.util.Date,java.lang.Double>> dataMap, int nbElement, java.lang.String othersKey)
Compute a new map by top x data and grouping other data.- Parameters:
dataMap
- the data mapnbElement
- the number of non grouped elementothersKey
- the key of grouped element- Returns:
- the new map with grouped data
-
getAjaxDisplayMinimumPeriod
public long getAjaxDisplayMinimumPeriod()
indicate when ajax display must be used in report display- Returns:
- the mininum period between the begin and end date of report display to use ajax asynchronous rendering.
-
createRatioSeries
public static RatioSeries createRatioSeries(java.util.Map<java.lang.String,java.lang.Integer> map, java.lang.String prefix, java.lang.String userLang)
Util method use in analytics display (to avoid lambda in JSP)- Parameters:
map
- the inputMap
prefix
- the prefix to use for labeluserLang
- the userLang used to get serie's label- Returns:
- the
RatioSeries
-
getEventDataProvider
public AbstractEventDataProvider getEventDataProvider(StatisticContext context)
-
encodeForJsonCsv
public static java.lang.String encodeForJsonCsv(java.lang.String userLang, PieChart chart) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
encodeForJsonCsv
public static java.lang.String encodeForJsonCsv(java.lang.String userLang, java.time.ZoneId zoneId, TimeChart chart) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
encodeForJsonCsv
public static java.lang.String encodeForJsonCsv(java.util.Map<java.lang.String,java.lang.Integer> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.Class<?> keyClass) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
encodeForJsonCsv
public static java.lang.String encodeForJsonCsv(java.util.Map<java.lang.String,java.lang.Integer> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.String keyType) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
encodeContentTopValueMapForJsonCsv
public static java.lang.String encodeContentTopValueMapForJsonCsv(java.util.Map<java.lang.String,ContentTopValue> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.Class<?> keyClass) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
encodeContentTopValueMapForJsonCsv
public static java.lang.String encodeContentTopValueMapForJsonCsv(java.util.Map<java.lang.String,ContentTopValue> valueMap, java.lang.String idColumnName, java.lang.String secondColumnName, java.lang.String valueColumnName, java.lang.String userLang, java.lang.String keyType) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, java.io.IOException
- Throws:
org.codehaus.jackson.JsonGenerationException
org.codehaus.jackson.map.JsonMappingException
java.io.IOException
-
-