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
ConstructorsConstructorDescriptionUsageStatisticsRecorder(IDAO dao, Configuration config, String viewerName) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanisActive()Check if usage statistics are enabled by configurationvoidrecordRequest(RequestType type, String recordIdentifier, jakarta.servlet.http.HttpServletRequest request) Add a http request to the usage statisticsprotected 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()Check if usage statistics are enabled by configuration- Returns:
- true if
Configuration.isStatisticsEnabled()returns true
-
recordRequest
public void recordRequest(RequestType type, String recordIdentifier, jakarta.servlet.http.HttpServletRequest request) Add 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
-