com.vaadin.flow.function.

Interface DeploymentConfiguration

    • Method Detail

      • isProductionMode

        boolean isProductionMode()

        Returns whether Vaadin is in production mode.

        Returns:

        true if in production mode, false otherwise.

      • isBowerMode

        @Deprecated
        boolean isBowerMode()

        Deprecated. Bower WebJars are being deprecated, so compatibility mode should no longer be used and will be removed in near future.

        Returns whether Vaadin is running in Vaadin 13 compatibility mode. NOTE: Compatibility mode is no longer supported by Flow since version 2.11. This method will throw a runtime exception when invoked.

        Returns:

        true if in compatibility mode, false otherwise.

      • isCompatibilityMode

        @Deprecated
        default boolean isCompatibilityMode()

        Deprecated. Bower WebJars are being deprecated, so compatibility mode should no longer be used and will be removed in near future.

        Returns whether Vaadin is running in Vaadin 13 compatibility mode. This method is deprecated as of version 2.11. This method will throw a runtime exception when invoked.

        Returns:

        true if in compatibility 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.

      • 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-type application/x-www-form-urlencoded is enabled or not.

        Returns:

        false if set to false or true 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 is true, 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:

        WrappedSession.getMaxInactiveInterval()

      • 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 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 defined

        converter - 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

      • getStringProperty

        default String getStringProperty(String propertyName,
                                         String defaultValue)

        A shorthand of getApplicationOrSystemProperty(String, Object, Function) for String 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 defined

        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 of getApplicationOrSystemProperty(String, Object, Function) for String type. Considers "" to be equal true 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 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

      • 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

      • getNpmFrontendPrefix

        default String getNpmFrontendPrefix()

        Gets the URL from which frontend resources should be loaded in NPM mode.

        Returns:

        the NPM resource URL

      • areWebJarsEnabled

        default boolean areWebJarsEnabled()

        Determines if webJars mechanism is enabled. It is disabled if the user have explicitly set the InitParameters.DISABLE_WEBJARS property to true, or the user have not set the property at all and the useCompiledFrontendResources() 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 InitParameters.USE_ORIGINAL_FRONTEND_RESOURCES property to true.

        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 the InitParameters.DISABLE_AUTOMATIC_SERVLET_REGISTRATION property to true.

        Returns:

        true if Flow should not automatically register servlets

        See Also:

        ServletDeployer

      • 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

        default String getCompiledWebComponentsPath()
      • getPolyfills

        default List<String> 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 the InitParameters.SERVLET_PARAMETER_POLYFILLS as a comma separated list of JS files to load.

        Returns:

        polyfills to load

      • enableDevServer

        default boolean enableDevServer()

        Get if the dev server should be enabled. True by default

        Returns:

        true if dev server should be used

      • reuseDevServer

        default boolean reuseDevServer()

        Get if the dev server should be reused on each reload. True by default, set it to false in tests so as dev server is not kept as a daemon after the test.

        Returns:

        true if dev server should be reused

      • 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

        default String 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

      • isDevModeLiveReloadEnabled

        default boolean isDevModeLiveReloadEnabled()

        Checks if dev mode live reload is enabled or not.

        Returns:

        true if dev mode live reload is enabled, false otherwise

      • isPnpmEnabled

        default boolean isPnpmEnabled()

        Returns whether pnpm is enabled or not.

        Returns:

        true if enabled, false if not

        Since:

        2.2

      • isOldLicenseCheckerEnabled

        default boolean isOldLicenseCheckerEnabled()

        Returns whether server-side and offline license checking are enabled or not.

        New license checker is only available in npm mode with enabled live reload. Once compatibility/bower mode is used or live reload is disabled, the old license checker is used.

        Returns:

        true if old JavaScript license checker is used, false if new license checker enabled

        Since:

        2.8

      • isEnforcedFieldValidationEnabled

        default boolean isEnforcedFieldValidationEnabled()

        Whether the full experience validation is enforced for Flow components.

        The full experience validation integrates web component's own validation, server-side component's constraints and Binder validation into a seamless chain. By default, it's disabled, which means that components aren't validated on blur, for example.

        For more detailed information, please refer to: https://github.com/vaadin/platform/issues/3066#issuecomment-1598771284

        Returns:

        true if enabled, false otherwise.