From 7b1e12a3e3d6d4b0f7cd42e413bfa9b038f6a02e Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Fri, 17 Jun 2011 21:23:50 +0000 Subject: QPID-3200 Ability to acknowledge all messages up to and including a given message for a Session .NET Binding keeps up with additions to the Messaging package. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1137034 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bindings/qpid/dotnet/src/Session.cpp | 25 +++++++++++++++++++++++++ cpp/bindings/qpid/dotnet/src/Session.h | 2 ++ 2 files changed, 27 insertions(+) (limited to 'cpp/bindings') diff --git a/cpp/bindings/qpid/dotnet/src/Session.cpp b/cpp/bindings/qpid/dotnet/src/Session.cpp index 4a6199f108..0e918769a3 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.cpp +++ b/cpp/bindings/qpid/dotnet/src/Session.cpp @@ -248,6 +248,31 @@ namespace Messaging { } } + void Session::AcknowledgeUpTo(Message ^ message) + { + AcknowledgeUpTo(message, false); + } + + void Session::AcknowledgeUpTo(Message ^ message, bool sync) + { + System::Exception ^ newException = nullptr; + + try + { + sessionp->acknowledgeUpTo(*(message->NativeMessage), sync); + } + catch (const ::qpid::types::Exception & error) + { + String ^ errmsg = gcnew String(error.what()); + newException = gcnew QpidException(errmsg); + } + + if (newException != nullptr) + { + throw newException; + } + } + void Session::Reject(Message ^ message) { System::Exception ^ newException = nullptr; diff --git a/cpp/bindings/qpid/dotnet/src/Session.h b/cpp/bindings/qpid/dotnet/src/Session.h index 4d4cad75c4..4b98a37f18 100644 --- a/cpp/bindings/qpid/dotnet/src/Session.h +++ b/cpp/bindings/qpid/dotnet/src/Session.h @@ -104,6 +104,8 @@ namespace Messaging { void Acknowledge(bool sync); void Acknowledge(Message ^ message); void Acknowledge(Message ^ message, bool sync); + void AcknowledgeUpTo(Message ^ message); + void AcknowledgeUpTo(Message ^ message, bool sync); void Reject(Message ^); void Release(Message ^); void Sync(); -- cgit v1.2.1