Class PushUtil

java.lang.Object
com.vaadin.flow.internal.PushUtil

public final class PushUtil extends Object
Utility methods for server push.

For internal use only. May be renamed or removed in a future release.

Since:
25.4
  • Method Details

    • checkTransportEnabled

      public static void checkTransportEnabled(Transport transport, VaadinContext context)
      Checks that the given push transport can be used, i.e. that the feature flag guarding an experimental transport is enabled.
      Parameters:
      transport - the transport to check
      context - the context to read the feature flags from, or null if there is none, in which case an experimental transport is rejected
      Throws:
      DisabledFeatureException - if the transport is behind a feature flag that is not enabled
    • checkTransportEnabledAtStartup

      public static void checkTransportEnabledAtStartup(Transport transport, VaadinContext context, String annotationOwner)
      Checks at application startup that the transport of a static @Push annotation can be used, i.e. that the feature flag for the experimental server-sent events transport is enabled when that transport is selected.

      Unlike checkTransportEnabled(Transport, VaadinContext), the error only names the ways to enable the flag that work without a running application, since startup is aborted.

      Parameters:
      transport - the transport to check
      context - the context to read the feature flags from, or null if there is none, in which case an experimental transport is rejected
      annotationOwner - a description of where the @Push annotation is, used in the error message
      Throws:
      InvalidApplicationConfigurationException - if the transport is behind a feature flag that is not enabled