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
ConstructorDescriptionEmpty 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 inrecordRequests
long
getRecordRequestCount
(RequestType type, String recordIdentifier) Get number of requests for a givenRequestType
and record identifierlong
Get number of record identifiers which were requested with a givenRequestType
long
Get number of requests for a givenRequestType
long
getTotalRequestCount
(RequestType type, List<String> identifiersToInclude) Return the number of requests of a givenRequestType
for the record identifiers included in identifiersToIncludevoid
incrementRequestCount
(RequestType type, String recordIdentifier) Increment the total count of requests for aRequestType
and record identifier by onevoid
setRecordRequectCount
(RequestType type, String recordIdentifier, long count) Set total count of requests for aRequestType
and 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 givenRequestType
and 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 givenRequestType
for 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 aRequestType
and record identifier to the given number- Parameters:
count
- request count to settype
- the type of the requestrecordIdentifier
- the identifier of the requested record
-
incrementRequestCount
Increment the total count of requests for aRequestType
and 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
-