Class SessionUsageStatistics

java.lang.Object
io.goobi.viewer.model.statistics.usage.SessionUsageStatistics

@Entity public class SessionUsageStatistics extends Object
Persistence class containing request counts for a single http session
Author:
florian
  • Constructor Details

    • SessionUsageStatistics

      public SessionUsageStatistics()
      Empty constructor for persistence context initialization
    • SessionUsageStatistics

      public SessionUsageStatistics(String sessionId, String userAgent, String clientIP)
      Initialize instance for a session
      Parameters:
      sessionId - http session identifier
      userAgent - User-Agent header content
      clientIP - IP-Address the request came from
    • SessionUsageStatistics

      public SessionUsageStatistics(SessionUsageStatistics orig)
      Cloning constructor
      Parameters:
      orig -
  • Method Details

    • getId

      public Long getId()
      Returns:
      the id
    • getSessionId

      public String getSessionId()
      Returns:
      the sessionId
    • getUserAgent

      public String getUserAgent()
      Returns:
      the userAgent
    • getClientIP

      public String getClientIP()
      Returns:
      the clientIP
    • getRecordRequestCount

      public long getRecordRequestCount(RequestType type, String recordIdentifier)
      Get number of requests for a given RequestType and record identifier
      Parameters:
      type - the type of the request
      recordIdentifier - the record identifier
      Returns:
      the number of requests for the type and identifier
    • getTotalRequestCount

      public long getTotalRequestCount(RequestType type)
      Get number of requests for a given RequestType
      Parameters:
      type - the type of the request
      Returns:
      the number of requests for the type
    • getTotalRequestCount

      public long getTotalRequestCount(RequestType type, List<String> identifiersToInclude)
      Return the number of requests of a given RequestType for the record identifiers included in identifiersToInclude
      Parameters:
      type - the type of the request
      identifiersToInclude - record identifiers for which the number of requests should be counted
      Returns:
      a long
    • getRequestedRecordsCount

      public long getRequestedRecordsCount(RequestType type)
      Get number of record identifiers which were requested with a given RequestType
      Parameters:
      type - the type of the request
      Returns:
      the number of record identifiers requested at least once for the type
    • setRecordRequectCount

      public void setRecordRequectCount(RequestType type, String recordIdentifier, long count)
      Set total count of requests for a RequestType and record identifier to the given number
      Parameters:
      count - request count to set
      type - the type of the request
      recordIdentifier - the identifier of the requested record
    • incrementRequestCount

      public void incrementRequestCount(RequestType type, String recordIdentifier)
      Increment the total count of requests for a RequestType and record identifier by one
      Parameters:
      type - the type of the request
      recordIdentifier - the identifier of the requested record
    • getRecordIdentifier

      public List<String> getRecordIdentifier()
      Get a list of all record identifiers contained in recordRequests
      Returns:
      list of record identifiers
    • toString

      public String toString()
      Overrides:
      toString in class Object