Package com.atlassian.confluence.license
Interface LicenseService
- All Known Subinterfaces:
LicenseServiceInternal
- All Known Implementing Classes:
DefaultLicenseService
@ParametersAreNonnullByDefault
public interface LicenseService
Unifies the interaction with the v1 (still used for store) and v2 license code.
Licenses installed over this service have to, among other validation criteria, contain a license for the Product.CONFLUENCE
.
- Since:
- 4.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NonNull com.atlassian.extras.api.confluence.ConfluenceLicense
Validates and installs a given encrypted license.boolean
Returns whether currently installed license is for Data Center.boolean
Returns whether the currently installed license is for Data Center, or if the license should be treated as exempt from Data Center checks for testing purposes.@NonNull com.atlassian.extras.api.confluence.ConfluenceLicense
retrieve()
Retrieves the currently installed Confluence license.@NonNull com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense>
retrieve
(com.atlassian.extras.api.Product product) Deprecated.since 7.0.1.@NonNull com.atlassian.extras.api.AtlassianLicense
Retrieves the currently installed Atlassian license.default @NonNull Optional<com.atlassian.extras.api.ProductLicense>
retrieveForProduct
(com.atlassian.extras.api.Product product) Retrieves the license for the requested product.@NonNull com.atlassian.extras.api.confluence.ConfluenceLicense
Validates the given encrypted license.@NonNull com.atlassian.extras.api.ProductLicense
Validates the given encrypted license.
-
Method Details
-
retrieve
Retrieves the currently installed Confluence license.This is a convenience method for
retrieveForProduct(Product)
withProduct.CONFLUENCE
.- Returns:
- the installed Confluence license, never null
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted
-
retrieveAtlassianLicense
@NonNull com.atlassian.extras.api.AtlassianLicense retrieveAtlassianLicense() throws LicenseExceptionRetrieves the currently installed Atlassian license.- Returns:
- the installed Atlassian license, never null
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted- Since:
- 5.6
-
retrieve
@Deprecated @NonNull com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve(com.atlassian.extras.api.Product product) throws LicenseException Deprecated.since 7.0.1. UseretrieveForProduct(Product)
Retrieves the license for the requested product.- Parameters:
product
- the product for which the license is requested- Returns:
- the license for the requested product if it is installed
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted
-
retrieveForProduct
default @NonNull Optional<com.atlassian.extras.api.ProductLicense> retrieveForProduct(com.atlassian.extras.api.Product product) throws LicenseException Retrieves the license for the requested product.- Parameters:
product
- the product for which the license is requested- Returns:
- the license for the requested product if it is installed
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted- Since:
- 7.0.1
-
validate
@NonNull com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString) throws LicenseException, EmptyLicenseValidationException, ForgedLicenseException, KnownConfluenceLicenseValidationException Validates the given encrypted license. -
validate
@NonNull com.atlassian.extras.api.ProductLicense validate(String licenseString, com.atlassian.extras.api.Product product) throws LicenseException, ForgedLicenseException Validates the given encrypted license. -
install
@NonNull com.atlassian.extras.api.confluence.ConfluenceLicense install(String licenseString) throws LicenseException, EmptyLicenseValidationException, ForgedLicenseException, KnownConfluenceLicenseValidationException Validates and installs a given encrypted license.- Parameters:
licenseString
- the encrypted license- Returns:
- the de-crypted, de-serialised license
- Throws:
LicenseException
- if the license could not be de-crypted or is invalidEmptyLicenseValidationException
ForgedLicenseException
KnownConfluenceLicenseValidationException
-
isLicensedForDataCenter
Returns whether currently installed license is for Data Center. This is the same as callingProductLicense.isClusteringEnabled()
withretrieve()
.- Returns:
- whether the license is for Data Center.
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted- Since:
- 5.6
-
isLicensedForDataCenterOrExempt
Returns whether the currently installed license is for Data Center, or if the license should be treated as exempt from Data Center checks for testing purposes.- Returns:
- Whether the license is for Data Center or should be exempt from DC license checks.
- Throws:
LicenseException
- if no license is installed or the license could not be de-crypted.- Since:
- 6.10.0
-