com.atlassian.confluence.license
Class DefaultLicenseService

java.lang.Object
  extended by com.atlassian.confluence.license.DefaultLicenseService
All Implemented Interfaces:
LicenseService

@ParametersAreNonnullByDefault
public class DefaultLicenseService
extends Object
implements LicenseService

Responsible for the decoding of a license using the v2 LicenseManager. Delegates the validation to LicenseValidator and all storage operations to LicenseStore.


Constructor Summary
DefaultLicenseService(LicenseStore store, com.atlassian.extras.api.LicenseManager decoder, LicenseValidator validator)
           
 
Method Summary
 com.atlassian.extras.api.confluence.ConfluenceLicense assertConfluenceLicense(com.atlassian.extras.api.AtlassianLicense license)
           
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLicenseService

public DefaultLicenseService(LicenseStore store,
                             com.atlassian.extras.api.LicenseManager decoder,
                             LicenseValidator validator)
Method Detail

retrieve

@Nonnull
public com.atlassian.extras.api.confluence.ConfluenceLicense retrieve()
Description copied from interface: LicenseService
Retrieves the currently installed Confluence license. This is a convenience method for LicenseService.retrieve(Product) with Product.CONFLUENCE.

Specified by:
retrieve in interface LicenseService
Returns:
the installed Confluence license, never null

retrieveAtlassianLicense

@Nonnull
public com.atlassian.extras.api.AtlassianLicense retrieveAtlassianLicense()
                                                                   throws LicenseException
Description copied from interface: LicenseService
Retrieves the currently installed Atlassian license.

Specified by:
retrieveAtlassianLicense in interface LicenseService
Returns:
the installed Atlassian license, never null
Throws:
LicenseException - if no license is installed or the license could not be de-crypted

retrieve

@Nonnull
public com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve(com.atlassian.extras.api.Product product)
                                                                            throws LicenseException
Description copied from interface: LicenseService
Retrieves the license for the requested product.

Specified by:
retrieve in interface LicenseService
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

install

@Nonnull
public com.atlassian.extras.api.confluence.ConfluenceLicense install(String licenseString)
Description copied from interface: LicenseService
Validates and installs a given encrypted license.

Specified by:
install in interface LicenseService
Parameters:
licenseString - the encrypted license
Returns:
the de-crypted, de-serialised license

isLicensedForDataCenter

public boolean isLicensedForDataCenter()
Description copied from interface: LicenseService
Returns whether currently installed license is for Data Center. This is the same as called ConfluenceLicenseUtils.isDataCenter(com.atlassian.extras.api.confluence.ConfluenceLicense) with LicenseService.retrieve().

Specified by:
isLicensedForDataCenter in interface LicenseService
Returns:
whether the license is for Data Center.

validate

@Nonnull
public com.atlassian.extras.api.confluence.ConfluenceLicense validate(String licenseString)
Description copied from interface: LicenseService
Validates the given encrypted license.

Specified by:
validate in interface LicenseService
See Also:
LicenseService.install(String)

decode

public com.atlassian.extras.api.AtlassianLicense decode(String licenseString)

sanitise

public String sanitise(String licenseString)

assertConfluenceLicense

public com.atlassian.extras.api.confluence.ConfluenceLicense assertConfluenceLicense(com.atlassian.extras.api.AtlassianLicense license)


Copyright © 2003–2015 Atlassian. All rights reserved.