Class LicenseConfigurator


  • public abstract class LicenseConfigurator
    extends Object
    Manages the activation and configuration of a license
    Since:
    2.0.0
    • Constructor Detail

      • LicenseConfigurator

        public LicenseConfigurator()
    • Method Detail

      • setInstance

        public static void setInstance​(LicenseConfigurator licenseConfigurator)
        Replaces the current Configurator instance with the given one.
        Parameters:
        licenseConfigurator - the new licenseConfigurator.
      • validateActivationKey

        protected void validateActivationKey​(HttpServletRequest request,
                                             LicenseConfiguration licenseConfiguration,
                                             com.sodius.licensing.License license,
                                             String... activationKeys)
        Activates the license with the keys passed as parameters and updates the status of the LicenseConfiguration object.
        Parameters:
        request - the Http Request
        licenseConfiguration - the LicenseConfiguration object
        license - the license object
        activationKeys - the keys to activate
      • validateAccess

        protected abstract void validateAccess​(HttpServletRequest request,
                                               com.sodius.licensing.License license)
                                        throws com.sodius.licensing.ActivationException
        Validates that the license is correct and that the user can perform his request.
        Parameters:
        request - the http request
        license - the license
        Throws:
        com.sodius.licensing.ActivationException - if the license is absent/not valid
      • validateAccess

        public void validateAccess​(HttpServletRequest request)
                            throws com.sodius.licensing.ActivationException
        Validates that the license is correct and that the user can perform his request.
        Parameters:
        request - the http request
        Throws:
        com.sodius.licensing.ActivationException - if the license is absent/not valid