corelib.services.web.statistics
Class StatisticManager

java.lang.Object
  extended by corelib.services.web.statistics.StatisticManager

public class StatisticManager
extends java.lang.Object

This class manage requests to the Ellipse statistic service. This class implements a singleton design patterns: only one instance of this service can be launched per web application.

This service used to the web application deployement descriptor configuration (WEB-INF/web.xml). You can see below the init parameters related to the Ellipse Statitics service and there default values. If you use this configuration, you can invoke the service with this URL: http://localhost/applicationName/Stats.wp.

 
 <context-param>
     <param-name>STATISTICS_ENABLED</param-name>
     <param-value>false</param-value>
 </context-param>
 <context-param>
     <param-name>STATISTICS_FILENAME</param-name>
     <param-value>corelib/services/web/statistics.log</param-value>
 </context-param>
     <context-param>
     <param-name>STATISTICS_DURATION</param-name>
     <param-value>365</param-value>
 </context-param>
 </context-param>
     <context-param>
     <param-name>STATISTICS_URL</param-name>
     <param-value>Stats.wp</param-value>
 </context-param>
 

Since:
0.2.0
Author:
Dominique Liard

Field Summary
static StatisticManager manager
           
 
Method Summary
 void generateRequestedHtmlPage(java.lang.String requestedURI)
           Ellipse statistics service can generate multiple activity diagrams and one full HTML report.
static StatisticManager getInstance()
          Retrieve the unique instance of the Ellipse statistics service.
 java.util.Collection<StatisticEntry> getStatisticEntries()
          Returns the history of all known statistics.
 StatisticEntry getStatisticEntry(java.lang.String dateKey)
          Retrieve (or create if not exists) the StatisticEntry instance associated to the specified date.
 int getStatisticsDuration()
          Compute the time interval, expremied in days, between the first and the last acquired statistics.
 void logNewSession(javax.servlet.http.HttpServletRequest request)
          Record the informations stored in the specifed request in a new StatisticEntry object.
 void saveDocument()
          Write all browsing statistics in the associated file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

public static StatisticManager manager
Method Detail

getInstance

public static StatisticManager getInstance()
Retrieve the unique instance of the Ellipse statistics service.

Returns:
The unique instance of this service.

logNewSession

public void logNewSession(javax.servlet.http.HttpServletRequest request)
Record the informations stored in the specifed request in a new StatisticEntry object.

Parameters:
request - The HTTP request associated to the new logged session .

getStatisticsDuration

public int getStatisticsDuration()
Compute the time interval, expremied in days, between the first and the last acquired statistics.

Returns:
The time interval, expremied in days.

getStatisticEntries

public java.util.Collection<StatisticEntry> getStatisticEntries()
Returns the history of all known statistics.

Returns:
A collection of StatisticEntry instances.

getStatisticEntry

public StatisticEntry getStatisticEntry(java.lang.String dateKey)
Retrieve (or create if not exists) the StatisticEntry instance associated to the specified date.

Parameters:
dateKey - The key associated to the searched statistic.
Returns:
An instance of type StatisticEntry (the returned value cannot be nul).

generateRequestedHtmlPage

public void generateRequestedHtmlPage(java.lang.String requestedURI)

Ellipse statistics service can generate multiple activity diagrams and one full HTML report. All of these diagrams (and the HTML report) can be accessed with a unique URL (view STATISTICS_URL init parameter in the WEB-INF/web.file deployment descriptor). But this URL can accept some parameters for qualify the requested element. This method verify URL parameters for dispatch handling to the good element.

The supported URL parameters are :

Parameters:
requestedURI - The requestedURI The URL used for produce statistics report

saveDocument

public void saveDocument()
                  throws java.io.IOException
Write all browsing statistics in the associated file.

Throws:
java.io.IOException - Thrown if the associated file cannot be modified.


CAUTION: Ellipse is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of Ellipse Framework.

Copyright 2012 Infini Software - All Rights Reserved.