Class SessionUsageStatistics
java.lang.Object
io.goobi.viewer.model.statistics.usage.SessionUsageStatistics
Persistence class containing request counts for a single http session
- Author:
- florian
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for persistence context initializationCloning constructorSessionUsageStatistics(String sessionId, String userAgent, String clientIP) Initialize instance for a session -
Method Summary
Modifier and TypeMethodDescriptiongetId()Get a list of all record identifiers contained inrecordRequestslonggetRecordRequestCount(RequestType type, String recordIdentifier) Get number of requests for a givenRequestTypeand record identifierlongGet number of record identifiers which were requested with a givenRequestTypelongGet number of requests for a givenRequestTypelonggetTotalRequestCount(RequestType type, List<String> identifiersToInclude) Return the number of requests of a givenRequestTypefor the record identifiers included in identifiersToIncludevoidincrementRequestCount(RequestType type, String recordIdentifier) Increment the total count of requests for aRequestTypeand record identifier by onevoidsetRecordRequectCount(RequestType type, String recordIdentifier, long count) Set total count of requests for aRequestTypeand record identifier to the given numbertoString()
-
Constructor Details
-
SessionUsageStatistics
public SessionUsageStatistics()Empty constructor for persistence context initialization -
SessionUsageStatistics
Initialize instance for a session- Parameters:
sessionId- http session identifieruserAgent- User-Agent header contentclientIP- IP-Address the request came from
-
SessionUsageStatistics
Cloning constructor- Parameters:
orig-
-
-
Method Details
-
getId
- Returns:
- the
id
-
getSessionId
- Returns:
- the
sessionId
-
getUserAgent
- Returns:
- the
userAgent
-
getClientIP
- Returns:
- the
clientIP
-
getRecordRequestCount
Get number of requests for a givenRequestTypeand record identifier- Parameters:
type- the type of the requestrecordIdentifier- the record identifier- Returns:
- the number of requests for the type and identifier
-
getTotalRequestCount
Get number of requests for a givenRequestType- Parameters:
type- the type of the request- Returns:
- the number of requests for the type
-
getTotalRequestCount
Return the number of requests of a givenRequestTypefor the record identifiers included in identifiersToInclude- Parameters:
type- the type of the requestidentifiersToInclude- record identifiers for which the number of requests should be counted- Returns:
- a long
-
getRequestedRecordsCount
Get number of record identifiers which were requested with a givenRequestType- Parameters:
type- the type of the request- Returns:
- the number of record identifiers requested at least once for the type
-
setRecordRequectCount
Set total count of requests for aRequestTypeand record identifier to the given number- Parameters:
type- the type of the requestrecordIdentifier- the identifier of the requested recordcount- request count to set
-
incrementRequestCount
Increment the total count of requests for aRequestTypeand record identifier by one- Parameters:
type- the type of the requestrecordIdentifier- the identifier of the requested record
-
getRecordIdentifier
Get a list of all record identifiers contained inrecordRequests- Returns:
- list of record identifiers
-
toString
-