QPID-5481: Messaging API Update - 1520673 Connection reconnect() and getUrl() added


git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1558911 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp
index 9171b5e..d4d5d2f 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.cpp
@@ -267,6 +267,56 @@
         }

     }

 

+

+    void Connection::Reconnect(System::String ^ url)

+    {

+        System::Exception ^ newException = nullptr;

+

+        try

+        {

+            msclr::lock lk(privateLock);

+            ThrowIfDisposed();

+

+            std::string nativeUrl = QpidMarshal::ToNative(url);

+            nativeObjPtr->reconnect(nativeUrl);

+        }

+        catch (const ::qpid::types::Exception & error)

+        {

+            String ^ errmsg = gcnew String(error.what());

+            newException    = gcnew QpidException(errmsg);

+        }

+

+        if (newException != nullptr)

+        {

+            throw newException;

+        }

+    }

+

+

+    void Connection::Reconnect()

+    {

+        System::Exception ^ newException = nullptr;

+

+        try

+        {

+            msclr::lock lk(privateLock);

+            ThrowIfDisposed();

+

+            nativeObjPtr->reconnect();

+        }

+        catch (const ::qpid::types::Exception & error)

+        {

+            String ^ errmsg = gcnew String(error.what());

+            newException    = gcnew QpidException(errmsg);

+        }

+

+        if (newException != nullptr)

+        {

+            throw newException;

+        }

+    }

+

+

     //

     // CreateTransactionalSession()

     //

diff --git a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h
index 27381d8..82b5262 100644
--- a/qpid/cpp/bindings/qpid/dotnet/src/Connection.h
+++ b/qpid/cpp/bindings/qpid/dotnet/src/Connection.h
@@ -129,6 +129,20 @@
             }

         }

 

+        void Reconnect(System::String ^ url);

+        void Reconnect();

+        

+        property System::String ^ Url

+        {

+            System::String ^ get()

+            {

+                msclr::lock lk(privateLock);

+                ThrowIfDisposed();

+

+                return gcnew System::String(nativeObjPtr->getUrl().c_str());

+            }

+        }

+

         // CreateTransactionalSession()

         Session ^ CreateTransactionalSession();

         Session ^ CreateTransactionalSession(System::String ^ name);