Package com.vaadin.server
Class DefaultDeploymentConfiguration
- java.lang.Object
-
- com.vaadin.server.AbstractDeploymentConfiguration
-
- com.vaadin.server.DefaultDeploymentConfiguration
-
- All Implemented Interfaces:
DeploymentConfiguration
,Serializable
public class DefaultDeploymentConfiguration extends AbstractDeploymentConfiguration
The default implementation ofDeploymentConfiguration
based on a base class for resolving system properties and a set of init parameters.- Since:
- 7.0.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.DeploymentConfiguration
DeploymentConfiguration.LegacyProperyToStringMode
-
-
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 DeploymentConfiguration.LegacyProperyToStringMode
DEFAULT_LEGACY_PROPERTY_TO_STRING
Default value forgetLegacyPropertyToStringMode()
=DeploymentConfiguration.LegacyProperyToStringMode.WARNING
.static int
DEFAULT_RESOURCE_CACHE_TIME
Default value forgetResourceCacheTime()
= 3600 .static boolean
DEFAULT_SEND_URLS_AS_PARAMETERS
static boolean
DEFAULT_SYNC_ID_CHECK
Default value forisSyncIdCheckEnabled()
= true .
-
Constructor Summary
Constructors Constructor Description DefaultDeploymentConfiguration(Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new deployment configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getApplicationOrSystemProperty(String propertyName, String defaultValue)
Gets a configured property.String
getApplicationProperty(String parameterName)
Gets an application property value.int
getHeartbeatInterval()
Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.Properties
getInitParameters()
Gets the properties configured for the deployment, e.g.DeploymentConfiguration.LegacyProperyToStringMode
getLegacyPropertyToStringMode()
Deprecated.PushMode
getPushMode()
Returns the mode of bidirectional ("push") client-server communication that should be used.int
getResourceCacheTime()
Returns the time resources can be cached in the browsers, in seconds.protected String
getSystemProperty(String parameterName)
Gets an system property value.boolean
isCloseIdleSessions()
Returns whether a 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
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.-
Methods inherited from class com.vaadin.server.AbstractDeploymentConfiguration
getClassLoaderName, getResourcesPath, getUIClassName, getUIProviderClassName, getWidgetset
-
-
-
-
Field Detail
-
DEFAULT_RESOURCE_CACHE_TIME
public static final int DEFAULT_RESOURCE_CACHE_TIME
Default value forgetResourceCacheTime()
= 3600 .- 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_CLOSE_IDLE_SESSIONS
public static final boolean DEFAULT_CLOSE_IDLE_SESSIONS
Default value forisCloseIdleSessions()
= false .- See Also:
- Constant Field Values
-
DEFAULT_LEGACY_PROPERTY_TO_STRING
public static final DeploymentConfiguration.LegacyProperyToStringMode DEFAULT_LEGACY_PROPERTY_TO_STRING
Default value forgetLegacyPropertyToStringMode()
=DeploymentConfiguration.LegacyProperyToStringMode.WARNING
.
-
DEFAULT_SYNC_ID_CHECK
public static final boolean DEFAULT_SYNC_ID_CHECK
Default value forisSyncIdCheckEnabled()
= true .- Since:
- 7.3
- 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(Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new deployment configuration instance.- Parameters:
systemPropertyBaseClass
- 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
-
getApplicationOrSystemProperty
public String getApplicationOrSystemProperty(String propertyName, String defaultValue)
Description copied from interface:DeploymentConfiguration
Gets a configured property. The properties are typically read from e.g. web.xml or from system properties of the JVM.- 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
-
getSystemProperty
protected String getSystemProperty(String parameterName)
Gets an system property value.- 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.- Parameters:
parameterName
- the Name or the parameter.- Returns:
- String value or null if not found
-
isProductionMode
public boolean isProductionMode()
Returns whether Vaadin is in production mode. The default is false.- Returns:
- true if in production mode, false otherwise.
-
isXsrfProtectionEnabled
public boolean isXsrfProtectionEnabled()
Returns whether cross-site request forgery protection is enabled.The default is true.
- Returns:
- true if XSRF protection is enabled, false otherwise.
-
getResourceCacheTime
public int getResourceCacheTime()
Returns the time resources can be cached in the browsers, in seconds.The default interval is 3600 seconds (1 hour).
- Returns:
- The resource cache time.
-
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).
- Returns:
- The time between heartbeats.
-
isCloseIdleSessions
public boolean isCloseIdleSessions()
Returns whether a 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.
- Returns:
- True if UIs and 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
.- 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
.- 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
.- Returns:
- The push mode in use.
-
getInitParameters
public Properties getInitParameters()
Description copied from interface:DeploymentConfiguration
Gets the properties configured for the deployment, e.g. as init parameters to the servlet or portlet.- Returns:
- properties for the application.
-
getLegacyPropertyToStringMode
@Deprecated public DeploymentConfiguration.LegacyProperyToStringMode getLegacyPropertyToStringMode()
Deprecated.Description copied from interface:DeploymentConfiguration
Returns to legacy Property.toString() mode used. SeeAbstractProperty#isLegacyToStringEnabled()
for more information.- Returns:
- The Property.toString() mode in use.
-
-