Class DefaultDeploymentConfiguration
- java.lang.Object
-
- com.vaadin.flow.server.AbstractPropertyConfiguration
-
- com.vaadin.flow.server.AbstractDeploymentConfiguration
-
- com.vaadin.flow.server.PropertyDeploymentConfiguration
-
- com.vaadin.flow.server.DefaultDeploymentConfiguration
-
- All Implemented Interfaces:
DeploymentConfiguration
,AbstractConfiguration
,Serializable
public class DefaultDeploymentConfiguration extends PropertyDeploymentConfiguration
The default implementation ofDeploymentConfiguration
based on a base class for resolving system properties and a set of init parameters.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_CLOSE_IDLE_SESSIONS
Default value forisCloseIdleSessions()
= false .static int
DEFAULT_HEARTBEAT_INTERVAL
Default value forgetHeartbeatInterval()
= 300 .static int
DEFAULT_MAX_MESSAGE_SUSPEND_TIMEOUT
Default value forgetMaxMessageSuspendTimeout()
()} = 5000 .static boolean
DEFAULT_SEND_URLS_AS_PARAMETERS
static boolean
DEFAULT_SYNC_ID_CHECK
Default value forisSyncIdCheckEnabled()
= true .static int
DEFAULT_WEB_COMPONENT_DISCONNECT
Default value forgetWebComponentDisconnect()
= 300.static String
NOT_PRODUCTION_MODE_INFO
static String
NOT_PRODUCTION_MODE_WARNING
static String
WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC
static String
WARNING_PUSH_MODE_NOT_RECOGNIZED
static String
WARNING_V14_BOOTSTRAP
static String
WARNING_XSRF_PROTECTION_DISABLED
-
Constructor Summary
Constructors Constructor Description DefaultDeploymentConfiguration(ApplicationConfiguration parentConfig, Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new deployment configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHeartbeatInterval()
Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.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.PushMode
getPushMode()
Returns the mode of bidirectional ("push") client-server communication that should be used.String
getPushURL()
Returns the URL that bidirectional ("push") client-server communication should use.int
getWebComponentDisconnect()
Returns the number of seconds that a WebComponent will wait for a reconnect before removing the server-side component from memory.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.boolean
isProductionMode()
Returns whether Vaadin is in production mode.boolean
isRequestTiming()
Returns whether the server provides timing info to the client.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.boolean
isSyncIdCheckEnabled()
Returns whether sync id checking is enabled.boolean
isXsrfProtectionEnabled()
Returns whether cross-site request forgery protection is enabled.boolean
useV14Bootstrap()
Returns whether Vaadin is running in useDeprecatedV14Bootstrapping.-
Methods inherited from class com.vaadin.flow.server.PropertyDeploymentConfiguration
enableDevServer, getApplicationProperty, getBuildFolder, getFlowResourcesFolder, getInitParameters, getJavaResourceFolder, getParentConfiguration, getSystemProperty, isDevModeLiveReloadEnabled, isDevToolsEnabled, isGlobalPnpm, isOwnProperty, isPnpmEnabled, isUsageStatisticsEnabled, reuseDevServer
-
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, isBrotli, isEagerServerLoad, isStatsExternal
-
-
-
-
Field Detail
-
NOT_PRODUCTION_MODE_INFO
public static final String NOT_PRODUCTION_MODE_INFO
- See Also:
- Constant Field Values
-
NOT_PRODUCTION_MODE_WARNING
public static final String NOT_PRODUCTION_MODE_WARNING
- See Also:
- Constant Field Values
-
WARNING_V14_BOOTSTRAP
public static final String WARNING_V14_BOOTSTRAP
- See Also:
- Constant Field Values
-
WARNING_XSRF_PROTECTION_DISABLED
public static final String WARNING_XSRF_PROTECTION_DISABLED
- See Also:
- Constant Field Values
-
WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC
public static final String WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC
- See Also:
- Constant Field Values
-
WARNING_PUSH_MODE_NOT_RECOGNIZED
public static final String WARNING_PUSH_MODE_NOT_RECOGNIZED
- See Also:
- Constant Field Values
-
DEFAULT_HEARTBEAT_INTERVAL
public static final int DEFAULT_HEARTBEAT_INTERVAL
Default value forgetHeartbeatInterval()
= 300 .- See Also:
- Constant Field Values
-
DEFAULT_MAX_MESSAGE_SUSPEND_TIMEOUT
public static final int DEFAULT_MAX_MESSAGE_SUSPEND_TIMEOUT
Default value forgetMaxMessageSuspendTimeout()
()} = 5000 .- See Also:
- Constant Field Values
-
DEFAULT_WEB_COMPONENT_DISCONNECT
public static final int DEFAULT_WEB_COMPONENT_DISCONNECT
Default value forgetWebComponentDisconnect()
= 300.- See Also:
- Constant Field Values
-
DEFAULT_CLOSE_IDLE_SESSIONS
public static final boolean DEFAULT_CLOSE_IDLE_SESSIONS
Default value forisCloseIdleSessions()
= false .- See Also:
- Constant Field Values
-
DEFAULT_SYNC_ID_CHECK
public static final boolean DEFAULT_SYNC_ID_CHECK
Default value forisSyncIdCheckEnabled()
= true .- See Also:
- Constant Field Values
-
DEFAULT_SEND_URLS_AS_PARAMETERS
public static final boolean DEFAULT_SEND_URLS_AS_PARAMETERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultDeploymentConfiguration
public DefaultDeploymentConfiguration(ApplicationConfiguration parentConfig, Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new 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
-
isProductionMode
public boolean isProductionMode()
Returns whether Vaadin is in production mode.The default is false.
- Specified by:
isProductionMode
in interfaceAbstractConfiguration
- Overrides:
isProductionMode
in classPropertyDeploymentConfiguration
- Returns:
- true if in production mode, false otherwise.
-
useV14Bootstrap
public boolean useV14Bootstrap()
Returns whether Vaadin is running in useDeprecatedV14Bootstrapping. The default is true.- Specified by:
useV14Bootstrap
in interfaceAbstractConfiguration
- Overrides:
useV14Bootstrap
in classPropertyDeploymentConfiguration
- Returns:
- true if in useDeprecatedV14Bootstrapping, false otherwise.
-
isRequestTiming
public boolean isRequestTiming()
Returns whether the server provides timing info to the client.The default is
true
when not in production andfalse
when in production mode.- Specified by:
isRequestTiming
in interfaceDeploymentConfiguration
- Overrides:
isRequestTiming
in classPropertyDeploymentConfiguration
- Returns:
- true if timing info is provided, false otherwise.
-
isXsrfProtectionEnabled
public boolean isXsrfProtectionEnabled()
Returns whether cross-site request forgery protection is enabled.The default is true.
- Specified by:
isXsrfProtectionEnabled
in interfaceAbstractConfiguration
- Overrides:
isXsrfProtectionEnabled
in classPropertyDeploymentConfiguration
- Returns:
- true if XSRF protection is enabled, false otherwise.
-
getHeartbeatInterval
public int getHeartbeatInterval()
Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.The default interval is 300 seconds (5 minutes).
- Specified by:
getHeartbeatInterval
in interfaceDeploymentConfiguration
- Overrides:
getHeartbeatInterval
in classPropertyDeploymentConfiguration
- Returns:
- The time between heartbeats.
-
getMaxMessageSuspendTimeout
public 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.The default max message suspension time is 5000 milliseconds.
- Specified by:
getMaxMessageSuspendTimeout
in interfaceDeploymentConfiguration
- Overrides:
getMaxMessageSuspendTimeout
in classPropertyDeploymentConfiguration
- Returns:
- The maximum message suspension timeout
-
getWebComponentDisconnect
public int getWebComponentDisconnect()
Description copied from interface:DeploymentConfiguration
Returns the number of seconds that a WebComponent will wait for a reconnect before removing the server-side component from memory.- Specified by:
getWebComponentDisconnect
in interfaceDeploymentConfiguration
- Overrides:
getWebComponentDisconnect
in classPropertyDeploymentConfiguration
- Returns:
- time to wait after a disconnect has happened
-
isCloseIdleSessions
public 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.The default value is false.
- Specified by:
isCloseIdleSessions
in interfaceDeploymentConfiguration
- Overrides:
isCloseIdleSessions
in classPropertyDeploymentConfiguration
- 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()
-
isSyncIdCheckEnabled
public 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.The default value is
true
.- Specified by:
isSyncIdCheckEnabled
in interfaceDeploymentConfiguration
- Overrides:
isSyncIdCheckEnabled
in classPropertyDeploymentConfiguration
- Returns:
true
if sync id checking is enabled;false
otherwise
-
isSendUrlsAsParameters
public 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.The default value is
true
.- Specified by:
isSendUrlsAsParameters
in interfaceDeploymentConfiguration
- Overrides:
isSendUrlsAsParameters
in classPropertyDeploymentConfiguration
- Returns:
false
if set to false ortrue
otherwise
-
getPushMode
public PushMode getPushMode()
Returns the mode of bidirectional ("push") client-server communication that should be used.The default mode is
PushMode.DISABLED
.- Specified by:
getPushMode
in interfaceDeploymentConfiguration
- Overrides:
getPushMode
in classPropertyDeploymentConfiguration
- Returns:
- The push mode in use.
-
getPushURL
public String getPushURL()
Returns the URL that bidirectional ("push") client-server communication should use.The default mode is
""
which uses the servlet URL.- Specified by:
getPushURL
in interfaceDeploymentConfiguration
- Overrides:
getPushURL
in classPropertyDeploymentConfiguration
- Returns:
- The push URL to use
-
-