com.vaadin.flow.function.
Interface DeploymentConfiguration
-
All Superinterfaces:
All Known Implementing Classes:
AbstractDeploymentConfiguration, DefaultDeploymentConfiguration
public interface DeploymentConfiguration extends Serializable
A collection of properties configured at deploy time as well as a way of accessing third party properties not explicitly supported by this class.
Since:
1.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method and Description default boolean
areWebJarsEnabled()
Determines if webJars mechanism is enabled.
default boolean
disableAutomaticServletRegistration()
Determines if Flow should automatically register servlets.
<T> T
getApplicationOrSystemProperty(String propertyName, T defaultValue, Function<String,T> converter)
Gets a configured property.
default boolean
getBooleanProperty(String propertyName, boolean defaultValue)
A shorthand of
getApplicationOrSystemProperty(String, Object, Function)
forString
type.String
getClassLoaderName()
Gets class loader configuration option value.
default String
getDevelopmentFrontendPrefix()
Gets the URL from which frontend resources should be loaded during development, unless explicitly configured to use the production es6 and es5 URLs.
default String
getEs5FrontendPrefix()
Gets the URL from which frontend resources should be loaded in ES5 compatible browsers.
default String
getEs6FrontendPrefix()
Gets the URL from which frontend resources should be loaded in ES6 compatible browsers.
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.
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.
default String
getStringProperty(String propertyName, String defaultValue)
A shorthand of
getApplicationOrSystemProperty(String, Object, Function)
forString
type.String
getUIClassName()
Gets UI class configuration option 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
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-type
application/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.
default boolean
useCompiledFrontendResources()
Determines if Flow should use compiled or original frontend resources.
-
-
-
Method Detail
-
isProductionMode
boolean isProductionMode()
Returns whether Vaadin is in production mode.
Returns:
true if in production mode, false otherwise.
-
isRequestTiming
boolean isRequestTiming()
Returns whether the server provides timing info to the client.
Returns:
true if timing info is provided, false otherwise.
-
isXsrfProtectionEnabled
boolean isXsrfProtectionEnabled()
Returns whether cross-site request forgery protection is enabled.
Returns:
true if XSRF protection is enabled, 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.
-
isSendUrlsAsParameters
boolean isSendUrlsAsParameters()
Returns whether the sending of URL's as GET and POST parameters in requests with content-type
application/x-www-form-urlencoded
is enabled or not.Returns:
false
if set to false ortrue
otherwise
-
isCloseIdleSessions
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.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:
-
getPushMode
PushMode getPushMode()
Returns the mode of bidirectional ("push") client-server communication that should be used.
Returns:
The push mode in use.
-
getPushURL
String getPushURL()
Returns the URL that bidirectional ("push") client-server communication should use.
Returns:
The push URL 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 propertyParameters:
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 propertyReturns:
the property value, or the passed default value if no property value is found
-
getStringProperty
default String getStringProperty(String propertyName, String defaultValue)
A shorthand of
getApplicationOrSystemProperty(String, Object, Function)
forString
type.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 definedReturns:
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 of
getApplicationOrSystemProperty(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.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 definedReturns:
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
-
getDevelopmentFrontendPrefix
default String getDevelopmentFrontendPrefix()
Gets the URL from which frontend resources should be loaded during development, unless explicitly configured to use the production es6 and es5 URLs.
Returns:
the development resource URL
-
getEs6FrontendPrefix
default String getEs6FrontendPrefix()
Gets the URL from which frontend resources should be loaded in ES6 compatible browsers.
Returns:
the ES6 resource URL
-
getEs5FrontendPrefix
default String getEs5FrontendPrefix()
Gets the URL from which frontend resources should be loaded in ES5 compatible browsers.
Returns:
the ES5 resource URL
-
areWebJarsEnabled
default boolean areWebJarsEnabled()
Determines if webJars mechanism is enabled. It is disabled if the user have explicitly set the
Constants.DISABLE_WEBJARS
property totrue
, or the user have not set the property at all and theuseCompiledFrontendResources()
returns false.Returns:
true
if webJars are enabled,false
otherwise
-
useCompiledFrontendResources
default boolean useCompiledFrontendResources()
Determines if Flow should use compiled or original frontend resources. User can explicitly disable bundled resources usage by setting the
Constants.USE_ORIGINAL_FRONTEND_RESOURCES
property totrue
.Returns:
true
if Flow should use compiled frontend resources.
-
disableAutomaticServletRegistration
default boolean disableAutomaticServletRegistration()
Determines if Flow should automatically register servlets. For more information on the servlets registered, refer to
ServletDeployer
javadoc. User can explicitly disable automatic servlet registration by setting theConstants.DISABLE_AUTOMATIC_SERVLET_REGISTRATION
property totrue
.Returns:
true
if Flow should not automatically register servletsSee Also:
-
-