Package io.meeds.analytics.api.service
Interface CollaborativeActivityService
public interface CollaborativeActivityService
The definition of what counts as a collaborative activity, merged from the
declarations each emitting addon ships as a classpath resource named
DECLARATION_FILE at the root of its services jar. The definition is
loaded once at startup and only read afterwards; it is applied at query time,
through the virtual field FIELD_NAME, and never stored with an
event.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClasspath resource name of an addon's declarationstatic final StringName of the virtual field a query filters on; no document carries itstatic final StringOperation recorded for a stream post, declared by Socialstatic final StringOperation recorded for a stream comment, declared by Socialstatic final StringThe one value of the virtual field -
Method Summary
Modifier and TypeMethodDescriptionvoidappendFilterClause(StringBuilder esQuery, boolean negated, List<String> activityTypeFields) Appends to the given query the Elasticsearch clause that selects the collaborative events: oneboolclause, wrapped in amust_notwhen negated, built fromtermsandexistsconditions only.getBrowserOperationModule(String operation) booleanisBrowserOperation(String operation) booleanisCollaborative(String operation, String activityType, String statisticOrigin) The same rule asappendFilterClause(java.lang.StringBuilder, boolean, java.util.List<java.lang.String>), evaluated on one event.
-
Field Details
-
FIELD_NAME
Name of the virtual field a query filters on; no document carries it- See Also:
-
YES
The one value of the virtual field- See Also:
-
DECLARATION_FILE
Classpath resource name of an addon's declaration- See Also:
-
STREAM_ACTIVITY_OPERATION
Operation recorded for a stream post, declared by Social- See Also:
-
STREAM_COMMENT_OPERATION
Operation recorded for a stream comment, declared by Social- See Also:
-
-
Method Details
-
getDefinition
CollaborativeActivityDefinition getDefinition()- Returns:
- the merged definition, with the declarations it was built from
-
appendFilterClause
Appends to the given query the Elasticsearch clause that selects the collaborative events: oneboolclause, wrapped in amust_notwhen negated, built fromtermsandexistsconditions only.- Parameters:
esQuery- the query being built, positioned inside amustlist, where the clause is appended as one more element (the caller writes the separators)negated- whether the filter selects the events that are not collaborativeactivityTypeFields- the names under which an event's activity type may be stored:activityTypeand every alternative name the mapping holds for it
-
isCollaborative
The same rule asappendFilterClause(java.lang.StringBuilder, boolean, java.util.List<java.lang.String>), evaluated on one event.- Parameters:
operation- the event's operationactivityType- the event's activity type, when it carries onestatisticOrigin- the event's origin parameter, when it carries one- Returns:
- true when the event is a collaborative activity
-
isBrowserOperation
- Parameters:
operation- an operation name- Returns:
- true when an addon declares that operation as emitted from the browser through the analytics websocket
-
getBrowserOperationModule
- Parameters:
operation- a browser operation name- Returns:
- the module the declaring addon stores that operation under, or null when the operation is not declared as a browser operation
-