@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.
|
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
LicenseService
retrieveAtlassianLicense
in interface LicenseService
LicenseException
- 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
LicenseService
retrieve
in interface LicenseService
product
- 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)
LicenseService
install
in interface LicenseService
licenseString
- the encrypted licensepublic boolean isLicensed() throws LicenseException
LicenseServiceInternal
LicenseService.retrieveAtlassianLicense()
is non-null.isLicensed
in interface LicenseServiceInternal
LicenseException
- if no license is installed or the license could not be de-cryptedpublic boolean isLicensedForDataCenter()
LicenseService
ProductLicense.isClusteringEnabled()
with LicenseService.retrieve()
.isLicensedForDataCenter
in interface LicenseService
@Nonnull public com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString)
LicenseService
validate
in interface LicenseService
LicenseService.install(String)
@Nonnull public com.atlassian.extras.api.ProductLicense validate(String licenseString, com.atlassian.extras.api.Product product) throws LicenseException
LicenseService
validate
in interface LicenseService
LicenseException
LicenseService.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–2018 Atlassian. All rights reserved.