public final class LocalSubscriptionKey extends Object
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.
| Constructor and Description |
|---|
LocalSubscriptionKey() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<SubscriptionKey> |
fromString(String key)
Creates a new
SubscriptionKey based on the given string
representation. |
static SubscriptionKey |
get()
Gets the current subscription key, if found.
|
static SubscriptionKey |
getOrFail()
Gets the current subscription key or throws an exception if not
available.
|
public static SubscriptionKey get()
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.
public static Optional<SubscriptionKey> fromString(String key)
SubscriptionKey based on the given string
representation.key - The string representation of the subscription.SubscriptionKey, or an empty Optional if the
given string does not represent a valid subscription key.public static SubscriptionKey getOrFail()
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.
LicenseException - if the subscription key cannot be found.Copyright © 2017-2025. All Rights Reserved.