Class PushConfigurationMap
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeature
-
- com.vaadin.flow.internal.nodefeature.NodeMap
-
- com.vaadin.flow.internal.nodefeature.PushConfigurationMap
-
- All Implemented Interfaces:
PushConfiguration,Serializable
public class PushConfigurationMap extends NodeMap implements PushConfiguration
Map for storing the push configuration for a UI.For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPushConfigurationMap.PushConfigurationParametersMapMap for storing push parameters.
-
Field Summary
Fields Modifier and Type Field Description static StringALWAYS_USE_XHR_TO_SERVERstatic StringFALLBACK_TRANSPORT_KEYstatic StringPARAMETERS_KEYstatic StringPUSH_SERVLET_MAPPING_KEYstatic StringPUSHMODE_KEYstatic StringTRANSPORT_KEY
-
Constructor Summary
Constructors Constructor Description PushConfigurationMap(StateNode node)Creates a new map for the given node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransportgetFallbackTransport()Returns the fallback transport type for push.StringgetParameter(String key)Returns the given parameter, if set.Collection<String>getParameterNames()Returns the parameters which have been defined.PushModegetPushMode()Returns the mode of bidirectional ("push") communication that is used.StringgetPushServletMapping()Returns the servlet mapping to use for push requests.TransportgetTransport()Returns the primary transport type for push.voidsetFallbackTransport(Transport fallbackTransport)Sets the fallback transport type for push.voidsetParameter(String key, String value)Sets the given parameter.voidsetPushConnectionFactory(PushConnectionFactory factory)Sets the factory that will be used to create new instances ofPushConnection.voidsetPushMode(PushMode pushMode)Sets the mode of bidirectional ("push") communication that should be used.voidsetPushServletMapping(String pushServletMapping)Sets the servlet mapping to use for push requests.voidsetTransport(Transport transport)Sets the primary transport type for push.-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeMap
clear, collectChanges, contains, forEachChild, generateChangesFromEmpty, get, getOrDefault, getOrDefault, getOrDefault, keySet, mayUpdateFromClient, producePutChange, put, put, remove, updateFromClient
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
-
-
-
Field Detail
-
TRANSPORT_KEY
public static final String TRANSPORT_KEY
- See Also:
- Constant Field Values
-
FALLBACK_TRANSPORT_KEY
public static final String FALLBACK_TRANSPORT_KEY
- See Also:
- Constant Field Values
-
PUSH_SERVLET_MAPPING_KEY
public static final String PUSH_SERVLET_MAPPING_KEY
- See Also:
- Constant Field Values
-
PUSHMODE_KEY
public static final String PUSHMODE_KEY
- See Also:
- Constant Field Values
-
ALWAYS_USE_XHR_TO_SERVER
public static final String ALWAYS_USE_XHR_TO_SERVER
- See Also:
- Constant Field Values
-
PARAMETERS_KEY
public static final String PARAMETERS_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PushConfigurationMap
public PushConfigurationMap(StateNode node)
Creates a new map for the given node.- Parameters:
node- the node that the map belongs to
-
-
Method Detail
-
setTransport
public void setTransport(Transport transport)
Description copied from interface:PushConfigurationSets the primary transport type for push.Note that the new transport type will not be used until the push channel is disconnected and reconnected if already active.
- Specified by:
setTransportin interfacePushConfiguration- Parameters:
transport- The primary transport type
-
getTransport
public Transport getTransport()
Description copied from interface:PushConfigurationReturns the primary transport type for push.Note that if you set the transport type using
PushConfiguration.setParameter(String, String)to an unsupported type this method will return null. Supported types are defined byTransport.- Specified by:
getTransportin interfacePushConfiguration- Returns:
- The primary transport type
-
setFallbackTransport
public void setFallbackTransport(Transport fallbackTransport)
Description copied from interface:PushConfigurationSets the fallback transport type for push.Note that the new transport type will not be used until the push channel is disconnected and reconnected if already active.
- Specified by:
setFallbackTransportin interfacePushConfiguration- Parameters:
fallbackTransport- The fallback transport type
-
getFallbackTransport
public Transport getFallbackTransport()
Description copied from interface:PushConfigurationReturns the fallback transport type for push.Note that if you set the transport type using
PushConfiguration.setParameter(String, String)to an unsupported type this method will return null. Supported types are defined byTransport.- Specified by:
getFallbackTransportin interfacePushConfiguration- Returns:
- The fallback transport type
-
setPushServletMapping
public void setPushServletMapping(String pushServletMapping)
Description copied from interface:PushConfigurationSets the servlet mapping to use for push requests.This is only used when overriding the servlet mapping to use. Setting this to null (the default) will use the default URL.
- Specified by:
setPushServletMappingin interfacePushConfiguration- Parameters:
pushServletMapping- The servlet mapping to use for push
-
getPushServletMapping
public String getPushServletMapping()
Description copied from interface:PushConfigurationReturns the servlet mapping to use for push requests.This is only used when overriding the servlet mapping to use. Returns null (the default) when the default URL is used.
- Specified by:
getPushServletMappingin interfacePushConfiguration- Returns:
- the servlet mapping to use for push requests, or null to use to default
-
setPushMode
public void setPushMode(PushMode pushMode)
Description copied from interface:PushConfigurationSets the mode of bidirectional ("push") communication that should be used.Add-on developers should note that this method is only meant for the application developer. An add-on should not set the push mode directly, rather instruct the user to set it.
- Specified by:
setPushModein interfacePushConfiguration- Parameters:
pushMode- The push mode to use.
-
getPushMode
public PushMode getPushMode()
Description copied from interface:PushConfigurationReturns the mode of bidirectional ("push") communication that is used.- Specified by:
getPushModein interfacePushConfiguration- Returns:
- The push mode.
-
getParameter
public String getParameter(String key)
Description copied from interface:PushConfigurationReturns the given parameter, if set.This method provides low level access to push parameters and is typically not needed for normal application development.
- Specified by:
getParameterin interfacePushConfiguration- Parameters:
key- The parameter name- Returns:
- The parameter value or null if not set
-
setParameter
public void setParameter(String key, String value)
Description copied from interface:PushConfigurationSets the given parameter.This method provides low level access to push parameters and is typically not needed for normal application development.
- Specified by:
setParameterin interfacePushConfiguration- Parameters:
key- The parameter namevalue- The value
-
getParameterNames
public Collection<String> getParameterNames()
Description copied from interface:PushConfigurationReturns the parameters which have been defined.- Specified by:
getParameterNamesin interfacePushConfiguration- Returns:
- A collection of parameter names
-
setPushConnectionFactory
public void setPushConnectionFactory(PushConnectionFactory factory)
Description copied from interface:PushConfigurationSets the factory that will be used to create new instances ofPushConnection.- Specified by:
setPushConnectionFactoryin interfacePushConfiguration- Parameters:
factory- the factory that will be used to create new instances ofPushConnection
-
-