Class AccessTicket
java.lang.Object
io.goobi.viewer.model.security.tickets.AccessTicket
This class describes license types for record access conditions and also system user roles (not to be confused with the class Role, however), also
known as core license types.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Sets the dates.boolean
checkPassword
(String password) void
extend
(long days) Extends the ticket by anotherdays
days.getEmail()
getId()
Getter for the fieldid
.getLabel()
Returns the title of the associated record, with a fallback to PI.getPi()
getTitle()
getType()
boolean
isActive()
boolean
boolean
void
reset()
Resets the ticket's password and expiration date.void
setDateCreated
(LocalDateTime dateCreated) void
void
setExpirationDate
(LocalDateTime expirationDate) void
Setter for the fieldid
.void
setPassword
(String password) void
setPasswordHash
(String passwordHash) void
void
setRequestMessage
(String requestMessage) void
void
-
Field Details
-
VALIDITY_DAYS
public static final int VALIDITY_DAYSDefault validity for a ticket in days.- See Also:
-
SALT
Static salt for password hashes.- See Also:
-
RANDOM
Random object for password generation. -
bcrypt
-
-
Constructor Details
-
AccessTicket
public AccessTicket()
-
-
Method Details
-
isActive
public boolean isActive()- Returns:
- true if ticket granted and not expired; false otherwise
-
isExpired
public boolean isExpired()- Returns:
- true if expiration date is in the past; false otherwise
-
isRequest
public boolean isRequest()- Returns:
- true if ticket is requested but not yet issued; false otherwise
-
checkPassword
- Parameters:
password
- Password to check- Returns:
- true if password correct; false otherwise
-
activate
public void activate()Sets the dates. -
extend
public void extend(long days) Extends the ticket by anotherdays
days.- Parameters:
days
- Number of days to extend
-
reset
public void reset()Resets the ticket's password and expiration date. -
getDefaultValidityAsString
- Returns:
VALIDITY_DAYS
-
getLabel
Returns the title of the associated record, with a fallback to PI.- Returns:
- title if present; otherwise pi
-
getId
Getter for the field
id
.- Returns:
- the id
-
setId
Setter for the field
id
.- Parameters:
id
- the id to set
-
getType
- Returns:
- the type
-
setType
- Parameters:
type
- the type to set
-
getDateCreated
- Returns:
- the dateCreated
-
setDateCreated
- Parameters:
dateCreated
- the dateCreated to set
-
getExpirationDate
- Returns:
- the expirationDate
-
setExpirationDate
- Parameters:
expirationDate
- the expirationDate to set
-
getPassword
- Returns:
- the password
-
setPassword
- Parameters:
password
- the password to set
-
getPasswordHash
- Returns:
- the passwordHash
-
setPasswordHash
- Parameters:
passwordHash
- the passwordHash to set
-
getEmail
- Returns:
- the email
-
setEmail
- Parameters:
email
- the email to set
-
getPi
- Returns:
- the pi
-
setPi
- Parameters:
pi
- the pi to set
-
getTitle
- Returns:
- the title
-
setTitle
- Parameters:
title
- the title to set
-
getRequestMessage
- Returns:
- the requestMessage
-
setRequestMessage
- Parameters:
requestMessage
- the requestMessage to set
-