Class PropertyDeploymentConfiguration
- java.lang.Object
-
- com.vaadin.flow.server.AbstractPropertyConfiguration
-
- com.vaadin.flow.server.AbstractDeploymentConfiguration
-
- com.vaadin.flow.server.PropertyDeploymentConfiguration
-
- All Implemented Interfaces:
DeploymentConfiguration,AbstractConfiguration,Serializable
- Direct Known Subclasses:
DefaultDeploymentConfiguration
public class PropertyDeploymentConfiguration extends AbstractDeploymentConfiguration
The property handling implementation ofDeploymentConfigurationbased on a base class for resolving system properties and a set of init parameters.- Since:
- 1.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PropertyDeploymentConfiguration(ApplicationConfiguration parentConfig, Class<?> systemPropertyBaseClass, Properties initParameters)Create a new property deployment configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanenableDevServer()Get if the dev server should be enabled.StringgetApplicationProperty(String parameterName)Gets an application property value.StringgetBuildFolder()Return the defined build folder for the used build system.intgetHeartbeatInterval()Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.PropertiesgetInitParameters()Gets the properties configured for the deployment, e.g.FilegetJavaResourceFolder()Gets the folder where resource sources are stored.intgetMaxMessageSuspendTimeout()In certain cases, such as when combining XmlHttpRequests and push over low bandwidth connections, messages may be received out of order by the client.protected ApplicationConfigurationgetParentConfiguration()Returns parent application configuration.PushModegetPushMode()Returns the mode of bidirectional ("push") client-server communication that should be used.protected StringgetSystemProperty(String parameterName)Gets an system property value.intgetWebComponentDisconnect()Returns the number of seconds that a WebComponent will wait for a reconnect before removing the server-side component from memory.booleanisCloseIdleSessions()Returns whether a Vaadin session should be closed when all its open UIs have been idle for longer than its configured maximum inactivity time.booleanisDevModeLiveReloadEnabled()Checks if dev mode live reload is enabled or not.booleanisDevToolsEnabled()Checks if dev tools are enabled or not.booleanisGlobalPnpm()Returns whether globally installed pnpm is used or the default one (seeFrontendTools.DEFAULT_PNPM_VERSION).protected booleanisOwnProperty(String property)Checks whether the givenpropertyis the property explicitly set in this deployment configuration (not in it's parent config).booleanisPnpmEnabled()Returns whether pnpm is enabled or not.booleanisProductionMode()Returns whether Vaadin is in production mode.booleanisRequestTiming()Returns whether the server provides timing info to the client.booleanisSendUrlsAsParameters()Returns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencodedis enabled or not.booleanisSyncIdCheckEnabled()Returns whether sync id checking is enabled.booleanisUsageStatisticsEnabled()Returns whether development time usage statistics collection is enabled or not.booleanisXsrfProtectionEnabled()Returns whether cross-site request forgery protection is enabled.booleanreuseDevServer()Get if the dev server should be reused on each reload.booleanuseV14Bootstrap()Returns whether Vaadin is running in useDeprecatedV14Bootstrapping.-
Methods inherited from class com.vaadin.flow.server.AbstractDeploymentConfiguration
getClassLoaderName, getUIClassName
-
Methods inherited from class com.vaadin.flow.server.AbstractPropertyConfiguration
getApplicationOrSystemProperty, getApplicationProperty, getBooleanProperty, getProperties, getStringProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.server.AbstractConfiguration
getStringProperty
-
Methods inherited from interface com.vaadin.flow.function.DeploymentConfiguration
getApplicationOrSystemProperty, getBooleanProperty, getCompiledWebComponentsPath, getExternalStatsUrl, getPolyfills, getPushServletMapping, isBrotli, isEagerServerLoad, isStatsExternal
-
-
-
-
Constructor Detail
-
PropertyDeploymentConfiguration
public PropertyDeploymentConfiguration(ApplicationConfiguration parentConfig, Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new property deployment configuration instance.- Parameters:
parentConfig- a parent application configurationsystemPropertyBaseClass- the class that should be used as a basis when reading system propertiesinitParameters- the init parameters that should make up the foundation for this configuration
-
-
Method Detail
-
getSystemProperty
protected String getSystemProperty(String parameterName)
Gets an system property value.- Overrides:
getSystemPropertyin classAbstractPropertyConfiguration- Parameters:
parameterName- the Name or the parameter.- Returns:
- String value or null if not found
-
getApplicationProperty
public String getApplicationProperty(String parameterName)
Gets an application property value.- Overrides:
getApplicationPropertyin classAbstractPropertyConfiguration- Parameters:
parameterName- the Name or the parameter.- Returns:
- String value or null if not found
-
isProductionMode
public boolean isProductionMode()
Description copied from interface:AbstractConfigurationReturns whether Vaadin is in production mode.- Returns:
- true if in production mode, false otherwise.
-
enableDevServer
public boolean enableDevServer()
Description copied from interface:AbstractConfigurationGet if the dev server should be enabled. True by default- Returns:
- true if dev server should be used
-
useV14Bootstrap
public boolean useV14Bootstrap()
Description copied from interface:AbstractConfigurationReturns whether Vaadin is running in useDeprecatedV14Bootstrapping.- Returns:
- true if in useDeprecatedV14Bootstrapping, false otherwise.
-
isPnpmEnabled
public boolean isPnpmEnabled()
Description copied from interface:AbstractConfigurationReturns whether pnpm is enabled or not.- Returns:
trueif enabled,falseif not
-
isUsageStatisticsEnabled
public boolean isUsageStatisticsEnabled()
Description copied from interface:AbstractConfigurationReturns whether development time usage statistics collection is enabled or not. Always return false ifisProductionModeistrue.- Returns:
trueif enabled,falseif not collected.- See Also:
AbstractConfiguration.isProductionMode()
-
isGlobalPnpm
public boolean isGlobalPnpm()
Description copied from interface:AbstractConfigurationReturns whether globally installed pnpm is used or the default one (seeFrontendTools.DEFAULT_PNPM_VERSION).- Returns:
trueif globally installed pnpm is used,falseif the default one is used.
-
reuseDevServer
public boolean reuseDevServer()
Description copied from interface:AbstractConfigurationGet if the dev server should be reused on each reload. True by default, set it to false in tests so as dev server is not kept as a daemon after the test.- Returns:
- true if dev server should be reused
-
isRequestTiming
public boolean isRequestTiming()
Description copied from interface:DeploymentConfigurationReturns whether the server provides timing info to the client.- Returns:
- true if timing info is provided, false otherwise.
-
isXsrfProtectionEnabled
public boolean isXsrfProtectionEnabled()
Description copied from interface:AbstractConfigurationReturns whether cross-site request forgery protection is enabled.- Returns:
- true if XSRF protection is enabled, false otherwise.
-
getBuildFolder
public String getBuildFolder()
Description copied from interface:AbstractConfigurationReturn the defined build folder for the used build system.Default value is
targetused by maven and the gradle plugin will set it tobuild.- Returns:
- build folder name, default
target
-
getJavaResourceFolder
public File getJavaResourceFolder()
Description copied from interface:AbstractConfigurationGets the folder where resource sources are stored.Only available in development mode.
- Returns:
- the folder where resources are stored, typically
src/main/resources.
-
isSyncIdCheckEnabled
public boolean isSyncIdCheckEnabled()
Description copied from interface:DeploymentConfigurationReturns whether sync id checking is enabled. The sync id is used to gracefully handle situations when the client sends a message to a connector that has recently been removed on the server.- Returns:
trueif sync id checking is enabled;falseotherwise
-
getHeartbeatInterval
public int getHeartbeatInterval()
Description copied from interface:DeploymentConfigurationReturns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.- Returns:
- The time between heartbeats.
-
getMaxMessageSuspendTimeout
public int getMaxMessageSuspendTimeout()
Description copied from interface:DeploymentConfigurationIn certain cases, such as when combining XmlHttpRequests and push over low bandwidth connections, messages may be received out of order by the client. This property specifies the maximum time (in milliseconds) that the client will then wait for the predecessors of a received out-order message, before considering them missing and requesting a full resynchronization of the application state from the server.- Returns:
- The maximum message suspension timeout
-
getWebComponentDisconnect
public int getWebComponentDisconnect()
Description copied from interface:DeploymentConfigurationReturns the number of seconds that a WebComponent will wait for a reconnect before removing the server-side component from memory.- Returns:
- time to wait after a disconnect has happened
-
isSendUrlsAsParameters
public boolean isSendUrlsAsParameters()
Description copied from interface:DeploymentConfigurationReturns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencodedis enabled or not.- Returns:
falseif set to false ortrueotherwise
-
isCloseIdleSessions
public boolean isCloseIdleSessions()
Description copied from interface:DeploymentConfigurationReturns whether a Vaadin session should be closed when all its open UIs have been idle for longer than its configured maximum inactivity time.A UI is idle if it is open on the client side but has no activity other than heartbeat requests. If
isCloseIdleSessions() == false, heartbeat requests cause the session to stay open for as long as there are open UIs on the client side. If it istrue, the session is eventually closed if the open UIs do not have any user interaction.- Returns:
- True if UIs and Vaadin sessions receiving only heartbeat requests are eventually closed; false if heartbeat requests extend UI and session lifetime indefinitely.
- See Also:
WrappedSession.getMaxInactiveInterval()
-
getPushMode
public PushMode getPushMode()
Description copied from interface:DeploymentConfigurationReturns the mode of bidirectional ("push") client-server communication that should be used.- Returns:
- The push mode in use.
-
getInitParameters
public Properties getInitParameters()
Description copied from interface:DeploymentConfigurationGets the properties configured for the deployment, e.g. as init parameters to the servlet.- Returns:
- properties for the application.
-
isDevModeLiveReloadEnabled
public boolean isDevModeLiveReloadEnabled()
Description copied from interface:DeploymentConfigurationChecks if dev mode live reload is enabled or not.Note that if the dev tools are disabled (
DeploymentConfiguration.isDevToolsEnabled()returnsfalse), the live reload will be disabled as well.- Returns:
trueif dev mode live reload is enabled,falseotherwise
-
isDevToolsEnabled
public boolean isDevToolsEnabled()
Description copied from interface:DeploymentConfigurationChecks if dev tools are enabled or not. They is always disabled in production mode. In development mode, it is enabled by default.- Returns:
trueif dev tools are enabled,falseotherwise
-
isOwnProperty
protected boolean isOwnProperty(String property)
Checks whether the givenpropertyis the property explicitly set in this deployment configuration (not in it's parent config).The deployment configuration consists of properties defined in the configuration itself and properties which are coming from the application configuration. The properties which are defined in the deployment configuration itself (own properties) should take precedence: their values should override the parent config properties values.
- Parameters:
property- a property name- Returns:
- whether the
propertyis explicitly set in the configuration
-
getParentConfiguration
protected ApplicationConfiguration getParentConfiguration()
Returns parent application configuration.- Returns:
- the parent config
-
-