com.atlassian.confluence.license
Class DefaultLicenseService

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

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 install(String licenseString)
          Validates and installs a given encrypted license.
 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.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

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

retrieve

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

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

validate

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)


Copyright © 2003-2013 Atlassian. All Rights Reserved.