Class AccessTicket

java.lang.Object
io.goobi.viewer.model.security.tickets.AccessTicket

@Entity public class AccessTicket extends Object
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.
  • Field Details

    • VALIDITY_DAYS

      public static final int VALIDITY_DAYS
      Default validity for a ticket in days.
      See Also:
    • SALT

      public static final String SALT
      Static salt for password hashes.
      See Also:
    • RANDOM

      protected static final Random RANDOM
      Random object for password generation.
    • bcrypt

      protected transient BCrypt 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

      public boolean checkPassword(String password)
      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 another days days.
      Parameters:
      days - Number of days to extend
    • reset

      public void reset()
      Resets the ticket's password and expiration date.
    • getDefaultValidityAsString

      public String getDefaultValidityAsString()
      Returns:
      VALIDITY_DAYS
    • getLabel

      public String getLabel()
      Returns the title of the associated record, with a fallback to PI.
      Returns:
      title if present; otherwise pi
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getType

      Returns:
      the type
    • setType

      public void setType(AccessTicket.AccessTicketType type)
      Parameters:
      type - the type to set
    • getDateCreated

      public LocalDateTime getDateCreated()
      Returns:
      the dateCreated
    • setDateCreated

      public void setDateCreated(LocalDateTime dateCreated)
      Parameters:
      dateCreated - the dateCreated to set
    • getExpirationDate

      public LocalDateTime getExpirationDate()
      Returns:
      the expirationDate
    • setExpirationDate

      public void setExpirationDate(LocalDateTime expirationDate)
      Parameters:
      expirationDate - the expirationDate to set
    • getPassword

      public String getPassword()
      Returns:
      the password
    • setPassword

      public void setPassword(String password)
      Parameters:
      password - the password to set
    • getPasswordHash

      public String getPasswordHash()
      Returns:
      the passwordHash
    • setPasswordHash

      public void setPasswordHash(String passwordHash)
      Parameters:
      passwordHash - the passwordHash to set
    • getEmail

      public String getEmail()
      Returns:
      the email
    • setEmail

      public void setEmail(String email)
      Parameters:
      email - the email to set
    • getPi

      public String getPi()
      Returns:
      the pi
    • setPi

      public void setPi(String pi)
      Parameters:
      pi - the pi to set
    • getTitle

      public String getTitle()
      Returns:
      the title
    • setTitle

      public void setTitle(String title)
      Parameters:
      title - the title to set
    • getRequestMessage

      public String getRequestMessage()
      Returns:
      the requestMessage
    • setRequestMessage

      public void setRequestMessage(String requestMessage)
      Parameters:
      requestMessage - the requestMessage to set