Class UsageStatisticsRecorder
java.lang.Object
io.goobi.viewer.model.statistics.usage.UsageStatisticsRecorder
Class to be called on requests to be recorded in usage statistics. Stores and updates usage statistics in database on each request
- Author:
- florian
-
Constructor Summary
ConstructorDescriptionUsageStatisticsRecorder
(IDAO dao, Configuration config, String viewerName) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
isActive()
Check if usage statistics are enabled by configurationprotected void
recordRequest
(RequestType type, String recordIdentifier, String sessionID, String userAgent, String clientIP) Add a request to the internal request countsvoid
recordRequest
(RequestType type, String recordIdentifier, javax.servlet.http.HttpServletRequest request) Add a http request to the usage statistics
-
Constructor Details
-
UsageStatisticsRecorder
Default constructor- Parameters:
dao
- thedao
to setconfig
- theconfig
to setviewerName
- theviewerName
to set
-
-
Method Details
-
isActive
public boolean isActive()Check if usage statistics are enabled by configuration- Returns:
- true if
Configuration.isStatisticsEnabled()
returns true
-
recordRequest
public void recordRequest(RequestType type, String recordIdentifier, javax.servlet.http.HttpServletRequest request) Add a http request to the usage statistics- Parameters:
type
- theRequestType
for which to count the requestrecordIdentifier
- the record identifier requested by the requestrequest
- aHttpServletRequest
-
recordRequest
protected void recordRequest(RequestType type, String recordIdentifier, String sessionID, String userAgent, String clientIP) Add a request to the internal request counts- Parameters:
type
- theRequestType
for which to count the requestrecordIdentifier
- the record identifier requested by the requestsessionID
- The session issuing this requestuserAgent
- the 'User-Agent' header value of the requestclientIP
- The IP Address from which the request is issued
-