public class CrowdLicenseManagerImpl extends Object implements CrowdLicenseManager
Constructor and Description |
---|
CrowdLicenseManagerImpl() |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentResourceUsageTotal()
This will calculate the number of unique Principals currently being used by Crowd.
|
com.atlassian.extras.api.crowd.CrowdLicense |
getLicense()
This will retrieve the license for the currently running Crowd instance.
|
boolean |
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
|
boolean |
isBuildWithinMaintenancePeriod(String key) |
boolean |
isLicenseKeyValid(String key)
Will validate that a given License key is valid
|
boolean |
isLicenseValid()
This will evaluate against the current license stored in Crowd LicenseStore
|
boolean |
isLicenseValid(com.atlassian.extras.api.crowd.CrowdLicense license)
Same logic as
CrowdLicenseManager.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 |
isSetupLicenseKeyValid(String key)
Checks if a license key valid for set up.
|
void |
setApplicationManager(ApplicationManager applicationManager)
Sets the application manager which is used to get the configurated applications.
|
void |
setDirectoryManager(DirectoryManager directoryManager)
Sets the directory manager which is used to lookup principals.
|
void |
setLicenseStore(CrowdLicenseStore licenseStore) |
void |
setPropertyManager(PropertyManager propertyManager)
Sets the property manager which is used to get and set the server license resource totals.
|
com.atlassian.extras.api.crowd.CrowdLicense |
storeLicense(String license)
This will store the license in the LicenseStore for the currently running Crowd instance.
|
public com.atlassian.extras.api.crowd.CrowdLicense getLicense()
CrowdLicenseManager
getLicense
in interface CrowdLicenseManager
CrowdLicenseManager.getLicense()
public com.atlassian.extras.api.crowd.CrowdLicense storeLicense(String license)
CrowdLicenseManager
storeLicense
in interface CrowdLicenseManager
public boolean isLicenseValid()
CrowdLicenseManager
isLicenseValid
in interface CrowdLicenseManager
CrowdLicenseManager.isLicenseValid()
public boolean isSetupLicenseKeyValid(String key)
CrowdLicenseManager
isSetupLicenseKeyValid
in interface CrowdLicenseManager
key
- the String to validate.public boolean isLicenseValid(com.atlassian.extras.api.crowd.CrowdLicense license)
CrowdLicenseManager
CrowdLicenseManager.isLicenseValid()
isLicenseValid
in interface CrowdLicenseManager
public boolean isLicenseKeyValid(String key)
CrowdLicenseManager
isLicenseKeyValid
in interface CrowdLicenseManager
key
- the String to validatepublic int getCurrentResourceUsageTotal() throws CrowdLicenseManagerException
CrowdLicenseManager
LicenseResourceJob
.
Please use consider using PropertyManager.getCurrentLicenseResourceTotal()
Note: Do not call this method from the web layer, as this is wrapped in a Spring managed transactiongetCurrentResourceUsageTotal
in interface CrowdLicenseManager
CrowdLicenseManagerException
CrowdLicenseManager.getCurrentResourceUsageTotal()
public boolean isResourceTotalOverLimit(float limit, int currentResourceCount)
CrowdLicenseManager
isResourceTotalOverLimit
in interface CrowdLicenseManager
limit
- the percentage limit to test againstcurrentResourceCount
- the current number of resources in the system.CrowdLicenseManager.isResourceTotalOverLimit(float,int)
public boolean isBuildWithinMaintenancePeriod(com.atlassian.extras.api.crowd.CrowdLicense license)
CrowdLicenseManager
isBuildWithinMaintenancePeriod
in interface CrowdLicenseManager
public boolean isBuildWithinMaintenancePeriod()
isBuildWithinMaintenancePeriod
in interface CrowdLicenseManager
public boolean isBuildWithinMaintenancePeriod(String key)
isBuildWithinMaintenancePeriod
in interface CrowdLicenseManager
public void setPropertyManager(PropertyManager propertyManager)
propertyManager
- Property manager implementation.public void setApplicationManager(ApplicationManager applicationManager)
applicationManager
- APplications manager implementation.public void setDirectoryManager(DirectoryManager directoryManager)
directoryManager
- Directory manager implementation.public void setLicenseStore(CrowdLicenseStore licenseStore)
Copyright © 2013 Atlassian. All Rights Reserved.