Class Tracker


  • public class Tracker
    extends Object
    Author:
    pvandermaesen the class for seralize the a track event and read the track event.
    • Constructor Detail

      • Tracker

        public Tracker()
    • Method Detail

      • clearCache

        public void clearCache()
      • trace

        public static void trace​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws Exception
        Throws:
        Exception
      • getClickCount

        public int getClickCount​(StatContext statCtx)
        get all session for a statCtx.
        Parameters:
        statCtx -
        Returns:
        number of session
      • getCountAccessNoTemplate

        public int getCountAccessNoTemplate​(Date from,
                                            Date to,
                                            String path)
      • getLanguage

        public Map<String,​Integer> getLanguage​(StatContext statCtx)
        return a count of access by language
        Returns:
        a array of language, key is language, value if a Interger ; click for the language
      • getLanguage

        public static String getLanguage​(String path)
      • getLanguageDEBUG

        public static String getLanguageDEBUG​(String path)
      • getLanguage

        public static String getLanguage​(Track inTrack,
                                         Track[] tracks)
      • getModes

        public int[] getModes​(StatContext statCtx)
        return a count of access by mode 0 : view 1 : edit 2 : preview
        Returns:
        a array of count.
      • getPagesByDay

        public Map<Integer,​Integer> getPagesByDay​(StatContext statCtx)
        return click by day
        Parameters:
        statCtx - statistic context
        Returns:
        a map day (Calendar) is the key count of click is the value
        Throws:
        DAOException
      • getPagesByHour

        public Map<Integer,​Integer> getPagesByHour​(StatContext statCtx)
        return click by day
        Parameters:
        statCtx - statistic context
        Returns:
        a map hours (Calendar) is the key count of click is the value
        Throws:
        DAOException
      • getPathCountAccess

        public int getPathCountAccess​(Date from,
                                      Date to,
                                      String path)
      • getPathCountAccess

        public int getPathCountAccess​(int dayFromHere,
                                      String path)
      • getResourcePathCountAccess

        public int getResourcePathCountAccess​(Date from,
                                              Date to,
                                              String path)
      • getAllTrack

        public Track[] getAllTrack​(Date day)
        get list of track access to a resource.
        Returns:
        a list of track.
      • getResourceTracks

        public Track[] getResourceTracks​(Date from,
                                         Date to)
      • getSession2ClickCount

        public int getSession2ClickCount​(StatContext statCtx)
        get all session for a statCtx.
        Parameters:
        statCtx -
        Returns:
        number of session
      • getSessionByDay

        public Map<Integer,​Integer> getSessionByDay​(StatContext statCtx)
        return click by day
        Parameters:
        statCtx - statistic context
        Returns:
        a map day (Calendar) is the key count of click is the value
        Throws:
        DAOException
      • getSessionByMonth

        public Map<Integer,​Integer> getSessionByMonth​(StatContext statCtx)
        return session by month
        Parameters:
        statCtx - statistic context
        Returns:
        a map month (Calendar) is the key count of click is the value
        Throws:
        DAOException
      • getSessionCount

        public int getSessionCount​(StatContext statCtx)
        get all session for a statCtx.
        Parameters:
        statCtx -
        Returns:
        number of session
      • getTimeTracking

        public Map<String,​double[]> getTimeTracking​(StatContext statCtx)
        return the time pass on a page ( time between the click on the page and the next click in the same session )
        Returns:
        a map with path as key and a array with total time in index 0 and click count in index 1
        Throws:
        DAOException
      • getViewClickTracks

        public Track[] getViewClickTracks​(Date from,
                                          Date to)
      • getClickTracks

        public Track[] getClickTracks​(Date from,
                                      Date to)
      • getViewClickTracks

        public Track[] getViewClickTracks​(Date from,
                                          Date to,
                                          String path)