Class DefaultDeploymentConfiguration

All Implemented Interfaces:
DeploymentConfiguration, AbstractConfiguration, Serializable

public class DefaultDeploymentConfiguration extends PropertyDeploymentConfiguration
The default implementation of DeploymentConfiguration based on a base class for resolving system properties and a set of init parameters.
Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Field Details

  • Constructor Details

    • DefaultDeploymentConfiguration

      public DefaultDeploymentConfiguration(ApplicationConfiguration parentConfig, Class<?> systemPropertyBaseClass, Properties initParameters)
      Create a new deployment configuration instance.
      Parameters:
      parentConfig - a parent application configuration
      systemPropertyBaseClass - the class that should be used as a basis when reading system properties
      initParameters - the init parameters that should make up the foundation for this configuration
      Since:
      6.0
  • Method Details

    • isProductionMode

      public boolean isProductionMode()
      Returns whether Vaadin is in production mode.

      The default is false.

      Specified by:
      isProductionMode in interface AbstractConfiguration
      Overrides:
      isProductionMode in class PropertyDeploymentConfiguration
      Returns:
      true if in production mode, false otherwise.
    • isRequestTiming

      public boolean isRequestTiming()
      Returns whether the server provides timing info to the client.

      The default is true when not in production and false when in production mode.

      Specified by:
      isRequestTiming in interface DeploymentConfiguration
      Overrides:
      isRequestTiming in class PropertyDeploymentConfiguration
      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 interface AbstractConfiguration
      Overrides:
      isXsrfProtectionEnabled in class PropertyDeploymentConfiguration
      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 interface DeploymentConfiguration
      Overrides:
      getHeartbeatInterval in class PropertyDeploymentConfiguration
      Returns:
      The time between heartbeats.
    • getMaxRequestBodySize

      public long getMaxRequestBodySize()
      Returns the maximum size, in characters, that Flow reads from a client-to-server UIDL/RPC or push request body before rejecting the request with HTTP 413 (Request Entity Too Large).

      The limit does not apply to file uploads, which are streamed in chunks and have their own separate size limits.

      The default is 10 MB.

      Specified by:
      getMaxRequestBodySize in interface DeploymentConfiguration
      Overrides:
      getMaxRequestBodySize in class PropertyDeploymentConfiguration
      Returns:
      the maximum request body size in characters, or a negative number if the limit is disabled
      Since:
      25.2.2
    • 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 interface DeploymentConfiguration
      Overrides:
      getMaxMessageSuspendTimeout in class PropertyDeploymentConfiguration
      Returns:
      The maximum message suspension timeout
      Since:
      3.0.1
    • 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 interface DeploymentConfiguration
      Overrides:
      getWebComponentDisconnect in class PropertyDeploymentConfiguration
      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 is true, the session is eventually closed if the open UIs do not have any user interaction.

      The default value is false.

      Specified by:
      isCloseIdleSessions in interface DeploymentConfiguration
      Overrides:
      isCloseIdleSessions in class PropertyDeploymentConfiguration
      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:
    • 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 interface DeploymentConfiguration
      Overrides:
      isSyncIdCheckEnabled in class PropertyDeploymentConfiguration
      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-type application/x-www-form-urlencoded is enabled or not.

      The default value is true.

      Specified by:
      isSendUrlsAsParameters in interface DeploymentConfiguration
      Overrides:
      isSendUrlsAsParameters in class PropertyDeploymentConfiguration
      Returns:
      false if set to false or true 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 interface DeploymentConfiguration
      Overrides:
      getPushMode in class PropertyDeploymentConfiguration
      Returns:
      The push mode in use.
    • getPushServletMapping

      public String getPushServletMapping()
      Returns the servlet mapping that bidirectional ("push") client-server communication should use.

      The default mode is "" which uses the service mapping.

      Returns:
      The push servlet mapping to use
      Since:
      23.3.5
    • getSessionLockCheckStrategy

      public SessionLockCheckStrategy getSessionLockCheckStrategy()
      Description copied from interface: DeploymentConfiguration
      Returns the strategy for Vaadin session lock checking in production mode. Ignored in development mode. By default, it returns SessionLockCheckStrategy.ASSERT.
      Specified by:
      getSessionLockCheckStrategy in interface DeploymentConfiguration
      Overrides:
      getSessionLockCheckStrategy in class PropertyDeploymentConfiguration
      Returns:
      the lock checking strategy, never null.
    • getCspMode

      public CspMode getCspMode()
      Description copied from interface: DeploymentConfiguration
      Returns the Content Security Policy mode of the application, which tells whether the application is meant to run under a strict, nonce-based policy.

      The mode can be configured with the InitParameters.CSP configuration parameter. By default, it returns CspMode.OFF.

      See CspMode for what each mode does.

      Returns:
      the Content Security Policy mode, never null
    • getMode

      public Mode getMode()
      Description copied from interface: AbstractConfiguration
      Gets the mode the application is running in.
      Returns:
      custom production bundle, pre-compiled production bundle, development using livereload or development using bundle