Class SessionUsageStatistics
java.lang.Object
io.goobi.viewer.model.statistics.usage.SessionUsageStatistics
Persistence class containing request counts for a single http session.
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for persistence context initialization.Cloning constructor.SessionUsageStatistics(String sessionId, String userAgent, String clientIP) Initializes instance for a session. -
Method Summary
Modifier and TypeMethodDescriptiongetId()Get a list of all record identifiers contained inrecordRequests.longgetRecordRequestCount(RequestType type, String recordIdentifier) Gets number of requests for a givenRequestTypeand record identifier.longGet number of record identifiers which were requested with a givenRequestType.longGet number of requests for a givenRequestType.longgetTotalRequestCount(RequestType type, List<String> identifiersToInclude) Returns the number of requests of a givenRequestTypefor the record identifiers included in identifiersToInclude.voidincrementRequestCount(RequestType type, String recordIdentifier) Increment the total count of requests for aRequestTypeand record identifier by one.voidsetRecordRequectCount(RequestType type, String recordIdentifier, long count) Sets total count of requests for aRequestTypeand record identifier to the given number.toString()
-
Constructor Details
-
SessionUsageStatistics
public SessionUsageStatistics()Empty constructor for persistence context initialization. -
SessionUsageStatistics
Initializes instance for a session.- Parameters:
sessionId- http session identifieruserAgent- User-Agent header contentclientIP- IP-Address the request came from
-
SessionUsageStatistics
Cloning constructor.- Parameters:
orig- the session statistics to copy from
-
-
Method Details
-
getId
- Returns:
- the
id
-
getSessionId
- Returns:
- the
sessionId
-
getUserAgent
- Returns:
- the
userAgent
-
getClientIP
- Returns:
- the
clientIP
-
getRecordRequestCount
Gets 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
Returns 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:
- the total number of requests of the given type for the given record identifiers in this session
-
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
Sets 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
-