Class SessionRequestCounts

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

public class SessionRequestCounts extends Object
Class holding counts of requests of different RequestTypes. Should be serialized to a string to dao storage
Author:
florian
  • Constructor Details

    • SessionRequestCounts

      public SessionRequestCounts()
      Empty default constructor
    • SessionRequestCounts

      public SessionRequestCounts(String data)
      Constructor to deserialize data from a string
      Parameters:
      data -
  • Method Details

    • setCount

      public void setCount(RequestType type, long count)
      Set the total count of requests for a given RequestType
      Parameters:
      type -
      count -
    • incrementCount

      public void incrementCount(RequestType type)
      Increment the total count of requests for a given RequestType by one
      Parameters:
      type -
    • getCount

      public Long getCount(RequestType type)
      Get the total count of requests for a given RequestType
      Parameters:
      type -
      Returns:
      Long
    • toJsonArray

      public String toJsonArray()
      Turn into a json representation
      Returns:
      a json String
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Two SessionRequestCounts are equal if the have the same request counts for all RequestTypes.
      Overrides:
      equals in class Object
      Parameters:
      o -
      Returns:
      true if objects equal; false otherwise