Class ConsentScope

java.lang.Object
io.goobi.viewer.model.administration.legal.ConsentScope
All Implemented Interfaces:
Serializable

public class ConsentScope extends Object implements Serializable
Describes the scope within which a declaration of consent (i.e. clicking the 'accept' button) is valid. Outside of that scope, consent must be requested again. The scope consists of a duration in days during which it is valid, as well as a storage type which can either be 'local' or 'session'. This type determines if a consent is stored in the local or session storage of a browser. If it is stored in session storage, the time to live of that scope is determined by the duration of the session.
Author:
florian
See Also:
  • Constructor Details

    • ConsentScope

      public ConsentScope()
      empty default constructor
    • ConsentScope

      public ConsentScope(String string)
      Create a new consent scope from a string which is created by the toString() method of another ConsentScope, making this effectively a cloning constructor Used when deserializing a consent scope from database
      Parameters:
      string - representing a consent scope
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getStorageMode

      public ConsentScope.StorageMode getStorageMode()
      Get the storage mode, determining if the scope is limited to a http session or a span of time
      Returns:
      the storageMode
    • setStorageMode

      public void setStorageMode(ConsentScope.StorageMode storageMode)
      Set the storageMode
      Parameters:
      storageMode - the storageMode to set
    • getDaysToLive

      public int getDaysToLive()
      get the number of days the consent is valid for
      Returns:
      the daysToLive
    • setDaysToLive

      public void setDaysToLive(int daysToLive)
      set the number of days the consent is valid for
      Parameters:
      daysToLive - the daysToLive to set
    • hashCode

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

      public boolean equals(Object obj)
      An object is equals to a consentScope if it is also a consentScope and has the same string representation
      Overrides:
      equals in class Object