Class LicenseChecker

java.lang.Object
com.vaadin.pro.licensechecker.LicenseChecker

public class LicenseChecker extends Object
  • Constructor Details

    • LicenseChecker

      public LicenseChecker()
  • Method Details

    • checkLicenseFromStaticBlock

      @Deprecated public static void checkLicenseFromStaticBlock(String productName, String productVersion)
    • checkLicenseFromStaticBlock

      public static void checkLicenseFromStaticBlock(String productName, String productVersion, BuildType buildType)
      Checks the license for the given product version from a static block.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: production or development
      Throws:
      ExceptionInInitializerError - if the license check fails
    • checkLicense

      @Deprecated public static void checkLicense(String productName, String productVersion)
    • checkLicense

      public static void checkLicense(String productName, String productVersion, BuildType buildType)
      Checks the license for the given product version.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      Throws:
      LicenseException - if the license check fails
    • checkLicense

      public static void checkLicense(String productName, String productVersion, BuildType buildType, java.util.function.Consumer<String> noKeyUrlHandler, String machineId, ProKey proKey, SubscriptionKey subscriptionKey, OfflineKey offlineKey)
      Checks the license for the given pro key and product version.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
      machineId - the identifier of machine which owns pro key
      proKey - the pro key to be validated
      offlineKey - the offline key to be validated
      Throws:
      LicenseException - if the license check fails
    • checkLicense

      public static void checkLicense(String productName, String productVersion, java.util.function.Consumer<String> noKeyUrlHandler)
    • checkLicense

      public static void checkLicense(String productName, String productVersion, BuildType buildType, java.util.function.Consumer<String> noKeyUrlHandler)
      Checks the license for the given product version.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
      Throws:
      LicenseException - if the license check fails
    • checkLicense

      public static void checkLicense(String productName, String productVersion, BuildType buildType, java.util.function.Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler)
      Checks the license for the given product version.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
      timeoutKeyUrlHandler - timeout for the key url handler
      Throws:
      LicenseException - if the license check fails
    • isValidLicense

      public static boolean isValidLicense(String productName, String productVersion, BuildType buildType)
      Checks the license for the given product version. Returns true if the license is valid, false otherwise.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      Returns:
      true if the license is valid, false otherwise
    • checkLicenseAsync

      @Deprecated public static void checkLicenseAsync(String productName, String productVersion, LicenseChecker.Callback callback)
    • checkLicenseAsync

      public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback)
      Checks the license for the given product version in the background and invokes the callback when done.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      callback - the callback to invoke with the result
    • checkLicenseAsync

      public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, java.util.function.Consumer<String> noKeyUrlHandler, String machineId, ProKey proKey, SubscriptionKey subscriptionKey, OfflineKey offlineKey)
      Checks the license for the given pro key and product version in the background and invokes the callback when done.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      callback - the callback to invoke with the result
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
      machineId - the identifier of machine which owns pro key
      proKey - the pro key to be validated
      offlineKey - the offline key to be validated
      Throws:
      LicenseException - if the license check fails
    • checkLicenseAsync

      @Deprecated public static void checkLicenseAsync(String productName, String productVersion, LicenseChecker.Callback callback, java.util.function.Consumer<String> noKeyUrlHandler)
    • checkLicenseAsync

      public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, java.util.function.Consumer<String> noKeyUrlHandler)
      Checks the license for the given product version in the background and invokes the callback when done.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      callback - the callback to invoke with the result
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
    • checkLicenseAsync

      public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, java.util.function.Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler)
      Checks the license for the given product version in the background and invokes the callback when done.
      Parameters:
      productName - the name of the product to check
      productVersion - the version of the product to check
      buildType - the type of build: development or production
      callback - the callback to invoke with the result
      noKeyUrlHandler - a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is avialable.
      timeoutKeyUrlHandler - timeout for the key url handler
    • setStrictOffline

      public static void setStrictOffline(boolean strictOffline)