Class License

All Implemented Interfaces:
IPrivilegeHolder, Serializable

@Entity public class License extends AbstractPrivilegeHolder implements Serializable

License class.

See Also:
  • Constructor Details

    • License

      public License()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isValid

      public boolean isValid()
      Checks the validity of this license. A valid license is either not time limited (start and/or end) or the current date lies between the license's start and and dates.
      Returns:
      true if valid; false otherwise;
    • addPrivilege

      public boolean addPrivilege(String privilege)
      Adds the given privilege to the working set.
      Specified by:
      addPrivilege in interface IPrivilegeHolder
      Parameters:
      privilege -
      Returns:
      true if successful; false otherwise
    • removePrivilege

      public boolean removePrivilege(String privilege)
      Removes the given privilege from the working set.
      Specified by:
      removePrivilege in interface IPrivilegeHolder
      Parameters:
      privilege -
      Returns:
      true if successful; false otherwise
    • hasPrivilege

      public boolean hasPrivilege(String privilege)

      hasPrivilege.

      Specified by:
      hasPrivilege in interface IPrivilegeHolder
      Parameters:
      privilege - a String object.
      Returns:
      a boolean.
    • isPrivCmsPages

      public boolean isPrivCmsPages()

      isPrivCmsPages.

      Specified by:
      isPrivCmsPages in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsPages

      public void setPrivCmsPages(boolean priv)

      setPrivCmsPages.

      Specified by:
      setPrivCmsPages in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllSubthemes

      public boolean isPrivCmsAllSubthemes()

      isPrivCmsAllSubthemes.

      Specified by:
      isPrivCmsAllSubthemes in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllSubthemes

      public void setPrivCmsAllSubthemes(boolean priv)

      setPrivCmsAllSubthemes.

      Specified by:
      setPrivCmsAllSubthemes in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllCategories

      public boolean isPrivCmsAllCategories()

      isPrivCmsAllCategories.

      Specified by:
      isPrivCmsAllCategories in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllCategories

      public void setPrivCmsAllCategories(boolean priv)

      setPrivCmsAllCategories.

      Specified by:
      setPrivCmsAllCategories in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllTemplates

      public boolean isPrivCmsAllTemplates()

      isPrivCmsAllTemplates.

      Specified by:
      isPrivCmsAllTemplates in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllTemplates

      public void setPrivCmsAllTemplates(boolean priv)

      setPrivCmsAllTemplates.

      Specified by:
      setPrivCmsAllTemplates in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsMenu

      public boolean isPrivCmsMenu()

      isPrivCmsMenu.

      Specified by:
      isPrivCmsMenu in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsMenu

      public void setPrivCmsMenu(boolean priv)

      setPrivCmsMenu.

      Specified by:
      setPrivCmsMenu in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsStaticPages

      public boolean isPrivCmsStaticPages()

      isPrivCmsStaticPages.

      Specified by:
      isPrivCmsStaticPages in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsStaticPages

      public void setPrivCmsStaticPages(boolean priv)

      setPrivCmsStaticPages.

      Specified by:
      setPrivCmsStaticPages in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsCollections

      public boolean isPrivCmsCollections()

      isPrivCmsCollections.

      Specified by:
      isPrivCmsCollections in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsCollections

      public void setPrivCmsCollections(boolean priv)

      setPrivCmsCollections.

      Specified by:
      setPrivCmsCollections in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsCategories

      public boolean isPrivCmsCategories()

      isPrivCmsCategories.

      Specified by:
      isPrivCmsCategories in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsCategories

      public void setPrivCmsCategories(boolean priv)

      setPrivCmsCategories.

      Specified by:
      setPrivCmsCategories in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingAllCampaigns

      public boolean isPrivCrowdsourcingAllCampaigns()

      isPrivCrowdsourcingAllCampaigns.

      Specified by:
      isPrivCrowdsourcingAllCampaigns in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingAllCampaigns

      public void setPrivCrowdsourcingAllCampaigns(boolean priv)

      setPrivCrowdsourcingAllCampaigns.

      Specified by:
      setPrivCrowdsourcingAllCampaigns in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingAnnotateCampaign

      public boolean isPrivCrowdsourcingAnnotateCampaign()

      isPrivCrowdsourcingAnnotateCampaign.

      Specified by:
      isPrivCrowdsourcingAnnotateCampaign in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingAnnotateCampaign

      public void setPrivCrowdsourcingAnnotateCampaign(boolean priv)

      setPrivCrowdsourcingAnnotateCampaign.

      Specified by:
      setPrivCrowdsourcingAnnotateCampaign in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingReviewCampaign

      public boolean isPrivCrowdsourcingReviewCampaign()

      isPrivCrowdsourcingReviewCampaign.

      Specified by:
      isPrivCrowdsourcingReviewCampaign in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingReviewCampaign

      public void setPrivCrowdsourcingReviewCampaign(boolean priv)

      setPrivCrowdsourcingReviewCampaign.

      Specified by:
      setPrivCrowdsourcingReviewCampaign in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivViewUgc

      public boolean isPrivViewUgc()
      Description copied from interface: IPrivilegeHolder

      isPrivViewUgc.

      Specified by:
      isPrivViewUgc in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivViewUgc

      public void setPrivViewUgc(boolean priv)
      Description copied from interface: IPrivilegeHolder

      setPrivViewUgc.

      Specified by:
      setPrivViewUgc in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • resetTempData

      public void resetTempData()
      Resets all working copies of lists of various privileges.
    • getAvailablePrivileges

      public List<String> getAvailablePrivileges()
      Returns the list of available record privileges for adding to this license (using the working copy while editing).
      Returns:
      Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
    • getAvailablePrivileges

      public List<String> getAvailablePrivileges(Set<String> privileges)
      Returns the list of available record privileges for adding to this license (using the given privileges list).
      Parameters:
      privileges -
      Returns:
      Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
    • getSortedPrivileges

      public List<String> getSortedPrivileges(Set<String> privileges)
      Returns a sorted list (according to the static array of privileges, either for records or CMS) based on the given set of privileges.
      Specified by:
      getSortedPrivileges in interface IPrivilegeHolder
      Parameters:
      privileges - Listed privileges
      Returns:
      Sorted list of privileges contained in privileges
    • getSelectableSubthemes

      public List<Selectable<String>> getSelectableSubthemes() throws PresentationException
      Returns:
      List<Selectablei<String>>
      Throws:
      DAOException
      PresentationException
    • getSelectableCategories

      public List<Selectable<CMSCategory>> getSelectableCategories() throws DAOException
      Returns:
      List<Selectable<CMSCategory>>
      Throws:
      DAOException
    • getSelectableTemplates

      public List<Selectable<CMSPageTemplate>> getSelectableTemplates() throws DAOException
      Returns:
      List<Selectable<CMSPageTemplate>>
      Throws:
      DAOException
    • 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
    • getLicenseType

      public LicenseType getLicenseType()

      Getter for the field licenseType.

      Returns:
      the licenseType
    • setLicenseType

      public void setLicenseType(LicenseType licenseType)

      Setter for the field licenseType.

      Parameters:
      licenseType - the licenseType to set
    • getUser

      public User getUser()

      Getter for the field user.

      Returns:
      the user
    • setUser

      public void setUser(User user)

      Setter for the field user.

      Parameters:
      user - the user to set
    • getUserGroup

      public UserGroup getUserGroup()

      Getter for the field userGroup.

      Returns:
      the userGroup
    • setUserGroup

      public void setUserGroup(UserGroup userGroup)

      Setter for the field userGroup.

      Parameters:
      userGroup - the userGroup to set
    • getIpRange

      public IpRange getIpRange()

      Getter for the field ipRange.

      Returns:
      the ipRange
    • setIpRange

      public void setIpRange(IpRange ipRange)

      Setter for the field ipRange.

      Parameters:
      ipRange - the ipRange to set
    • getStart

      public LocalDateTime getStart()

      Getter for the field start.

      Returns:
      the start
    • setStart

      public void setStart(LocalDateTime start)

      Setter for the field start.

      Parameters:
      start - the start to set
    • getEnd

      public LocalDateTime getEnd()

      Getter for the field end.

      Returns:
      the end
    • setEnd

      public void setEnd(LocalDateTime end)

      Setter for the field end.

      Parameters:
      end - the end to set
    • getPrivileges

      public Set<String> getPrivileges()

      Getter for the field privileges.

      Returns:
      the privileges
    • setPrivileges

      public void setPrivileges(Set<String> privileges)

      Setter for the field privileges.

      Parameters:
      privileges - the privileges to set
    • getConditions

      public String getConditions()

      Getter for the field conditions.

      Returns:
      the conditions
    • setConditions

      public void setConditions(String conditions)

      Setter for the field conditions.

      Parameters:
      conditions - the conditions to set
    • getDescription

      public String getDescription()

      Getter for the field description.

      Returns:
      the description
    • setDescription

      public void setDescription(String description)

      Setter for the field description.

      Parameters:
      description - the description to set
    • isTicketRequired

      public boolean isTicketRequired()
      Returns:
      the ticketRequired
    • setTicketRequired

      public void setTicketRequired(boolean ticketRequired)
      Parameters:
      ticketRequired - the ticketRequired to set
    • isDisplayTicketRequiredToggle

      public boolean isDisplayTicketRequiredToggle()
      Returns:
      true if privilege PRIV_DOWNLOAD_BORN_DIGITAL_FILES is contained; false otherwise
    • getSubthemeDiscriminatorValues

      public List<String> getSubthemeDiscriminatorValues()

      Getter for the field subthemeDiscriminatorValues.

      Returns:
      the subthemeDiscriminatorValues
    • setSubthemeDiscriminatorValues

      public void setSubthemeDiscriminatorValues(List<String> subthemeDiscriminatorValues)

      Setter for the field subthemeDiscriminatorValues.

      Parameters:
      subthemeDiscriminatorValues - the subthemeDiscriminatorValues to set
    • getAllowedCategories

      public List<CMSCategory> getAllowedCategories()

      Getter for the field allowedCategories.

      Returns:
      the allowedCategories
    • setAllowedCategories

      public void setAllowedCategories(List<CMSCategory> allowedCategories)

      Setter for the field allowedCategories.

      Parameters:
      allowedCategories - the allowedCategories to set
    • getAllowedCmsTemplates

      public List<CMSPageTemplate> getAllowedCmsTemplates()

      Getter for the field allowedCmsTemplates.

      Returns:
      the allowedCmsTemplates
    • setAllowedCmsTemplates

      public void setAllowedCmsTemplates(List<CMSPageTemplate> allowedCmsTemplates)

      Setter for the field allowedCmsTemplates.

      Parameters:
      allowedCmsTemplates - the allowedCmsTemplates to set
    • getAllowedCrowdsourcingCampaigns

      public List<Campaign> getAllowedCrowdsourcingCampaigns()

      Getter for the field allowedCrowdsourcingCampaigns.

      Returns:
      the allowedCrowdsourcingCampaigns
    • setAllowedCrowdsourcingCampaigns

      public void setAllowedCrowdsourcingCampaigns(List<Campaign> allowedCrowdsourcingCampaigns)

      Setter for the field allowedCrowdsourcingCampaigns.

      Parameters:
      allowedCrowdsourcingCampaigns - the allowedCrowdsourcingCampaigns to set
    • getType

      public String getType()
      Returns:
      the type
    • setType

      public void setType(String type)
      Parameters:
      type - the type to set
    • getPrivilegesCopy

      public Set<String> getPrivilegesCopy()
      Returns:
      the privilegesCopy
    • setPrivilegesCopy

      public void setPrivilegesCopy(Set<String> privilegesCopy)
      Parameters:
      privilegesCopy - the privilegesCopy to set
    • getDisclaimerScope

      public ConsentScope getDisclaimerScope()
    • getClientId

      public Long getClientId()
      Returns:
      the client
    • getClient

      public ClientApplication getClient()
    • setClient

      public void setClient(ClientApplication client)
      Parameters:
      client - the client to set
    • setClientId

      public void setClientId(Long clientId) throws DAOException
      Parameters:
      clientId - the clientId to set
      Throws:
      DAOException