@ParametersAreNonnullByDefault public class DefaultLicenseService extends Object implements LicenseServiceInternal
LicenseManager. Delegates the validation to
LicenseValidator and all storage operations to LicenseStore.| Constructor and Description |
|---|
DefaultLicenseService(LicenseStoreInternal store,
com.atlassian.extras.api.LicenseManager decoder,
LicenseValidator validator) |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.extras.api.confluence.ConfluenceLicense |
assertConfluenceLicense(com.atlassian.extras.api.AtlassianLicense license) |
com.atlassian.extras.api.ProductLicense |
assertProductLicense(com.atlassian.extras.api.AtlassianLicense license,
com.atlassian.extras.api.Product product) |
com.atlassian.extras.api.AtlassianLicense |
decode(String licenseString) |
com.atlassian.extras.api.confluence.ConfluenceLicense |
install(String licenseString)
Validates and installs a given encrypted license.
|
boolean |
isLicensed()
Returns whether there is a currently installed license.
|
boolean |
isLicensedForDataCenter()
Returns whether currently installed license is for Data Center.
|
boolean |
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.
|
com.atlassian.extras.api.confluence.ConfluenceLicense |
retrieve()
Retrieves the currently installed Confluence license.
|
com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> |
retrieve(com.atlassian.extras.api.Product product)
Retrieves the license for the requested product.
|
com.atlassian.extras.api.AtlassianLicense |
retrieveAtlassianLicense()
Retrieves the currently installed Atlassian license.
|
String |
sanitise(String licenseString) |
com.atlassian.extras.api.confluence.ConfluenceLicense |
validate(String licenseString)
Validates the given encrypted license.
|
com.atlassian.extras.api.ProductLicense |
validate(String licenseString,
com.atlassian.extras.api.Product product)
Validates the given encrypted license.
|
public DefaultLicenseService(LicenseStoreInternal store, com.atlassian.extras.api.LicenseManager decoder, LicenseValidator validator)
@Nonnull public com.atlassian.extras.api.confluence.ConfluenceLicense retrieve()
LicenseService
This is a convenience method for LicenseService.retrieve(Product) with Product.CONFLUENCE.
retrieve in interface LicenseService@Nonnull public com.atlassian.extras.api.AtlassianLicense retrieveAtlassianLicense() throws LicenseException
LicenseServiceretrieveAtlassianLicense in interface LicenseServiceLicenseException - if no license is installed or the license could not be de-crypted@Nonnull public com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve(com.atlassian.extras.api.Product product) throws LicenseException
LicenseServiceretrieve in interface LicenseServiceproduct - the product for which the license is requestedLicenseException - if no license is installed or the license could not be de-crypted@Nonnull public com.atlassian.extras.api.confluence.ConfluenceLicense install(String licenseString)
LicenseServiceinstall in interface LicenseServicelicenseString - the encrypted licensepublic boolean isLicensed()
throws LicenseException
LicenseServiceInternalLicenseService.retrieveAtlassianLicense() is non-null.isLicensed in interface LicenseServiceInternalLicenseException - if no license is installed or the license could not be de-cryptedpublic boolean isLicensedForDataCenter()
LicenseServiceProductLicense.isClusteringEnabled() with LicenseService.retrieve().isLicensedForDataCenter in interface LicenseServicepublic boolean isLicensedForDataCenterOrExempt()
LicenseServiceisLicensedForDataCenterOrExempt in interface LicenseService@Nonnull public com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString)
LicenseServicevalidate in interface LicenseServiceLicenseService.install(String)@Nonnull public com.atlassian.extras.api.ProductLicense validate(String licenseString, com.atlassian.extras.api.Product product) throws LicenseException
LicenseServicevalidate in interface LicenseServiceLicenseExceptionLicenseService.validate(String, com.atlassian.extras.api.Product)public com.atlassian.extras.api.AtlassianLicense decode(String licenseString)
public com.atlassian.extras.api.confluence.ConfluenceLicense assertConfluenceLicense(com.atlassian.extras.api.AtlassianLicense license)
public com.atlassian.extras.api.ProductLicense assertProductLicense(com.atlassian.extras.api.AtlassianLicense license,
com.atlassian.extras.api.Product product)
Copyright © 2003–2019 Atlassian. All rights reserved.