Package com.vaadin.pro.licensechecker
Class LocalSubscriptionKey
java.lang.Object
com.vaadin.pro.licensechecker.LocalSubscriptionKey
Subscription key loader.
A subscription key can be provided in several ways, to fit different needs and environments. The priority order is Java system property, environment variable, file in Vaadin home folder.
- System property with vaadin.subscriptionKey key
- Environment variable named VAADIN_SUBSCRIPTION_KEY
- File named subscriptionKey placed in the $HOME/.vaadin folder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<SubscriptionKey>fromString(String key) Creates a newSubscriptionKeybased on the given string representation.static SubscriptionKeyget()Gets the current subscription key, if found.static SubscriptionKeyGets the current subscription key or throws an exception if not available.
-
Constructor Details
-
LocalSubscriptionKey
public LocalSubscriptionKey()
-
-
Method Details
-
get
Gets the current subscription key, if found.
A valid subscription key is searched in system properties, environment variables and filesystem. See class level Javadoc for details on how the key can be provided.- Returns:
- the subscription key, or null if the key cannot be found.
-
fromString
Creates a newSubscriptionKeybased on the given string representation.- Parameters:
key- The string representation of the subscription.- Returns:
- a
SubscriptionKey, or an emptyOptionalif the given string does not represent a valid subscription key.
-
getOrFail
Gets the current subscription key or throws an exception if not available.
A valid subscription key is searched in system properties, environment variables and filesystem. See class level Javadoc for details on how the key can be provided.- Returns:
- the subscription key.
- Throws:
LicenseException- if the subscription key cannot be found.
-