Class License

java.lang.Object
com.seeq.utilities.license.LicenseEntry
com.seeq.utilities.license.License

public class License extends LicenseEntry
Represents an end-user enforceable software license.
  • Constructor Details

    • License

      public License(String level, LicenseEntry.Validity validity, int daysToExpiration)
      Constructor for a new license
      Parameters:
      level - The licensed level
      validity - The license validity
      daysToExpiration - The number of days to expiration
    • License

      public License(License.Level level, LicenseEntry.Validity validity, int daysToExpiration)
      Constructor for a new license
      Parameters:
      level - The licensed level
      validity - The license validity
      daysToExpiration - The number of days to expiration
  • Method Details

    • addFeature

      public void addFeature(LicensedFeature feature)
      Adds a licensed feature to this license
      Parameters:
      feature - The feature to be added
    • disableFeature

      public void disableFeature(LicensedFeature.Feature feature)
      Disables a licensed feature until the feature is either re-enabled or appserver is restarted. If the feature does not exist or is not licensed, then this will have no effect.
      Parameters:
      feature - the feature to disable
    • enableFeature

      public void enableFeature(LicensedFeature.Feature feature)
      Re-enables a previously disabled licensed feature. If the feature is not licensed or was never disabled, then this will have no effect.
      Parameters:
      feature - the feature to re-enable
    • hasValidLevel

      public boolean hasValidLevel(License.Level level)
      Checks if the current level level has a specific value
      Parameters:
      level - The level which is compared with the current license level
      Returns:
      true if the current license is valid and its level is equal with the specified level
    • hasValidFeature

      public boolean hasValidFeature(LicensedFeature.Feature feature)
      Checks if the current license has a valid licensed feature
      Parameters:
      feature - The feature to search for
      Returns:
      true if the license is valid and it contains a valid feature with the specified value
    • getLevel

      public String getLevel()
      Returns the level of the current license
      Returns:
      the level of the current license
    • getFeatures

      public Collection<LicensedFeature> getFeatures()
      Returns a collection of all licensed features contained in this license
      Returns:
      a collection of all licensed features contained in this license
    • getCompanyName

      public String getCompanyName()
      Returns the name of the company this license is linked to.
      Returns:
      the company/organization name
    • getContractNumber

      public String getContractNumber()
      Returns the contract number
      Returns:
      the contract number
    • setCompanyName

      public void setCompanyName(String companyName)
    • setContractNumber

      public void setContractNumber(String contractNumber)
    • getUserLimitWarn

      public Long getUserLimitWarn()
    • getUserLimitRestrict

      public Long getUserLimitRestrict()
    • setUserLimit

      public void setUserLimit(License.Limit field, Long limit)