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
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The scope within which the consent is valid -
Constructor Summary
ConstructorDescriptionempty default constructorConsentScope
(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 TypeMethodDescriptionboolean
An object is equals to a consentScope if it is also a consentScope and has the same string representationint
get the number of days the consent is valid forGet the storage mode, determining if the scope is limited to a http session or a span of timeint
hashCode()
void
setDaysToLive
(int daysToLive) set the number of days the consent is valid forvoid
setStorageMode
(ConsentScope.StorageMode storageMode) Set the storageModetoString()
-
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
Get the storage mode, determining if the scope is limited to a http session or a span of time- Returns:
- the storageMode
-
setStorageMode
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() -
equals
An object is equals to a consentScope if it is also a consentScope and has the same string representation
-