summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/PushConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/PushConfiguration.java')
-rw-r--r--server/src/com/vaadin/ui/PushConfiguration.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/PushConfiguration.java b/server/src/com/vaadin/ui/PushConfiguration.java
index 90ad28542c..22941ea5ae 100644
--- a/server/src/com/vaadin/ui/PushConfiguration.java
+++ b/server/src/com/vaadin/ui/PushConfiguration.java
@@ -139,6 +139,33 @@ public interface PushConfiguration extends Serializable {
*/
public void setParameter(String parameter, String value);
+ /**
+ * Sets whether to force the use of XHR when sending data from the client to
+ * the server.
+ *
+ * This settings currently only has effect when using websockets, which by
+ * default send client to server requests through the websockets channel. If
+ * you need to support cookies, HTTP auth or similar features not available
+ * in websockets communication you can set this to true.
+ *
+ * @since 7.6
+ * @param alwaysUseXhrForServerRequests
+ * true to always use XHR for server requests, false otherwise
+ */
+ public void setAlwaysUseXhrForServerRequests(
+ boolean alwaysUseXhrForServerRequests);
+
+ /**
+ * Checks whether to force the use of XHR when sending data from the client
+ * to the server.
+ *
+ * @see #setAlwaysUseXhrForServerRequests(boolean)
+ *
+ * @since 7.6
+ * @return true to always use XHR for server requests, false otherwise
+ */
+ public boolean isAlwaysUseXhrForServerRequests();
+
}
class PushConfigurationImpl implements PushConfiguration {
@@ -291,4 +318,14 @@ class PushConfigurationImpl implements PushConfiguration {
.keySet());
}
+ @Override
+ public void setAlwaysUseXhrForServerRequests(
+ boolean alwaysUseXhrForServerRequests) {
+ getState().alwaysUseXhrForServerRequests = alwaysUseXhrForServerRequests;
+ }
+
+ @Override
+ public boolean isAlwaysUseXhrForServerRequests() {
+ return getState(false).alwaysUseXhrForServerRequests;
+ }
}