Interface CrowdLicenseManager

All Known Implementing Classes:
CrowdLicenseManagerImpl

public interface CrowdLicenseManager
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns pre-calculated number of unique Principals currently being used by Crowd.
    com.atlassian.extras.api.crowd.CrowdLicense
    This will retrieve the license for the currently running Crowd instance.
    com.atlassian.extras.api.crowd.CrowdLicense
    getLicense(String licenseKey)
    This will parse a license key into a license.
    This will retrieve the license key for the currently running Crowd instance.
    boolean
    isBuildWithinMaintenancePeriod(com.atlassian.extras.api.crowd.CrowdLicense license)
    Return's true if the current Build is within the maintenance period for the Crowd license
    boolean
     
    boolean
    Will validate that a given License key is valid
    boolean
    This will evaluate against the current license stored in Crowd LicenseStore.
    boolean
    isLicenseValid(com.atlassian.extras.api.crowd.CrowdLicense license)
    Same logic as isLicenseValid()
    boolean
    isResourceTotalOverLimit(float limit, int currentResourceCount)
    Calculates the percentage of currentResourceCount over the user limit on a license and returns true or false if the percentage is above the passed in limit.
    boolean
    Validate if a given license key has a higher resource limit than current total resource count
    boolean
    Checks if a license key valid for set up.
    int
    This will calculate the number of unique Principals currently being used by Crowd.
    com.atlassian.extras.api.crowd.CrowdLicense
    storeLicense(String licenseKey)
    This will store the license in the LicenseStore for the currently running Crowd instance.
  • Method Details

    • getLicense

      com.atlassian.extras.api.crowd.CrowdLicense getLicense()
      This will retrieve the license for the currently running Crowd instance.
      Returns:
      com.atlassian.license.License or null if not set.
    • getLicense

      com.atlassian.extras.api.crowd.CrowdLicense getLicense(String licenseKey)
      This will parse a license key into a license.
      Parameters:
      licenseKey - license string
      Returns:
      license
    • getRawLicense

      String getRawLicense()
      This will retrieve the license key for the currently running Crowd instance.
      Returns:
      raw license key.
    • storeLicense

      com.atlassian.extras.api.crowd.CrowdLicense storeLicense(String licenseKey) throws CrowdLicenseManagerException
      This will store the license in the LicenseStore for the currently running Crowd instance.
      Throws:
      CrowdLicenseManagerException
    • isLicenseValid

      boolean isLicenseValid()
      This will evaluate against the current license stored in Crowd LicenseStore.

      Will return true if the License has not gone beyond its resource total and if the user is not running an evaluation version and it has not expired. This is an overriding method to @see isLicenseValid(License license), so will call getLicense() internally.

      Returns:
      true if License has not gone beyond resource limit or is not an evalution and is expired.
    • isLicenseValid

      boolean isLicenseValid(com.atlassian.extras.api.crowd.CrowdLicense license)
      Same logic as isLicenseValid()
    • isLicenseKeyValid

      boolean isLicenseKeyValid(String licenseKey)
      Will validate that a given License key is valid
      Parameters:
      licenseKey - the String to validate
      Returns:
      true if an only if the license is valid, otherwise false
    • isSetupLicenseKeyValid

      boolean isSetupLicenseKeyValid(String licenseKey)
      Checks if a license key valid for set up. In particular, it does not check the current user count as there are no users configured when initially entering a license in the setup process.
      Parameters:
      licenseKey - the String to validate.
      Returns:
      true if an only if the license is valid, otherwise false.
    • getCurrentResourceUsageTotal

      int getCurrentResourceUsageTotal()
      Returns pre-calculated number of unique Principals currently being used by Crowd.
      Returns:
      the number of users/principals.
    • recalculateResourceUsageTotal

      int recalculateResourceUsageTotal() throws CrowdLicenseManagerException
      This will calculate the number of unique Principals currently being used by Crowd. Please note: this is an expensive call and is actually stored in the database by a Quartz process LicenseResourceJob. Please consider using getCurrentResourceUsageTotal() Note: Do not call this method from the web layer, as this is wrapped in a Spring managed transaction
      Returns:
      the number of users/principals.
      Throws:
      CrowdLicenseManagerException
    • isResourceTotalOverLimit

      boolean isResourceTotalOverLimit(float limit, int currentResourceCount)
      Calculates the percentage of currentResourceCount over the user limit on a license and returns true or false if the percentage is above the passed in limit.
      Parameters:
      limit - the percentage limit to test against
      currentResourceCount - the current number of resources in the system.
      Returns:
      true if over limit, false otherwise.
    • isBuildWithinMaintenancePeriod

      boolean isBuildWithinMaintenancePeriod(com.atlassian.extras.api.crowd.CrowdLicense license)
      Return's true if the current Build is within the maintenance period for the Crowd license
    • isBuildWithinMaintenancePeriod

      boolean isBuildWithinMaintenancePeriod(String licenseKey)
    • isResourceTotalUnderLimitInLicenseKey

      boolean isResourceTotalUnderLimitInLicenseKey(String licenseKey)
      Validate if a given license key has a higher resource limit than current total resource count
      Parameters:
      licenseKey - the license key String to validate
      Returns:
      true if license limit is higher than current total resource count, false otherwise