Interface XWikiStatsService

  • All Known Implementing Classes:
    XWikiStatsServiceImpl

    public interface XWikiStatsService
    Store and retrieve statistics.
    Version:
    $Id: 23b74093eea7f74218875d12be942cef51f7747d $
    • Method Detail

      • init

        void init​(XWikiContext context)
        Methods called just one time at XWiki initialization.
        Parameters:
        context - the XWiki context.
      • getRecentActions

        Collection<?> getRecentActions​(String action,
                                       int size,
                                       XWikiContext context)
        Return the statistics action stored.
        Parameters:
        action - the action.
        size - the maximum size of the list to return.
        context - the XWiki context.
        Returns:
        the list of recent statistics action stored.
      • getDocumentStatistics

        List<DocumentStats> getDocumentStatistics​(String action,
                                                  Scope scope,
                                                  Period period,
                                                  Range range,
                                                  XWikiContext context)
        Retrieves document statistics.
        Parameters:
        action - the action the results should be ordered by. It can be one of: "view", "save" or "download". If the action is "view" then the documents are ordered by the number of times they have been viewed so far.
        scope - the set of documents for which to retrieve statistics.
        period - the period of time.
        range - the sub-range to return from the entire result set. Use this parameter for pagination.
        context - the XWiki context.
        Returns:
        A list of DocumentStats objects
      • getVisitStatistics

        List<VisitStats> getVisitStatistics​(String action,
                                            Period period,
                                            Range range,
                                            XWikiContext context)
        Retrieves visit statistics.
        Parameters:
        action - the action the results should be ordered by. It can be one of: "view", "save" or "download". If the action is "view" then the visitors are ordered by the number of pages they have viewed so far.
        period - the period of time.
        range - the sub-range to return from the entire result set. Use this parameter for pagination.
        context - the XWiki context.
        Returns:
        a list of VisitStats objects.
      • getRefererStatistics

        List<RefererStats> getRefererStatistics​(String domain,
                                                Scope scope,
                                                Period period,
                                                Range range,
                                                XWikiContext context)
        Retrieves referrer statistics.
        Parameters:
        domain - the domain for which to retrieve statistics. To retrieve statistics for all domains use the empty string.
        scope - the scope of referred documents to use for filtering the results.
        period - the period of time.
        range - the sub-range to return from the entire result set. Use this parameter for pagination.
        context - the XWiki context.
        Returns:
        a list of RefererStats objects.
      • getBackLinkStatistics

        List<?> getBackLinkStatistics​(String domain,
                                      Scope scope,
                                      Period period,
                                      Range range,
                                      XWikiContext context)
        Retrieves back-link statistics.
        Parameters:
        domain - the domain used for filtering the results.
        scope - the scope of referred documents for which to retrieve statistics.
        period - the period of time.
        range - the sub-range to return from the entire result set. Use this parameter for pagination.
        context - the XWiki context.
        Returns:
        a list of DocumentStats objects.
      • getActionStatistics

        Map<?,​?> getActionStatistics​(String action,
                                           Scope scope,
                                           Period period,
                                           Duration step,
                                           XWikiContext context)
        Shows how the statistics for the specified action have evolved over the specified period of time.
        Parameters:
        action - the action for which to retrieve statistics.
        scope - the set of documents to consider.
        period - the period of time.
        step - the step used for sampling the period.
        context - the XWiki context.
        Returns:
        a map of (date, actionCount) pairs.