You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2014/01/15 00:00:28 UTC

svn commit: r1558235 - in /activemq/activemq-dotnet/Apache.NMS.AMQP/trunk: src/main/csharp/Connection.cs vs2010-amqp-test.csproj vs2010-amqp.csproj

Author: tabish
Date: Tue Jan 14 23:00:28 2014
New Revision: 1558235

URL: http://svn.apache.org/r1558235
Log:
https://issues.apache.org/jira/browse/AMQNET-454

applied:
https://issues.apache.org/jira/secure/attachment/12622979/Apache.NMS.AMQP-copyrights-conn-str-fix-09.patch

Modified:
    activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp-test.csproj
    activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.csproj

Modified: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/main/csharp/Connection.cs?rev=1558235&r1=1558234&r2=1558235&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/src/main/csharp/Connection.cs Tue Jan 14 23:00:28 2014
@@ -32,8 +32,8 @@ namespace Apache.NMS.Amqp
     {
         // Connections options indexes and constants
         private const string PROTOCOL_OPTION = "protocol";
-        private const string PROTOCOL_0_10 = "amqp0.10";
         private const string PROTOCOL_1_0 = "amqp1.0";
+        private const string PROTOCOL_0_10 = "amqp0-10";
         private const char SEP_ARGS = ',';
         private const char SEP_NAME_VALUE = ':';
         public const string USERNAME_OPTION = "username";
@@ -338,7 +338,7 @@ namespace Apache.NMS.Amqp
                                 qpidConnection =
                                     new Org.Apache.Qpid.Messaging.Connection(
                                         brokerUri.ToString(),
-                                        ConstructConnectionOptionsString());
+                                        ConstructConnectionOptionsString(connectionProperties));
                             }
 
                             // Open the connection
@@ -584,35 +584,12 @@ namespace Apache.NMS.Amqp
         /// Convert specified connection properties string map into the
         /// connection properties string to send to Qpid Messaging. 
         /// </summary>
-        /// <returns>void</returns>
-        /// <remarks>Mostly this is pass-through but special processing is applied
-        /// to the protocol version to get a default amqp1.0.</remarks>
-        internal string ConstructConnectionOptionsString()
+        /// <returns>qpid connection properties string</returns>
+        /// <remarks>Mostly this is pass-through. Default to amqp1.0
+        /// in the absence of any protocol option.</remarks>
+        internal string ConstructConnectionOptionsString(StringDictionary cp)
         {
             string result = "";
-            // construct new dictionary with desired settings
-            StringDictionary cp = connectionProperties;
-
-            // protocol version munging
-            if (cp.ContainsKey(PROTOCOL_OPTION))
-            {
-                // protocol option specified
-                if (cp[PROTOCOL_OPTION].Equals(PROTOCOL_0_10))
-                {
-                    // amqp 0.10 selected by setting _no_ option
-                    cp.Remove(PROTOCOL_OPTION);
-                }
-                else
-                {
-                    // amqp version set but not to version 0.10 - pass it through
-                }
-            }
-            else
-            {
-                // no protocol option - select 1.0
-                cp.Add(PROTOCOL_OPTION, PROTOCOL_1_0);
-            }
-
             // Construct qpid connection string
             bool first = true;
             result = "{";
@@ -623,9 +600,21 @@ namespace Apache.NMS.Amqp
                     result += SEP_ARGS;
                 }
                 result += de.Key + SEP_NAME_VALUE.ToString() + de.Value;
+                first = false;
+            }
+
+            // protocol version munging
+            if (!cp.ContainsKey(PROTOCOL_OPTION))
+            {
+                // no protocol option - select 1.0
+                if (!first)
+                {
+                    result += SEP_ARGS;
+                }
+                result += PROTOCOL_OPTION + SEP_NAME_VALUE.ToString() + PROTOCOL_1_0;
             }
-            result += "}";
 
+            result += "}";
             return result;
         }
 

Modified: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp-test.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp-test.csproj?rev=1558235&r1=1558234&r2=1558235&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp-test.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp-test.csproj Tue Jan 14 23:00:28 2014
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

Modified: activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.csproj?rev=1558235&r1=1558234&r2=1558235&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS.AMQP/trunk/vs2010-amqp.csproj Tue Jan 14 23:00:28 2014
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+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.
+-->
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>