Class DefaultLicenseService

    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method 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.AtlassianLicense decodeAndValidateLicense​(String licenseString)  
      com.atlassian.extras.api.AtlassianLicense getForgedLicense​(com.atlassian.extras.api.AtlassianLicense decode)  
      @NonNull com.atlassian.extras.api.confluence.ConfluenceLicense install​(String licenseString)
      Validates and installs a given encrypted license.
      boolean isDcLicense()  
      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.
      @NonNull com.atlassian.extras.api.confluence.ConfluenceLicense retrieve()
      Retrieves the currently installed Confluence license.
      @NonNull com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve​(com.atlassian.extras.api.Product product)
      Deprecated.
      since 7.0.1.
      @NonNull com.atlassian.extras.api.AtlassianLicense retrieveAtlassianLicense()
      Retrieves the currently installed Atlassian license.
      String sanitise​(String licenseString)  
      @NonNull com.atlassian.extras.api.confluence.ConfluenceLicense validate​(String licenseString)
      Validates the given encrypted license.
      @NonNull com.atlassian.extras.api.ProductLicense validate​(String licenseString, com.atlassian.extras.api.Product product)
      Validates the given encrypted license.
    • Constructor Detail

      • DefaultLicenseService

        public DefaultLicenseService​(LicenseStoreInternal store,
                                     com.atlassian.extras.api.LicenseManager decoder,
                                     LicenseValidator validator,
                                     com.atlassian.extras.core.AtlassianLicenseFactory licenseFactory)
    • Method Detail

      • retrieve

        public @NonNull 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.retrieveForProduct(Product) with Product.CONFLUENCE.

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

        public @NonNull com.atlassian.extras.api.AtlassianLicense retrieveAtlassianLicense()
                                                                                    throws com.atlassian.extras.api.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
        com.atlassian.extras.api.LicenseException
      • retrieve

        @Deprecated
        public @NonNull com.atlassian.fugue.Maybe<com.atlassian.extras.api.ProductLicense> retrieve​(com.atlassian.extras.api.Product product)
                                                                                             throws com.atlassian.extras.api.LicenseException
        Deprecated.
        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
        com.atlassian.extras.api.LicenseException
      • install

        public @NonNull 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 calling ProductLicense.isClusteringEnabled() with LicenseService.retrieve().
        Specified by:
        isLicensedForDataCenter in interface LicenseService
        Returns:
        whether the license is for Data Center.
      • isLicensedForDataCenterOrExempt

        public boolean isLicensedForDataCenterOrExempt()
        Description copied from interface: LicenseService
        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.
        Specified by:
        isLicensedForDataCenterOrExempt in interface LicenseService
        Returns:
        Whether the license is for Data Center or should be exempt from DC license checks.
      • 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)
      • assertProductLicense

        public com.atlassian.extras.api.ProductLicense assertProductLicense​(com.atlassian.extras.api.AtlassianLicense license,
                                                                            com.atlassian.extras.api.Product product)
      • decodeAndValidateLicense

        public com.atlassian.extras.api.AtlassianLicense decodeAndValidateLicense​(@Nonnull
                                                                                  String licenseString)
      • getForgedLicense

        public com.atlassian.extras.api.AtlassianLicense getForgedLicense​(com.atlassian.extras.api.AtlassianLicense decode)
      • isDcLicense

        public boolean isDcLicense()
        Specified by:
        isDcLicense in interface com.atlassian.crowd.embedded.spi.DcLicenseChecker