camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: Corrections dot and single line
Date Wed, 16 Dec 2015 12:26:21 GMT
Corrections dot and single line 


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

Branch: refs/heads/master
Commit: 83eca0b3f0e97849437844e8f90ac075f6ee101e
Parents: 1cdcba1
Author: gautric <gautric@redhat.com>
Authored: Wed Dec 16 13:02:13 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Dec 16 13:25:40 2015 +0100

----------------------------------------------------------------------
 .../camel/component/paho/PahoConstants.java     |  4 ++--
 .../camel/component/paho/PahoProducer.java      | 20 ++------------------
 2 files changed, 4 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/83eca0b3/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
index 7108a12..e7ecf90 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConstants.java
@@ -31,8 +31,8 @@ public final class PahoConstants {
     @Deprecated
     public static final String HEADER_ORIGINAL_MESSAGE = "PahoOriginalMessage";
     public static final String CAMEL_PAHO = "CamelPaho";
-    public static final String CAMEL_PAHO_MSG_QOS = CAMEL_PAHO + ".qos";
-    public static final String CAMEL_PAHO_MSG_RETAINED = CAMEL_PAHO + ".retained";
+    public static final String CAMEL_PAHO_MSG_QOS = CAMEL_PAHO + "Qos";
+    public static final String CAMEL_PAHO_MSG_RETAINED = CAMEL_PAHO + "Retained";
 
 
     private PahoConstants() {

http://git-wip-us.apache.org/repos/asf/camel/blob/83eca0b3/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java
index 99265d2..cdd360a 100644
--- a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java
+++ b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoProducer.java
@@ -27,29 +27,13 @@ public class PahoProducer extends DefaultProducer {
         super(endpoint);
     }
 
-    private int retrieveQos(Exchange exchange) {
-        if (exchange.getIn().getHeaders().containsKey(PahoConstants.CAMEL_PAHO_MSG_QOS))
{
-            return exchange.getIn().getHeader(PahoConstants.CAMEL_PAHO_MSG_QOS, Integer.class);
-        } else {
-            return getEndpoint().getQos();
-        }
-    }
-    
-    private boolean retrieveRetained(Exchange exchange) {
-        if (exchange.getIn().getHeaders().containsKey(PahoConstants.CAMEL_PAHO_MSG_RETAINED))
{
-            return exchange.getIn().getHeader(PahoConstants.CAMEL_PAHO_MSG_RETAINED, Boolean.class);
-        } else {
-            return getEndpoint().isRetained();
-        }
-    }
-
     @Override
     public void process(Exchange exchange) throws Exception {
         MqttClient client = getEndpoint().getClient();
         String topic = getEndpoint().getTopic();
         
-        int qos = retrieveQos(exchange);
-        boolean retained = retrieveRetained(exchange);
+        int qos = exchange.getIn().getHeader(PahoConstants.CAMEL_PAHO_MSG_QOS, getEndpoint().getQos(),
Integer.class);
+        boolean retained = exchange.getIn().getHeader(PahoConstants.CAMEL_PAHO_MSG_RETAINED,
getEndpoint().isRetained(), Boolean.class);
         
         byte[] payload = exchange.getIn().getBody(byte[].class);
 


Mime
View raw message