Package io.meeds.analytics.utils
Class AnalyticsUtils
java.lang.Object
io.meeds.analytics.utils.AnalyticsUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final PatternEvery parameter name carrying the storage's own alternative-name suffix, which no page has a reason to send.static final DateTimeFormatterstatic final StringDefault ofanalytics.es.index.prefix, the weekly index name prefixstatic final Stringstatic final StringThe activity type a stream post or comment event carries as a parameter.static final Stringstatic final Stringstatic final Stringstatic final StringThe document id, written by the storage as a fixed field.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final shortstatic final Stringstatic final Stringstatic final PatternThe parameter names a page may never set on a websocket event: every field the storage writes as a fixed field but the space, which the listener resolves itself, the origin and the collaborative-activity field, each with its alternative names.The names ofSPACE_ATTRIBUTES.static final List<SpaceStatisticAttribute> The attributes stamped on an event for its space, the only ones ever written: a page value sent under one of these names is dropped on the websocket path, and the typed writer of each keeps its Elasticsearch mapping (a long for a count or a time, never a keyword).static final PatternThe parameters of the space family a page may send, read once by the websocket listener to resolve the space, then dropped.static final StringKeyword parameter the websocket path stamps on every event it records, so that a query tells a browser event from a server one; a server emitter never sets it.static final StringThe one value ofSTATISTIC_ORIGIN.static final Stringstatic final DateTimeFormatterstatic final DateTimeFormatterstatic final DateTimeFormatter -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddActivityStatisticsData(StatisticData statisticData, org.exoplatform.social.core.activity.model.ExoSocialActivity activity) static voidaddCategoryLinkStatistics(StatisticData statisticData, io.meeds.social.category.model.CategoryObject categoryObject) static voidaddCategoryStatistics(StatisticData statisticData, long categoryId) static voidaddCategoryStatistics(StatisticData statisticData, io.meeds.social.category.model.Category category) static voidaddSpaceStatistics(StatisticData statisticData, org.exoplatform.social.core.space.model.Space space) static voidaddStatisticData(StatisticData statisticData) static final StringcollectionToJSONString(String value) static final StringcompueLabel(String chartKey, String chartValue) static voidconvertFieldName(Supplier<String> supplier, Consumer<String> consumer, Set<StatisticFieldMapping> mappings, boolean isAggregation) static final StringfixJSONStringFormat(String jsonString) static StringformatDate(long timeInMilliseconds) static final <T> TfromJsonString(String value, Class<T> resultClass) static StringgetAlternativeFieldName(String fieldName, int alternativeIndex) static StringgetBaseFieldName(String fieldName) static longstatic org.exoplatform.social.core.identity.model.IdentitygetIdentity(String identityIdString) static org.exoplatform.social.core.identity.model.IdentitygetIdentity(String providerId, String remoteId) static longgetIdentityId(String identityId) static longgetIdentityId(String providerId, String remoteId) static com.fasterxml.jackson.databind.JsonNodegetJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, int i, String... keys) static org.exoplatform.social.core.space.model.SpacegetSpaceById(String spaceId) static org.exoplatform.social.core.space.model.SpacegetSpaceByPrettyName(String prettyName) static longgetUserIdentityId(String username) static longgetUserIdentityId(org.exoplatform.services.security.ConversationState currentState) static StringgetUsername(org.exoplatform.services.security.ConversationState currentState) static final StringgetYearMonth(long timestamp) static final StringgetYearMonth(LocalDateTime date) static final StringgetYearMonthDay(long timestamp) static final StringgetYearMonthDay(LocalDateTime date) static final StringgetYearMonthDayHour(long timestamp) static final Stringstatic final StringgetYearWeek(long timestamp) static final StringgetYearWeek(LocalDateTime date) static booleanisUnkownUser(String username) static com.fasterxml.jackson.databind.node.ObjectNodesortByAnalyticsDate(org.json.JSONObject input) Deprecated, for removal: This API element is subject to removal in a future version.static com.fasterxml.jackson.databind.node.ObjectNodesortByAnalyticsDate(org.json.JSONObject input, String indexPrefix) Sorts the indices of an Elasticsearch_mappingresponse by the date carried in their name, oldest first.static longstatic final StringtoJsonString(Object object)
-
Field Details
-
MAX_BULK_DOCUMENTS
public static final short MAX_BULK_DOCUMENTS- See Also:
-
VALUES_SEPARATOR
- See Also:
-
FIELD_ID
The document id, written by the storage as a fixed field.- See Also:
-
FIELD_IS_ANALYTICS
- See Also:
-
FIELD_ERROR_MESSAGE
- See Also:
-
FIELD_ERROR_CODE
- See Also:
-
FIELD_STATUS
- See Also:
-
FIELD_OPERATION
- See Also:
-
FIELD_SUB_MODULE
- See Also:
-
FIELD_MODULE
- See Also:
-
FIELD_SPACE_ID
- See Also:
-
FIELD_DURATION
- See Also:
-
FIELD_USER_ID
- See Also:
-
FIELD_TIMESTAMP
- See Also:
-
FIELD_ACTIVITY_TYPE
The activity type a stream post or comment event carries as a parameter.- See Also:
-
ALTERNATIVE_FIELD_SUFFIX
- See Also:
-
STATISTIC_ORIGIN
Keyword parameter the websocket path stamps on every event it records, so that a query tells a browser event from a server one; a server emitter never sets it.- See Also:
-
STATISTIC_ORIGIN_WEBSOCKET
The one value ofSTATISTIC_ORIGIN.- See Also:
-
RESERVED_PARAMETER_NAMES
The parameter names a page may never set on a websocket event: every field the storage writes as a fixed field but the space, which the listener resolves itself, the origin and the collaborative-activity field, each with its alternative names. -
ALTERNATIVE_PARAMETER_NAMES
Every parameter name carrying the storage's own alternative-name suffix, which no page has a reason to send. -
SPACE_PARAMETER_NAMES
The parameters of the space family a page may send, read once by the websocket listener to resolve the space, then dropped. -
SPACE_ATTRIBUTES
The attributes stamped on an event for its space, the only ones ever written: a page value sent under one of these names is dropped on the websocket path, and the typed writer of each keeps its Elasticsearch mapping (a long for a count or a time, never a keyword). -
SPACE_ATTRIBUTE_NAMES
The names ofSPACE_ATTRIBUTES. -
DEFAULT_INDEX_PREFIX
Default ofanalytics.es.index.prefix, the weekly index name prefix- See Also:
-
MAX_ALTERNATIVE_FIELD_COUNT
public static final int MAX_ALTERNATIVE_FIELD_COUNT- See Also:
-
FIELD_MODIFIER_USER_SOCIAL_ID
- See Also:
-
FIELD_SOCIAL_IDENTITY_ID
- See Also:
-
LINK_ACTIVITY_TYPE
- See Also:
-
FILE_SPACES_ACTIVITY_TYPE
- See Also:
-
ACTIVITY_COMMENT
- See Also:
-
PROFILE_PROPERTIES
- See Also:
-
EXTERNAL_USER_SOURCE
- See Also:
-
PROPERTIES
- See Also:
-
COMPUTED_CHART_LABEL
-
DATE_FORMATTER
-
DEFAULT_FIELDS
-
YEAR_WEEK
-
YEAR_MONTH
-
YEAR_MONTH_DATE_HOUR
-
-
Method Details
-
getYearMonthDayHour
-
getYearMonthDayHour
-
getYearMonthDay
-
getYearMonthDay
-
getYearMonth
-
getYearMonth
-
getYearWeek
-
getYearWeek
-
toJsonString
-
compueLabel
-
fromJsonString
-
timeToMilliseconds
-
fixJSONStringFormat
-
collectionToJSONString
-
getJsonNode
public static com.fasterxml.jackson.databind.JsonNode getJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, int i, String... keys) -
addStatisticData
-
getUserIdentityId
-
getSpaceByPrettyName
-
getSpaceById
-
getIdentity
public static org.exoplatform.social.core.identity.model.Identity getIdentity(String identityIdString) -
getIdentityId
-
getIdentity
-
getIdentityId
-
getUserIdentityId
public static long getUserIdentityId(org.exoplatform.services.security.ConversationState currentState) -
getCurrentUserIdentityId
public static long getCurrentUserIdentityId() -
isUnkownUser
-
getUsername
-
formatDate
-
addSpaceStatistics
public static void addSpaceStatistics(StatisticData statisticData, org.exoplatform.social.core.space.model.Space space) -
addActivityStatisticsData
public static void addActivityStatisticsData(StatisticData statisticData, org.exoplatform.social.core.activity.model.ExoSocialActivity activity) -
addCategoryStatistics
-
addCategoryStatistics
public static void addCategoryStatistics(StatisticData statisticData, io.meeds.social.category.model.Category category) -
addCategoryLinkStatistics
public static void addCategoryLinkStatistics(StatisticData statisticData, io.meeds.social.category.model.CategoryObject categoryObject) -
convertFieldName
-
getAlternativeFieldName
-
getBaseFieldName
-
sortByAnalyticsDate
@Deprecated(since="7.3.0", forRemoval=true) public static com.fasterxml.jackson.databind.node.ObjectNode sortByAnalyticsDate(org.json.JSONObject input) Deprecated, for removal: This API element is subject to removal in a future version.since 7.3.0, for removal: assumes the default index prefix, which made the mapping read return nothing on a deployment with a customanalytics.es.index.prefix(EXO-90504). UsesortByAnalyticsDate(JSONObject, String)with the configured prefix. -
sortByAnalyticsDate
public static com.fasterxml.jackson.databind.node.ObjectNode sortByAnalyticsDate(org.json.JSONObject input, String indexPrefix) Sorts the indices of an Elasticsearch_mappingresponse by the date carried in their name, oldest first.- Parameters:
input- the_mappingresponse, keyed by index nameindexPrefix- the configuredanalytics.es.index.prefix; an index whose name is not<prefix>_yyyy-MM-ddis left out- Returns:
- the same entries, in ascending date order
-
analytics.es.index.prefix(EXO-90504).