Class ConsentScope
java.lang.Object
io.goobi.viewer.model.administration.legal.ConsentScope
- All Implemented Interfaces:
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 Alpers
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe scope within which the consent is valid. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructor.ConsentScope(String string) Create a new consent scope from a string which is created by thetoString()method of another ConsentScope, making this effectively a cloning constructor Used when deserializing a consent scope from database. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAn object is equals to a consentScope if it is also a consentScope and has the same string representation.intGet the number of days the consent is valid for.Gets the storage mode, determining if the scope is limited to a http session or a span of time.inthashCode()voidsetDaysToLive(int daysToLive) Set the number of days the consent is valid for.voidsetStorageMode(ConsentScope.StorageMode storageMode) Sets the storageMode.toString()
-
Constructor Details
-
ConsentScope
public ConsentScope()Empty default constructor. -
ConsentScope
Create a new consent scope from a string which is created by thetoString()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
-
getStorageMode
Gets the storage mode, determining if the scope is limited to a http session or a span of time.- Returns:
- the storage mode of this consent scope
-
setStorageMode
Sets the storageMode.- Parameters:
storageMode- the storage mode determining where and how long the consent is persisted
-
getDaysToLive
public int getDaysToLive()Get the number of days the consent is valid for.- Returns:
- the number of days before the stored consent expires
-
setDaysToLive
public void setDaysToLive(int daysToLive) Set the number of days the consent is valid for.- Parameters:
daysToLive- the number of days before the stored consent expires
-
hashCode
public int hashCode() -
equals
An object is equals to a consentScope if it is also a consentScope and has the same string representation.
-