Interface AnalyticsService


public interface AnalyticsService
  • Method Details

    • computeChartData

      ChartDataList computeChartData(AnalyticsFilter filter)
      Retrieve analytics chart data
      Parameters:
      filter - used search filters and aggregations to compute data
      Returns:
      computed analytics chart data
    • computePercentageChartData

      PercentageChartResult computePercentageChartData(AnalyticsPercentageFilter filter)
      Retrieve analytics percentage chart data
      Parameters:
      filter - used search filters and aggregations to compute data
      Returns:
      computed analytics chart data
    • computeTableColumnData

      TableColumnResult computeTableColumnData(TableColumnResult columnResult, AnalyticsTableFilter tableFilter, AnalyticsFilter filter, AnalyticsPeriod period, AnalyticsPeriodType periodType, int columnIndex, boolean isValue)
      Retrieve analytics table data
      Parameters:
      columnResult - existing column result to use for result comptuing
      tableFilter - overall configured table filter
      filter - used search filters and aggregations to compute data
      period - selected AnalyticsPeriod
      periodType - selected AnalyticsPeriodType
      columnIndex - column index in the configured table filter
      isValue - whether the filter to compute is for value or threshold
      Returns:
      computed analytics table column data
    • computePercentageChartData

      PercentageChartValue computePercentageChartData(AnalyticsFilter filter, AnalyticsPeriod currentPeriod, AnalyticsPeriod previousPeriod, boolean hasLimitAggregation)
      Retrieve analytics percentage chart data
      Parameters:
      filter - used search filters and aggregations to compute data
      currentPeriod - current period of time
      previousPeriod - previous period of time to compare with
      hasLimitAggregation - whether aggregations has limit aggregation or not
      Returns:
      PercentageChartValue containing current and previous values and thresholds
    • retrieveData

      List<StatisticData> retrieveData(AnalyticsFilter searchFilter)
      Retrieve data using search filters
      Parameters:
      searchFilter -
      Returns:
      List of StatisticData
    • retrieveData

      List<StatisticData> retrieveData(List<AnalyticsFieldFilter> filters, long offset, long limit, ZoneId timeZone)
      Retrieve data using search filters
      Parameters:
      filters - Search filters
      offset - Search Offset
      limit - Search limit results to return
      timeZone - dates interpretation timezone
      Returns:
      List of StatisticData
    • retrieveMapping

      Set<StatisticFieldMapping> retrieveMapping(boolean forceRefresh)
      Parameters:
      forceRefresh - whether force refresh from ES or not
      Returns:
      a Set of ES mapping fields
    • retrieveFieldValues

      List<StatisticFieldValue> retrieveFieldValues(String field, int limit)
      Retrieve values of a selected field
      Parameters:
      field - name of esField
      limit - limit of results to retrieve
      Returns:
      List of field values of type StatisticFieldValue
    • isKeywordField

      boolean isKeywordField(String name)
      Whether a page may write the given parameter as a keyword: true when the field is unknown to the mapping, or when its base mapping and every alternative name of it are mapped keyword or text, on the published mapping view and on the mappings the storage created since it started, which the view may not hold yet. A field a server writer typed otherwise (a long, a boolean, a date, a float) stays closed to pages whatever variant is the latest.
      Parameters:
      name - the parameter name a page sent
      Returns:
      true when the value may be stored as a keyword under that name
    • getAdministratorsPermissions

      List<String> getAdministratorsPermissions()
      Returns:
      the analytics permission expression
    • getViewAllPermissions

      List<String> getViewAllPermissions()
      Returns:
      the List of permission expression of users that can access all analytics datas
    • getViewPermissions

      List<String> getViewPermissions()
      Returns:
      the List of permission expression of users that can access their (and their spaces they are member of) analytics datas
    • getUIWatchers

      List<StatisticWatcher> getUIWatchers()
      Returns:
      List of StatisticWatcher containing DOM selectors of elements to watch
    • getUIWatcher

      StatisticWatcher getUIWatcher(String name)
      Parameters:
      name - corresponding UI watcher name, see StatisticWatcher#getName()
      Returns:
      StatisticWatcher having switch corresponding name
    • addUIWatcher

      void addUIWatcher(StatisticWatcher uiWatcher)
      Parameters:
      uiWatcher - StatisticWatcher containing DOM selector of elements to watch
    • getSamples

      default List<StatisticData> getSamples(List<String> operations, String fieldName, List<String> fieldValues, String sortBy, String sortDirection, int limit)
      Parameters:
      operations - (Optional) List of collected operations to consider
      fieldName - (Optional) Field Name to filter
      fieldValues - (Optional) Field values to filter
      sortBy - ignored, kept for compatibility: the samples come newest first
      sortDirection - ignored, kept for compatibility: the samples come newest first
      limit - limit of results to retrieve
      Returns:
      List of StatisticData representing the collected data, newest first
    • getSamples

      List<StatisticData> getSamples(List<String> operations, String fieldName, List<String> fieldValues, String sortBy, String sortDirection, int limit, boolean collaborativeOnly)
      Parameters:
      operations - (Optional) List of collected operations to consider
      fieldName - (Optional) Field Name to filter
      fieldValues - (Optional) Field values to filter
      sortBy - ignored, kept for compatibility: the samples come newest first
      sortDirection - ignored, kept for compatibility: the samples come newest first
      limit - limit of results to retrieve
      collaborativeOnly - whether to keep the collaborative activities only, through a filter on CollaborativeActivityService.FIELD_NAME
      Returns:
      List of StatisticData representing the collected data, newest first
    • getChart

      default ChartDataList getChart(List<String> operations, String fieldName, List<String> fieldValues, String xAggregationField, AnalyticsAggregationType xAggregationType, String xAggregationSortDirection, String yAggregationField, AnalyticsAggregationType yAggregationType, String yAggregationSortDirection, int limit)
      Parameters:
      operations - (Optional) List of collected operations to consider
      fieldName - (Optional) Field Name to filter
      fieldValues - (Optional) Field values to filter
      xAggregationField - x axis field
      xAggregationType - x axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAM
      xAggregationSortDirection - sort direction: asc or desc
      yAggregationField - y axis field
      yAggregationType - y axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAM
      yAggregationSortDirection - sort direction: asc or desc
      limit - limit of x Axis results to retrieve
      Returns:
      ChartDataList
    • getChart

      ChartDataList getChart(List<String> operations, String fieldName, List<String> fieldValues, String xAggregationField, AnalyticsAggregationType xAggregationType, String xAggregationSortDirection, String yAggregationField, AnalyticsAggregationType yAggregationType, String yAggregationSortDirection, int limit, boolean collaborativeOnly)
      Parameters:
      operations - (Optional) List of collected operations to consider
      fieldName - (Optional) Field Name to filter
      fieldValues - (Optional) Field values to filter
      xAggregationField - x axis field
      xAggregationType - x axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAM
      xAggregationSortDirection - sort direction: asc or desc
      yAggregationField - y axis field
      yAggregationType - y axis aggregation type: MAX, MIN, SUM, COUNT, CARDINALITY (COUNT Distinct), TERMS, DATA or HISTOGRAM
      yAggregationSortDirection - sort direction: asc or desc
      limit - limit of x Axis results to retrieve
      collaborativeOnly - whether to keep the collaborative activities only, through a filter on CollaborativeActivityService.FIELD_NAME
      Returns:
      ChartDataList