camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Support replay push topics in API version 37.0
Date Tue, 21 Jun 2016 06:43:27 GMT
Repository: camel
Updated Branches:
  refs/heads/master 615bc2355 -> 6c36d9000


Support replay push topics in API version 37.0

Signed-off-by: Sune Keller <absukl@almbrand.dk>


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6c36d900
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6c36d900
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6c36d900

Branch: refs/heads/master
Commit: 6c36d9000b5234a606f00e7957cc65b2acbe2495
Parents: 68254a0
Author: Sune Keller <absukl@almbrand.dk>
Authored: Fri Jun 17 13:31:47 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Jun 21 08:40:03 2016 +0200

----------------------------------------------------------------------
 .../camel/component/salesforce/api/dto/SObject.java |  9 +++++++++
 .../internal/streaming/SubscriptionHelper.java      | 16 +++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6c36d900/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObject.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObject.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObject.java
index d390595..2fb7f3f 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObject.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObject.java
@@ -43,6 +43,7 @@ public class SObject extends AbstractDTOBase {
     private Boolean undeletable;
     private Boolean triggerable;
     private Boolean compactLayoutable;
+    private Boolean mruEnabled;
 
     public String getName() {
         return name;
@@ -243,4 +244,12 @@ public class SObject extends AbstractDTOBase {
     public void setCompactLayoutable(Boolean compactLayoutable) {
         this.compactLayoutable = compactLayoutable;
     }
+
+    public Boolean getMruEnabled() {
+        return mruEnabled;
+    }
+
+    public void setMruEnabled(Boolean mruEnabled) {
+        this.mruEnabled = mruEnabled;
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/6c36d900/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
index befd168..a501187 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
@@ -60,8 +60,6 @@ public class SubscriptionHelper extends ServiceSupport {
 
     private static final String EXCEPTION_FIELD = "exception";
 
-    private static final double MINIMUM_REPLAY_VERSION = 36.0;
-
     private final SalesforceComponent component;
     private final SalesforceSession session;
     private final BayeuxClient client;
@@ -373,12 +371,16 @@ public class SubscriptionHelper extends ServiceSupport {
     }
 
     public String getEndpointUrl() {
-        if (Double.valueOf(component.getConfig().getApiVersion()) >= MINIMUM_REPLAY_VERSION
-            && (component.getConfig().getDefaultReplayId() != null || !component.getConfig().getInitialReplayIdMap().isEmpty()))
{
-            return component.getSession().getInstanceUrl() + "/cometd/replay/" + component.getConfig().getApiVersion();
-        } else {
-            return component.getSession().getInstanceUrl() + "/cometd/" + component.getConfig().getApiVersion();
+        // In version 36.0 replay is only enabled on a separate endpoint
+        if (Double.valueOf(component.getConfig().getApiVersion()) == 36.0) {
+            boolean replayOptionsPresent = component.getConfig().getDefaultReplayId() !=
null
+                    || !component.getConfig().getInitialReplayIdMap().isEmpty();
+            if (replayOptionsPresent) {
+                return component.getSession().getInstanceUrl() + "/cometd/replay/"
+                        + component.getConfig().getApiVersion();
+            }
         }
+        return component.getSession().getInstanceUrl() + "/cometd/" + component.getConfig().getApiVersion();
     }
 
 }


Mime
View raw message