Package com.vaadin.pro.licensechecker
Class LicenseChecker
java.lang.Object
com.vaadin.pro.licensechecker.LicenseChecker
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckLicense(String productName, String productVersion) Deprecated.static voidcheckLicense(String productName, String productVersion, BuildType buildType) Checks the license for the given product version.static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler) Checks the license for the given product version.static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler) Checks the license for the given product version.static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version with the given capabilities (extra license checks).static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version with the given capabilities (extra license checks).static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, String machineId, ProKey proKey, SubscriptionKey subscriptionKey, OfflineKey offlineKey) Checks the license for the given pro key and product version.static voidcheckLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, String machineId, ProKey proKey, SubscriptionKey subscriptionKey, OfflineKey offlineKey, Capabilities capabilities) Checks the license for the given pro key and product version with the given capabilities (extra license checks).static voidcheckLicense(String productName, String productVersion, Capabilities capabilities, BuildType buildType) Checks the license for the given product version with the given capabilities (extra license checks).static voidcheckLicense(String productName, String productVersion, Consumer<String> noKeyUrlHandler) Deprecated.static voidcheckLicenseAsync(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.static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler) Checks the license for the given product version in the background and invokes the callback when done.static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler) Checks the license for the given product version in the background and invokes the callback when done.static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).static voidcheckLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, 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.static voidcheckLicenseAsync(String productName, String productVersion, LicenseChecker.Callback callback) Deprecated.static voidcheckLicenseFromStaticBlock(String productName, String productVersion) Deprecated.static voidcheckLicenseFromStaticBlock(String productName, String productVersion, BuildType buildType) Checks the license for the given product version from astaticblock.static voidcheckLicenseFromStaticBlock(String productName, String productVersion, BuildType buildType, Capabilities capabilities) Checks the license for the given product version from astaticblock with the given capabilities (extra license checks).getPreTrial(Product product) Gets the status of a pre-trial period for the given product using the default machine ID.getPreTrial(Product product, String machineId) Gets the status of a pre-trial period for the given product and machineId.static booleanisValidLicense(String productName, String productVersion, BuildType buildType) Checks the license for the given product version.static voidsetStrictOffline(boolean strictOffline) static PreTrialStarts a pre-trial period by using the default machine ID and a predefined user key.static PreTrialstartPreTrial(String machineId, String userKey) Starts a pre-trial period by using given machine ID and given user key.
-
Constructor Details
-
LicenseChecker
public LicenseChecker()
-
-
Method Details
-
checkLicenseFromStaticBlock
@Deprecated public static void checkLicenseFromStaticBlock(String productName, String productVersion) Deprecated. -
checkLicenseFromStaticBlock
public static void checkLicenseFromStaticBlock(String productName, String productVersion, BuildType buildType) Checks the license for the given product version from astaticblock.- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: production or development- Throws:
ExceptionInInitializerError- if the license check fails
-
checkLicenseFromStaticBlock
public static void checkLicenseFromStaticBlock(String productName, String productVersion, BuildType buildType, Capabilities capabilities) Checks the license for the given product version from astaticblock with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: production or developmentcapabilities- the license checker capabilities to run.- Throws:
ExceptionInInitializerError- if the license check fails
-
checkLicense
Deprecated. -
checkLicense
Checks the license for the given product version.- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or production- Throws:
LicenseException- if the license check fails
-
checkLicense
public static void checkLicense(String productName, String productVersion, Capabilities capabilities, BuildType buildType) Checks the license for the given product version with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkcapabilities- the license checker capabilities to runbuildType- 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, 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 checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.machineId- the identifier of machine which owns pro keyproKey- the pro key to be validatedofflineKey- the offline key to be validated- Throws:
LicenseException- if the license check fails
-
checkLicense
public static void checkLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, String machineId, ProKey proKey, SubscriptionKey subscriptionKey, OfflineKey offlineKey, Capabilities capabilities) Checks the license for the given pro key and product version with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.machineId- the identifier of machine which owns pro keyproKey- the pro key to be validatedofflineKey- the offline key to be validatedcapabilities- the license checker capabilities to run.- Throws:
LicenseException- if the license check fails
-
checkLicense
@Deprecated public static void checkLicense(String productName, String productVersion, Consumer<String> noKeyUrlHandler) Deprecated. -
checkLicense
public static void checkLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler) Checks the license for the given product version.- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.- Throws:
LicenseException- if the license check fails
-
checkLicense
public static void checkLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.capabilities- the license checker capabilities to run.- Throws:
LicenseException- if the license check fails
-
checkLicense
public static void checkLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler) Checks the license for the given product version.- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.timeoutKeyUrlHandler- timeout for the key url handler- Throws:
LicenseException- if the license check fails
-
checkLicense
public static void checkLicense(String productName, String productVersion, BuildType buildType, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productionnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.timeoutKeyUrlHandler- timeout for the key url handlercapabilities- the license checker capabilities to run.- 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. Returnstrueif the license is valid,falseotherwise.- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or production- Returns:
trueif the license is valid,falseotherwise
-
checkLicenseAsync
@Deprecated public static void checkLicenseAsync(String productName, String productVersion, LicenseChecker.Callback callback) Deprecated. -
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 checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the result
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultcapabilities- the license checker capabilities to run.
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, 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 checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.machineId- the identifier of machine which owns pro keyproKey- the pro key to be validatedofflineKey- the offline key to be validated- Throws:
LicenseException- if the license check fails
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, 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 checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.capabilities- the license checker capabilities to run.
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, Consumer<String> noKeyUrlHandler, int timeoutKeyUrlHandler, Capabilities capabilities) Checks the license for the given product version in the background and invokes the callback when done with the given capabilities (extra license checks).- Parameters:
productName- the name of the product to checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultnoKeyUrlHandler- a handler that is invoked to open the vaadin.com URL to download the key file. Used when no key file is available.timeoutKeyUrlHandler- timeout for the key url handlercapabilities- the license checker capabilities to run.
-
checkLicenseAsync
public static void checkLicenseAsync(String productName, String productVersion, BuildType buildType, LicenseChecker.Callback callback, 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 checkproductVersion- the version of the product to checkbuildType- the type of build: development or productioncallback- the callback to invoke with the resultnoKeyUrlHandler- 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
-
startPreTrial
Starts a pre-trial period by using the default machine ID and a predefined user key.If a pre-trial is already started it returns the state with updated remaining days. Otherwise, if the pre-trial has expired but cannot yet be renewed a
PreTrialCreationException.Expiredis thrown.- Returns:
- detail about the pre-trial.
- Throws:
PreTrialCreationException.Expired- if the pre-trial is expired and cannot yet be renewedPreTrialCreationException- if the License Server prevents the start of a pre-trial
-
startPreTrial
public static PreTrial startPreTrial(String machineId, String userKey) throws PreTrialCreationException Starts a pre-trial period by using given machine ID and given user key.If a pre-trial is already started it returns the state with updated remaining days. Otherwise, if the pre-trial has expired but cannot yet be renewed a
PreTrialCreationException.Expiredis thrown.- Parameters:
machineId- the identifier of machine which owns pro keyuserKey- the user key- Returns:
- detail about the pre-trial.
- Throws:
PreTrialCreationException.Expired- if the pre-trial is expired and cannot yet be renewedPreTrialCreationException- if the License Server prevents the start of a pre-trial
-
getPreTrial
Gets the status of a pre-trial period for the given product using the default machine ID.It returns the state of the pre-trial with information about remaining days.
- Parameters:
product- the product to validate- Returns:
- detail about the pre-trial.
- Throws:
PreTrialStatusCheckException- if pre-trial status cannot be checked against the License Server.
-
getPreTrial
Gets the status of a pre-trial period for the given product and machineId.It returns the state of the pre-trial with information about remaining days.
- Parameters:
product- the product to validatemachineId- the identifier of machine which owns pro key- Returns:
- detail about the pre-trial.
- Throws:
PreTrialStatusCheckException- if pre-trial status cannot be checked against the License Server.
-
setStrictOffline
public static void setStrictOffline(boolean strictOffline)
-
checkLicense(String, String, BuildType)