Class DownloadTicket

java.lang.Object
io.goobi.viewer.model.security.DownloadTicket
All Implemented Interfaces:
Serializable

@Entity public class DownloadTicket extends Object implements Serializable
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.
See Also:
  • Field Details

  • Constructor Details

    • DownloadTicket

      public DownloadTicket()
      Zero argument constructor.
  • 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
    • 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
    • getPi

      public String getPi()
      Returns:
      the pi
    • setPi

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

      public String getEmail()
      Returns:
      the email
    • setEmail

      public void setEmail(String email)
      Parameters:
      email - the email 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
    • 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