Interface DeploymentConfiguration
- All Superinterfaces:
AbstractConfiguration
,Serializable
- All Known Implementing Classes:
AbstractDeploymentConfiguration
,DefaultDeploymentConfiguration
,PropertyDeploymentConfiguration
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescription<T> T
getApplicationOrSystemProperty
(String propertyName, T defaultValue, Function<String, T> converter) Gets a configured property.default boolean
getBooleanProperty
(String propertyName, boolean defaultValue) A shorthand ofgetApplicationOrSystemProperty(String, Object, Function)
forString
type.Gets class loader configuration option value.default String
default String
Get the url from where stats.json should be retrieved from.int
Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.Gets the properties configured for the deployment, e.g.int
In certain cases, such as when combining XmlHttpRequests and push over low bandwidth connections, messages may be received out of order by the client.Returns an array with polyfills to be loaded when the app is loaded.Returns the mode of bidirectional ("push") client-server communication that should be used.default String
Returns the servlet mapping that bidirectional ("push") client-server communication should use.Gets UI class configuration option value.int
Returns the number of seconds that a WebComponent will wait for a reconnect before removing the server-side component from memory.default boolean
isBrotli()
Checks whether precompressed Brotli files should be used if available.boolean
Returns whether a Vaadin session should be closed when all its open UIs have been idle for longer than its configured maximum inactivity time.boolean
Checks if dev mode live reload is enabled or not.boolean
Checks if dev tools are enabled or not.default boolean
Get if the bootstrap page should include the initial UIDL fragment.boolean
Returns whether the server provides timing info to the client.boolean
Returns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencoded
is enabled or not.default boolean
Get if the stats.json file should be retrieved from an external service or through the classpath.boolean
Returns whether sync id checking is enabled.Methods inherited from interface com.vaadin.flow.server.AbstractConfiguration
frontendHotdeploy, getBuildFolder, getJavaResourceFolder, getJavaSourceFolder, getMode, getProjectFolder, getStringProperty, isGlobalPnpm, isPnpmEnabled, isProductionMode, isUsageStatisticsEnabled, isXsrfProtectionEnabled, reuseDevServer
-
Method Details
-
isRequestTiming
boolean isRequestTiming()Returns whether the server provides timing info to the client.- Returns:
- true if timing info is provided, false otherwise.
-
isSyncIdCheckEnabled
boolean isSyncIdCheckEnabled()Returns 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:
true
if sync id checking is enabled;false
otherwise
-
getHeartbeatInterval
int getHeartbeatInterval()Returns 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
int getMaxMessageSuspendTimeout()In 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
int getWebComponentDisconnect()Returns 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
boolean isSendUrlsAsParameters()Returns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencoded
is enabled or not.- Returns:
false
if set to false ortrue
otherwise
-
isCloseIdleSessions
boolean isCloseIdleSessions()Returns 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:
-
getPushMode
PushMode getPushMode()Returns the mode of bidirectional ("push") client-server communication that should be used.- Returns:
- The push mode in use.
-
getPushServletMapping
Returns the servlet mapping that bidirectional ("push") client-server communication should use.- Returns:
- The push servlet mapping to use
-
getInitParameters
Properties getInitParameters()Gets the properties configured for the deployment, e.g. as init parameters to the servlet.- Returns:
- properties for the application.
-
getApplicationOrSystemProperty
<T> T getApplicationOrSystemProperty(String propertyName, T defaultValue, Function<String, T> converter) Gets a configured property. The properties are typically read from e.g. web.xml or from system properties of the JVM.- Type Parameters:
T
- type of a property- Parameters:
propertyName
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been definedconverter
- the way string should be converted into the required property- Returns:
- the property value, or the passed default value if no property value is found
-
getBooleanProperty
default boolean getBooleanProperty(String propertyName, boolean defaultValue) throws IllegalArgumentException A shorthand ofgetApplicationOrSystemProperty(String, Object, Function)
forString
type. Considers""
to be equaltrue
in order to treat params like-Dtest.param
as enabled (test.param == true
). Additionally validates the property value, requiring non-empty strings to be equal to boolean string representation. An exception thrown if it's not true.- Specified by:
getBooleanProperty
in interfaceAbstractConfiguration
- Parameters:
propertyName
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been defined- Returns:
- the property value, or the passed default value if no property value is found
- Throws:
IllegalArgumentException
- if property value string is not a boolean value
-
getUIClassName
String getUIClassName()Gets UI class configuration option value.- Returns:
- UI class name
-
getClassLoaderName
String getClassLoaderName()Gets class loader configuration option value.- Returns:
- the configured class loader name
-
isBrotli
default boolean isBrotli()Checks whether precompressed Brotli files should be used if available.- Returns:
true
to serve precompressed Brotli files,false
to not serve Brotli files.
-
getCompiledWebComponentsPath
-
getPolyfills
Returns an array with polyfills to be loaded when the app is loaded. The default value is empty, but it can be changed by setting theInitParameters.SERVLET_PARAMETER_POLYFILLS
as a comma separated list of JS files to load.- Returns:
- polyfills to load
-
isStatsExternal
default boolean isStatsExternal()Get if the stats.json file should be retrieved from an external service or through the classpath.- Returns:
- true if stats.json is served from an external location
-
getExternalStatsUrl
Get the url from where stats.json should be retrieved from. If not given this will default to '/vaadin-static/VAADIN/config/stats.json'- Returns:
- external stats.json location
-
isEagerServerLoad
default boolean isEagerServerLoad()Get if the bootstrap page should include the initial UIDL fragment. This only makes sense for the client-side bootstrapping.By default it is
false
.Enabling this flag, it will make the initial application load a couple of seconds faster in very slow networks because of the extra round-trip to request the UIDL after the index.html is loaded.
Otherwise, keeping the flag as false is beneficial, specially in application that mix client and server side views, since the `index.html` can be cached and served by service workers in PWAs, as well as in the server side session and UI initialization is deferred until a server view is actually requested by the user, saving some server resources.
- Returns:
- true if initial UIDL should be included in page
-
isDevModeLiveReloadEnabled
boolean isDevModeLiveReloadEnabled()Checks if dev mode live reload is enabled or not.Note that if the dev tools are disabled (
isDevToolsEnabled()
returnsfalse
), the live reload will be disabled as well.- Returns:
true
if dev mode live reload is enabled,false
otherwise
-
isDevToolsEnabled
boolean isDevToolsEnabled()Checks if dev tools are enabled or not. They is always disabled in production mode. In development mode, it is enabled by default.- Returns:
true
if dev tools are enabled,false
otherwise
-