Package org.javlo.tracking
Class Tracker
- java.lang.Object
-
- org.javlo.tracking.Tracker
-
public class Tracker extends Object
- Author:
- pvandermaesen the class for seralize the a track event and read the track event.
-
-
Field Summary
Fields Modifier and Type Field Description static StringTRACKING_PARAM
-
Constructor Summary
Constructors Constructor Description Tracker()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTrack(Track track)voidclearCache()Track[]getAllTrack(Date day)get list of track access to a resource.intgetClickCount(StatContext statCtx)get all session for a statCtx.Track[]getClickTracks(Date from, Date to)intgetCountAccessNoTemplate(Date from, Date to, String path)List<DayInfo>getDayInfos(StatContext statCtx)static List<DayInfo>getDayInfos(StatContext statCtx, TimeMap<Long,DayInfo> dayInfoCache, String trackingDir)static StringgetLanguage(String path)Map<String,Integer>getLanguage(StatContext statCtx)return a count of access by languagestatic StringgetLanguage(Track inTrack, Track[] tracks)static StringgetLanguageDEBUG(String path)intgetLastDayPathReading(String path)intgetLastMountPathReading(String path)intgetLastYearPathReading(String path)int[]getModes(StatContext statCtx)return a count of access by mode 0 : view 1 : edit 2 : previewMap<Integer,Integer>getPagesByDay(StatContext statCtx)return click by dayMap<Integer,Integer>getPagesByHour(StatContext statCtx)return click by dayString[][]getPagesTracking(StatContext statCtx)intgetPathCountAccess(int dayFromHere, String path)intgetPathCountAccess(Date from, Date to, String path)Map<String,Integer>getReferer(StatContext statCtx)get the referer count by nameintgetResourceCountAccess(ContentContext ctx, int dayFromHere, StaticInfo staticInfo)intgetResourcePathCountAccess(Date from, Date to, String path)Track[]getResourceTracks(Date from, Date to)Map<Integer,Integer[]>getSession2ClickByMonth(StatContext statCtx)Map<Integer,Integer[]>getSession2ClickByMonth(StatContext statCtx, GlobalContext globalContext)intgetSession2ClickCount(StatContext statCtx)get all session for a statCtx.Map<Integer,Integer>getSessionByDay(StatContext statCtx)return click by dayMap<Integer,Integer>getSessionByMonth(StatContext statCtx)return session by monthintgetSessionCount(StatContext statCtx)get all session for a statCtx.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 )static TrackergetTracker(GlobalContext globalContext, javax.servlet.http.HttpSession session)Track[]getTracks(Date from, Date to)Track[]getTracks(Date from, Date to, String path)Track[]getViewClickTracks(Date from, Date to)Track[]getViewClickTracks(Date from, Date to, String path)static voidmain(String[] args)static voidtrace(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
-
-
Field Detail
-
TRACKING_PARAM
public static final String TRACKING_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTracker
public static final Tracker getTracker(GlobalContext globalContext, javax.servlet.http.HttpSession session) throws ServiceException
- Throws:
ServiceException
-
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
-
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
-
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
-
getPagesTracking
public String[][] getPagesTracking(StatContext statCtx)
-
getPathCountAccess
public int getPathCountAccess(int dayFromHere, String path)
-
getReferer
public Map<String,Integer> getReferer(StatContext statCtx)
get the referer count by name
-
getAllTrack
public Track[] getAllTrack(Date day)
get list of track access to a resource.- Returns:
- a list of track.
-
getResourceCountAccess
public int getResourceCountAccess(ContentContext ctx, int dayFromHere, StaticInfo staticInfo) throws Exception
- Throws:
Exception
-
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
-
getSession2ClickByMonth
public Map<Integer,Integer[]> getSession2ClickByMonth(StatContext statCtx, GlobalContext globalContext)
-
getSession2ClickByMonth
public Map<Integer,Integer[]> getSession2ClickByMonth(StatContext statCtx) throws IOException
- Throws:
IOException
-
getLastMountPathReading
public int getLastMountPathReading(String path) throws IOException
- Throws:
IOException
-
getLastYearPathReading
public int getLastYearPathReading(String path) throws IOException
- Throws:
IOException
-
getLastDayPathReading
public int getLastDayPathReading(String path) throws IOException
- Throws:
IOException
-
getDayInfos
public List<DayInfo> getDayInfos(StatContext statCtx) throws IOException
- Throws:
IOException
-
getDayInfos
public static List<DayInfo> getDayInfos(StatContext statCtx, TimeMap<Long,DayInfo> dayInfoCache, String trackingDir) throws IOException
- Throws:
IOException
-
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
-
main
public static void main(String[] args) throws IOException
- Throws:
IOException
-
-