com.atlassian.confluence.license
Interface LicenseService

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:
LicenseWebFacade

Method Summary
 com.atlassian.extras.api.confluence.ConfluenceLicense install(String licenseString)
          Validates and installs a given encrypted 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.
 com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString)
          Validates the given encrypted license.
 

Method Detail

retrieve

@Nonnull
com.atlassian.extras.api.confluence.ConfluenceLicense retrieve()
                                                               throws LicenseException
Retrieves the currently installed Confluence license. This is a convenience method for retrieve(Product) with Product.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 LicenseException
Retrieves 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

@Nonnull
com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve(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

validate

@Nonnull
com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString)
                                                               throws LicenseException
Validates the given encrypted license.

Throws:
LicenseException
See Also:
install(String)

install

@Nonnull
com.atlassian.extras.api.confluence.ConfluenceLicense install(String licenseString)
                                                              throws LicenseException
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 invalid

isLicensedForDataCenter

boolean isLicensedForDataCenter()
                                throws LicenseException
Returns whether currently installed license is for Data Center. This is the same as called ConfluenceLicenseUtils.isDataCenter(com.atlassian.extras.api.confluence.ConfluenceLicense) with retrieve().

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


Copyright © 2003–2015 Atlassian. All rights reserved.