camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bibr...@apache.org
Subject git commit: Fixed typo in class name
Date Sat, 23 Nov 2013 15:47:11 GMT
Updated Branches:
  refs/heads/master e494f725b -> f21e2299b


Fixed typo in class name


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

Branch: refs/heads/master
Commit: f21e2299b1d3151bc2420fa44b881ee87d0a7378
Parents: e494f72
Author: Bilgin Ibryam <bibryam@apache.com>
Authored: Sat Nov 23 15:46:18 2013 +0000
Committer: Bilgin Ibryam <bibryam@apache.com>
Committed: Sat Nov 23 15:46:18 2013 +0000

----------------------------------------------------------------------
 .../common/message/DefaultCxfMessageMapper.java | 168 +++++++++++++++++++
 .../message/DefaultCxfMesssageMapper.java       | 168 -------------------
 .../cxf/transport/CamelDestination.java         |   4 +-
 .../message/DefaultCxfMessageMapperTest.java    |   2 +-
 .../component/cxf/cxfbean/CxfBeanEndpoint.java  |   4 +-
 5 files changed, 173 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f21e2299/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapper.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapper.java
b/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapper.java
new file mode 100644
index 0000000..4d4e266
--- /dev/null
+++ b/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapper.java
@@ -0,0 +1,168 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.cxf.common.message;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.HeaderFilterStrategy;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.message.Message;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @version 
+ */
+public class DefaultCxfMessageMapper implements CxfMessageMapper {
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultCxfMessageMapper.class);
+    private static final String CXF_HTTP_REQUEST = "HTTP.REQUEST";
+    private static final String CXF_HTTP_RESPONSE = "HTTP.RESPONSE";
+    
+    public Message createCxfMessageFromCamelExchange(Exchange camelExchange, 
+            HeaderFilterStrategy headerFilterStrategy) {
+        
+        org.apache.cxf.message.Message answer = 
+            CxfMessageHelper.getCxfInMessage(headerFilterStrategy, camelExchange, false);
+        
+        org.apache.camel.Message camelMessage = camelExchange.getIn();
+        String requestContentType = getRequestContentType(camelMessage); 
+        
+        String acceptContentTypes = camelMessage.getHeader("Accept", String.class);
+        if (acceptContentTypes == null) {
+            acceptContentTypes = "*/*";
+        }
+        
+        String enc = getCharacterEncoding(camelMessage);
+        String requestURI = getRequestURI(camelMessage);
+        String path = getPath(camelMessage);
+        String basePath = getBasePath(camelExchange);
+        String verb = getVerb(camelMessage);
+        String queryString = getQueryString(camelMessage);
+        
+        answer.put(org.apache.cxf.message.Message.REQUEST_URI, requestURI);
+        answer.put(org.apache.cxf.message.Message.BASE_PATH, basePath);
+        answer.put(org.apache.cxf.message.Message.HTTP_REQUEST_METHOD, verb);
+        answer.put(org.apache.cxf.message.Message.PATH_INFO, path);
+        answer.put(org.apache.cxf.message.Message.CONTENT_TYPE, requestContentType);
+        answer.put(org.apache.cxf.message.Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);
+        answer.put(org.apache.cxf.message.Message.ENCODING, enc);
+        answer.put(org.apache.cxf.message.Message.QUERY_STRING, queryString);
+        
+        Object request = camelMessage.getHeader(Exchange.HTTP_SERVLET_REQUEST);
+        answer.put(CXF_HTTP_REQUEST, request);
+        Object response = camelMessage.getHeader(Exchange.HTTP_SERVLET_RESPONSE);
+        answer.put(CXF_HTTP_RESPONSE, response);
+        // TODO propagate security context
+        
+        LOG.trace("Processing {}, requestContentType = {}, acceptContentTypes = {}, encoding
= {}, path = {}, basePath = {}, verb = {}",
+            new Object[]{camelExchange, requestContentType, acceptContentTypes, enc, path,
basePath, verb});
+
+        return answer;
+    }
+
+    public void propagateResponseHeadersToCamel(Message cxfMessage, Exchange exchange,
+                                                HeaderFilterStrategy strategy) {
+
+        LOG.trace("Propagating response headers from CXF message {}", cxfMessage);
+        
+        if (strategy == null) {
+            return;
+        }
+
+        Map<String, Object> camelHeaders = exchange.getOut().getHeaders();
+        // copy the in message header to out message
+        camelHeaders.putAll(exchange.getIn().getHeaders());
+        
+        Map<String, List<String>> cxfHeaders =
+            CastUtils.cast((Map<?, ?>)cxfMessage.get(Message.PROTOCOL_HEADERS));
+                      
+        if (cxfHeaders != null) {
+            for (Map.Entry<String, List<String>> entry : cxfHeaders.entrySet())
{
+                if (!strategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(),
exchange)) {
+                    camelHeaders.put(entry.getKey(), entry.getValue().get(0));
+                    
+                    LOG.trace("Populate header from CXF header={} value={}", entry.getKey(),
entry.getValue());
+                }
+            }
+        }
+
+        // propagate HTTP RESPONSE_CODE
+        String key = Message.RESPONSE_CODE;
+        Object value = cxfMessage.get(key);
+        if (value != null && !strategy.applyFilterToExternalHeaders(key, value, exchange))
{
+            camelHeaders.put(Exchange.HTTP_RESPONSE_CODE, value);
+            LOG.trace("Populate header from CXF header={} value={} as {}",
+                    new Object[]{key, value, Exchange.HTTP_RESPONSE_CODE}); 
+        }
+        
+        // propagate HTTP CONTENT_TYPE
+        if (cxfMessage.get(Message.CONTENT_TYPE) != null) {
+            camelHeaders.put(Exchange.CONTENT_TYPE, cxfMessage.get(Message.CONTENT_TYPE));
+        }
+    }
+
+    protected String getPath(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.HTTP_PATH, String.class);
+        return answer;
+    }
+    
+    protected String getRequestURI(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.HTTP_URI, String.class);
+        return answer;
+    }
+    
+    protected String getBasePath(Exchange camelExchange) {
+        String answer = camelExchange.getIn().getHeader(Exchange.HTTP_BASE_URI, String.class);
+
+        if (answer == null) {
+            answer = camelExchange.getFromEndpoint().getEndpointUri();
+        }
+        
+        return answer;
+    }
+
+    protected String getVerb(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.HTTP_METHOD, String.class);
+        return answer;
+    }
+    
+    protected String getQueryString(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.HTTP_QUERY, String.class);
+        return answer;
+    }
+
+    protected String getCharacterEncoding(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.HTTP_CHARACTER_ENCODING, String.class);
+        if (answer == null) {
+            answer = camelMessage.getHeader(Exchange.CHARSET_NAME, String.class);
+        }
+        return answer;
+    }
+
+    protected String getRequestContentType(org.apache.camel.Message camelMessage) {
+        String answer = camelMessage.getHeader(Exchange.CONTENT_TYPE, String.class);
+        if (answer != null) {
+            return answer;
+        }        
+        // return default
+        return "*/*";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f21e2299/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
b/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
deleted file mode 100644
index 77e5e20..0000000
--- a/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/DefaultCxfMesssageMapper.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.cxf.common.message;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.spi.HeaderFilterStrategy;
-import org.apache.cxf.helpers.CastUtils;
-import org.apache.cxf.message.Message;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @version 
- */
-public class DefaultCxfMesssageMapper implements CxfMessageMapper {
-    private static final Logger LOG = LoggerFactory.getLogger(DefaultCxfMesssageMapper.class);
-    private static final String CXF_HTTP_REQUEST = "HTTP.REQUEST";
-    private static final String CXF_HTTP_RESPONSE = "HTTP.RESPONSE";
-    
-    public Message createCxfMessageFromCamelExchange(Exchange camelExchange, 
-            HeaderFilterStrategy headerFilterStrategy) {
-        
-        org.apache.cxf.message.Message answer = 
-            CxfMessageHelper.getCxfInMessage(headerFilterStrategy, camelExchange, false);
-        
-        org.apache.camel.Message camelMessage = camelExchange.getIn();
-        String requestContentType = getRequestContentType(camelMessage); 
-        
-        String acceptContentTypes = camelMessage.getHeader("Accept", String.class);
-        if (acceptContentTypes == null) {
-            acceptContentTypes = "*/*";
-        }
-        
-        String enc = getCharacterEncoding(camelMessage);
-        String requestURI = getRequestURI(camelMessage);
-        String path = getPath(camelMessage);
-        String basePath = getBasePath(camelExchange);
-        String verb = getVerb(camelMessage);
-        String queryString = getQueryString(camelMessage);
-        
-        answer.put(org.apache.cxf.message.Message.REQUEST_URI, requestURI);
-        answer.put(org.apache.cxf.message.Message.BASE_PATH, basePath);
-        answer.put(org.apache.cxf.message.Message.HTTP_REQUEST_METHOD, verb);
-        answer.put(org.apache.cxf.message.Message.PATH_INFO, path);
-        answer.put(org.apache.cxf.message.Message.CONTENT_TYPE, requestContentType);
-        answer.put(org.apache.cxf.message.Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);
-        answer.put(org.apache.cxf.message.Message.ENCODING, enc);
-        answer.put(org.apache.cxf.message.Message.QUERY_STRING, queryString);
-        
-        Object request = camelMessage.getHeader(Exchange.HTTP_SERVLET_REQUEST);
-        answer.put(CXF_HTTP_REQUEST, request);
-        Object response = camelMessage.getHeader(Exchange.HTTP_SERVLET_RESPONSE);
-        answer.put(CXF_HTTP_RESPONSE, response);
-        // TODO propagate security context
-        
-        LOG.trace("Processing {}, requestContentType = {}, acceptContentTypes = {}, encoding
= {}, path = {}, basePath = {}, verb = {}",
-            new Object[]{camelExchange, requestContentType, acceptContentTypes, enc, path,
basePath, verb});
-
-        return answer;
-    }
-
-    public void propagateResponseHeadersToCamel(Message cxfMessage, Exchange exchange,
-                                                HeaderFilterStrategy strategy) {
-
-        LOG.trace("Propagating response headers from CXF message {}", cxfMessage);
-        
-        if (strategy == null) {
-            return;
-        }
-
-        Map<String, Object> camelHeaders = exchange.getOut().getHeaders();
-        // copy the in message header to out message
-        camelHeaders.putAll(exchange.getIn().getHeaders());
-        
-        Map<String, List<String>> cxfHeaders =
-            CastUtils.cast((Map<?, ?>)cxfMessage.get(Message.PROTOCOL_HEADERS));
-                      
-        if (cxfHeaders != null) {
-            for (Map.Entry<String, List<String>> entry : cxfHeaders.entrySet())
{
-                if (!strategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(),
exchange)) {
-                    camelHeaders.put(entry.getKey(), entry.getValue().get(0));
-                    
-                    LOG.trace("Populate header from CXF header={} value={}", entry.getKey(),
entry.getValue());
-                }
-            }
-        }
-
-        // propagate HTTP RESPONSE_CODE
-        String key = Message.RESPONSE_CODE;
-        Object value = cxfMessage.get(key);
-        if (value != null && !strategy.applyFilterToExternalHeaders(key, value, exchange))
{
-            camelHeaders.put(Exchange.HTTP_RESPONSE_CODE, value);
-            LOG.trace("Populate header from CXF header={} value={} as {}",
-                    new Object[]{key, value, Exchange.HTTP_RESPONSE_CODE}); 
-        }
-        
-        // propagate HTTP CONTENT_TYPE
-        if (cxfMessage.get(Message.CONTENT_TYPE) != null) {
-            camelHeaders.put(Exchange.CONTENT_TYPE, cxfMessage.get(Message.CONTENT_TYPE));
-        }
-    }
-
-    protected String getPath(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.HTTP_PATH, String.class);
-        return answer;
-    }
-    
-    protected String getRequestURI(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.HTTP_URI, String.class);
-        return answer;
-    }
-    
-    protected String getBasePath(Exchange camelExchange) {
-        String answer = camelExchange.getIn().getHeader(Exchange.HTTP_BASE_URI, String.class);
-
-        if (answer == null) {
-            answer = camelExchange.getFromEndpoint().getEndpointUri();
-        }
-        
-        return answer;
-    }
-
-    protected String getVerb(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.HTTP_METHOD, String.class);
-        return answer;
-    }
-    
-    protected String getQueryString(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.HTTP_QUERY, String.class);
-        return answer;
-    }
-
-    protected String getCharacterEncoding(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.HTTP_CHARACTER_ENCODING, String.class);
-        if (answer == null) {
-            answer = camelMessage.getHeader(Exchange.CHARSET_NAME, String.class);
-        }
-        return answer;
-    }
-
-    protected String getRequestContentType(org.apache.camel.Message camelMessage) {
-        String answer = camelMessage.getHeader(Exchange.CONTENT_TYPE, String.class);
-        if (answer != null) {
-            return answer;
-        }        
-        // return default
-        return "*/*";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/f21e2299/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
b/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
index c7832a1..4b3d142 100644
--- a/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
+++ b/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/transport/CamelDestination.java
@@ -27,7 +27,7 @@ import org.apache.camel.FailedToCreateConsumerException;
 import org.apache.camel.NoSuchEndpointException;
 import org.apache.camel.Processor;
 import org.apache.camel.component.cxf.common.header.CxfHeaderHelper;
-import org.apache.camel.component.cxf.common.message.DefaultCxfMesssageMapper;
+import org.apache.camel.component.cxf.common.message.DefaultCxfMessageMapper;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
@@ -151,7 +151,7 @@ public class CamelDestination extends AbstractDestination implements Configurabl
 
     protected void incoming(org.apache.camel.Exchange camelExchange) {
         LOG.debug("server received request: ", camelExchange);
-        DefaultCxfMesssageMapper beanBinding = new DefaultCxfMesssageMapper();
+        DefaultCxfMessageMapper beanBinding = new DefaultCxfMessageMapper();
         org.apache.cxf.message.Message inMessage =
             beanBinding.createCxfMessageFromCamelExchange(camelExchange, headerFilterStrategy);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f21e2299/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
index 1cc7f58..f08860a 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
@@ -36,7 +36,7 @@ public class DefaultCxfMessageMapperTest extends Assert {
         final String requestURI = "/path;a=b";
         final String requestPath = "/path";
 
-        DefaultCxfMesssageMapper mapper = new DefaultCxfMesssageMapper();
+        DefaultCxfMessageMapper mapper = new DefaultCxfMessageMapper();
 
         Exchange camelExchange = setupCamelExchange(requestURI, requestPath);
         Message cxfMessage = mapper.createCxfMessageFromCamelExchange(

http://git-wip-us.apache.org/repos/asf/camel/blob/f21e2299/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/CxfBeanEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/CxfBeanEndpoint.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/CxfBeanEndpoint.java
index 11d1bca..d2e6ad9 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/CxfBeanEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/cxfbean/CxfBeanEndpoint.java
@@ -23,7 +23,7 @@ import javax.jws.WebService;
 
 import org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy;
 import org.apache.camel.component.cxf.common.message.CxfMessageMapper;
-import org.apache.camel.component.cxf.common.message.DefaultCxfMesssageMapper;
+import org.apache.camel.component.cxf.common.message.DefaultCxfMessageMapper;
 import org.apache.camel.impl.ProcessorEndpoint;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.HeaderFilterStrategyAware;
@@ -49,7 +49,7 @@ public class CxfBeanEndpoint extends ProcessorEndpoint implements HeaderFilterSt
     private Server server;
     private Bus bus;
     private boolean isSetDefaultBus;
-    private CxfMessageMapper cxfBeanBinding = new DefaultCxfMesssageMapper();
+    private CxfMessageMapper cxfBeanBinding = new DefaultCxfMessageMapper();
     private HeaderFilterStrategy headerFilterStrategy = new CxfHeaderFilterStrategy();
     private boolean loggingFeatureEnabled;
     private boolean populateFromClass = true;


Mime
View raw message