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 Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionUsageStatisticsRecorder(IDAO dao, Configuration config, String viewerName) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisActive()Checks if usage statistics are enabled by configuration.voidrecordRequest(RequestType type, String recordIdentifier, HttpServletRequest request) Adds a http request to the usage statistics.protected voidrecordRequest(RequestType type, String recordIdentifier, String sessionID, String userAgent, String clientIP) Add a request to the internal request counts.
-
Constructor Details
-
UsageStatisticsRecorder
Default constructor.- Parameters:
dao- thedaoto setconfig- theconfigto setviewerName- theviewerNameto set
-
-
Method Details
-
isActive
public boolean isActive()Checks if usage statistics are enabled by configuration.- Returns:
- true if
Configuration.isStatisticsEnabled()returns true
-
recordRequest
Adds a http request to the usage statistics.- Parameters:
type- theRequestTypefor 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- theRequestTypefor 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
-