Package com.atlassian.bamboo.license
Class BambooLicenseManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.license.BambooLicenseManagerImpl
-
- All Implemented Interfaces:
BambooLicenseManager
public class BambooLicenseManagerImpl extends Object implements BambooLicenseManager
-
-
Field Summary
Fields Modifier and Type Field Description static String
BAMBOO_LICENSE_KEY
-
Fields inherited from interface com.atlassian.bamboo.license.BambooLicenseManager
MAX_LOCAL_AGENTS_BASIC, MAX_LOCAL_AGENTS_UNLIMITED, MAX_PLANS_STARTER, MAX_PLANS_UNLIMITED, MAX_REMOTE_AGENTS_5, MAX_REMOTE_AGENTS_ENTERPRISE, MAX_REMOTE_AGENTS_NONE, MAX_REMOTE_AGENTS_PROFESSIONAL, MAX_REMOTE_AGENTS_STANDARD, MAX_REMOTE_AGENTS_UNLIMITED
-
-
Constructor Summary
Constructors Constructor Description BambooLicenseManagerImpl(@NotNull BootstrapManager bootstrapManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticateLicense(String license)
Checks whether or not a specific license is validint
getAllowedNumberOfLocalAgents()
Checks the maximum number of local agents allowed for the current license.int
getAllowedNumberOfPlans()
Checks the maximum number of plans that can be created for the current license.int
getAllowedNumberOfPlans(String licenseString)
Checks the maximum number of plans that can be created for the provided licenseint
getAllowedNumberOfRemoteAgents()
Checks the maximum number of remote agents allowed for the current license.protected Date
getBuildDate()
@Nullable com.atlassian.extras.api.bamboo.BambooLicense
getLicense()
Retrieves the current bamboo license for this instance.@Nullable String
getLicenseString()
boolean
isAcademic()
boolean
isBasicEdition()
boolean
isCommercial()
boolean
isCommunity()
boolean
isDataCenter()
boolean
isDemonstration()
boolean
isDeveloper()
boolean
isEvaluation()
boolean
isLicenseValid()
Checks whether the existing license is validboolean
isMaintenanceExpiredForBuild()
Checks if the maintenance has expired for the given license based on the current build number.boolean
isOpenSource()
boolean
isStarter()
void
setLicense(String license)
Sets the license for this Bamboo instance.
-
-
-
Field Detail
-
BAMBOO_LICENSE_KEY
public static final String BAMBOO_LICENSE_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BambooLicenseManagerImpl
public BambooLicenseManagerImpl(@NotNull @NotNull BootstrapManager bootstrapManager)
-
-
Method Detail
-
getLicense
@Nullable public @Nullable com.atlassian.extras.api.bamboo.BambooLicense getLicense()
Description copied from interface:BambooLicenseManager
Retrieves the current bamboo license for this instance. Looks for version 2 license only- Specified by:
getLicense
in interfaceBambooLicenseManager
- Returns:
- BambooLicense if exists or null if no license exists.
-
getLicenseString
@Nullable public @Nullable String getLicenseString()
-
setLicense
public void setLicense(String license)
Description copied from interface:BambooLicenseManager
Sets the license for this Bamboo instance.- Specified by:
setLicense
in interfaceBambooLicenseManager
- Parameters:
license
- string
-
authenticateLicense
public boolean authenticateLicense(String license)
Description copied from interface:BambooLicenseManager
Checks whether or not a specific license is valid- Specified by:
authenticateLicense
in interfaceBambooLicenseManager
- Parameters:
license
- to check- Returns:
- true if license is valid, otherwise false
-
isLicenseValid
public boolean isLicenseValid()
Description copied from interface:BambooLicenseManager
Checks whether the existing license is valid- Specified by:
isLicenseValid
in interfaceBambooLicenseManager
- Returns:
- true if license is valid, otherwise false
-
getBuildDate
protected Date getBuildDate()
-
isMaintenanceExpiredForBuild
public boolean isMaintenanceExpiredForBuild()
Description copied from interface:BambooLicenseManager
Checks if the maintenance has expired for the given license based on the current build number.- Specified by:
isMaintenanceExpiredForBuild
in interfaceBambooLicenseManager
- Returns:
- true if expired otherwise false.
-
getAllowedNumberOfRemoteAgents
public int getAllowedNumberOfRemoteAgents()
Description copied from interface:BambooLicenseManager
Checks the maximum number of remote agents allowed for the current license.- Specified by:
getAllowedNumberOfRemoteAgents
in interfaceBambooLicenseManager
- Returns:
- The maximum number of remote agents allowed or -1 if not limited
-
getAllowedNumberOfLocalAgents
public int getAllowedNumberOfLocalAgents()
Description copied from interface:BambooLicenseManager
Checks the maximum number of local agents allowed for the current license.- Specified by:
getAllowedNumberOfLocalAgents
in interfaceBambooLicenseManager
- Returns:
- The maximum number of local agents allowed or -1 if not limited
-
getAllowedNumberOfPlans
public int getAllowedNumberOfPlans()
Description copied from interface:BambooLicenseManager
Checks the maximum number of plans that can be created for the current license.- Specified by:
getAllowedNumberOfPlans
in interfaceBambooLicenseManager
- Returns:
- The maximum number of plans that can be created or -1 if not limited
-
getAllowedNumberOfPlans
public int getAllowedNumberOfPlans(String licenseString)
Description copied from interface:BambooLicenseManager
Checks the maximum number of plans that can be created for the provided license- Specified by:
getAllowedNumberOfPlans
in interfaceBambooLicenseManager
- Parameters:
licenseString
- to check- Returns:
- The maximum number of plans that can be created or -1 if not limited
-
isStarter
public boolean isStarter()
- Specified by:
isStarter
in interfaceBambooLicenseManager
-
isBasicEdition
public boolean isBasicEdition()
-
isEvaluation
public boolean isEvaluation()
- Specified by:
isEvaluation
in interfaceBambooLicenseManager
-
isAcademic
public boolean isAcademic()
- Specified by:
isAcademic
in interfaceBambooLicenseManager
-
isDemonstration
public boolean isDemonstration()
- Specified by:
isDemonstration
in interfaceBambooLicenseManager
-
isDeveloper
public boolean isDeveloper()
- Specified by:
isDeveloper
in interfaceBambooLicenseManager
-
isCommunity
public boolean isCommunity()
- Specified by:
isCommunity
in interfaceBambooLicenseManager
-
isOpenSource
public boolean isOpenSource()
- Specified by:
isOpenSource
in interfaceBambooLicenseManager
-
isCommercial
public boolean isCommercial()
- Specified by:
isCommercial
in interfaceBambooLicenseManager
-
isDataCenter
public boolean isDataCenter()
- Specified by:
isDataCenter
in interfaceBambooLicenseManager
-
-