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 Details

    • FIELD_NAME

      static final String FIELD_NAME
      Name of the virtual field a query filters on; no document carries it
      See Also:
    • YES

      static final String YES
      The one value of the virtual field
      See Also:
    • DECLARATION_FILE

      static final String DECLARATION_FILE
      Classpath resource name of an addon's declaration
      See Also:
    • STREAM_ACTIVITY_OPERATION

      static final String STREAM_ACTIVITY_OPERATION
      Operation recorded for a stream post, declared by Social
      See Also:
    • STREAM_COMMENT_OPERATION

      static final String STREAM_COMMENT_OPERATION
      Operation recorded for a stream comment, declared by Social
      See Also:
  • Method Details

    • getDefinition

      Returns:
      the merged definition, with the declarations it was built from
    • appendFilterClause

      void appendFilterClause(StringBuilder esQuery, boolean negated, List<String> activityTypeFields)
      Appends to the given query the Elasticsearch clause that selects the collaborative events: one bool clause, wrapped in a must_not when negated, built from terms and exists conditions only.
      Parameters:
      esQuery - the query being built, positioned inside a must list, where the clause is appended as one more element (the caller writes the separators)
      negated - whether the filter selects the events that are not collaborative
      activityTypeFields - the names under which an event's activity type may be stored: activityType and every alternative name the mapping holds for it
    • isCollaborative

      boolean isCollaborative(String operation, String activityType, String statisticOrigin)
      Parameters:
      operation - the event's operation
      activityType - the event's activity type, when it carries one
      statisticOrigin - the event's origin parameter, when it carries one
      Returns:
      true when the event is a collaborative activity
    • isBrowserOperation

      boolean isBrowserOperation(String operation)
      Parameters:
      operation - an operation name
      Returns:
      true when an addon declares that operation as emitted from the browser through the analytics websocket
    • getBrowserOperationModule

      String getBrowserOperationModule(String operation)
      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