You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2011/02/04 06:19:44 UTC

svn commit: r1067087 - in /qpid/trunk/qpid/cpp: include/qmf/AgentSession.h include/qmf/ConsoleSession.h src/qmf/Agent.cpp src/qmf/ConsoleSession.cpp src/qmf/ConsoleSessionImpl.h

Author: tross
Date: Fri Feb  4 05:19:43 2011
New Revision: 1067087

URL: http://svn.apache.org/viewvc?rev=1067087&view=rev
Log:
Fixed typos in the documentation text.
Fixed bug in the propagation of exceptions in query-processing.
Added user-id to messages sent by the console.

Modified:
    qpid/trunk/qpid/cpp/include/qmf/AgentSession.h
    qpid/trunk/qpid/cpp/include/qmf/ConsoleSession.h
    qpid/trunk/qpid/cpp/src/qmf/Agent.cpp
    qpid/trunk/qpid/cpp/src/qmf/ConsoleSession.cpp
    qpid/trunk/qpid/cpp/src/qmf/ConsoleSessionImpl.h

Modified: qpid/trunk/qpid/cpp/include/qmf/AgentSession.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qmf/AgentSession.h?rev=1067087&r1=1067086&r2=1067087&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qmf/AgentSession.h (original)
+++ qpid/trunk/qpid/cpp/include/qmf/AgentSession.h Fri Feb  4 05:19:43 2011
@@ -69,7 +69,7 @@ namespace qmf {
          *                                 If False: QMF events are only sent to authorized subscribers
          *    listen-on-direct:{True,False} - If True:  Listen on legacy direct-exchange address for backward compatibility [default]
          *                                    If False: Listen only on the routable direct address
-         *    strict-security:{True,False}  - If True:  Cooperate with the broker to enforce string access control to the network
+         *    strict-security:{True,False}  - If True:  Cooperate with the broker to enforce strict access control to the network
          *                                  - If False: Operate more flexibly with regard to use of messaging facilities [default]
          */
         QMF_EXTERN AgentSession(qpid::messaging::Connection&, const std::string& options="");

Modified: qpid/trunk/qpid/cpp/include/qmf/ConsoleSession.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qmf/ConsoleSession.h?rev=1067087&r1=1067086&r2=1067087&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qmf/ConsoleSession.h (original)
+++ qpid/trunk/qpid/cpp/include/qmf/ConsoleSession.h Fri Feb  4 05:19:43 2011
@@ -59,7 +59,7 @@ namespace qmf {
          *                                 an agent before deleting it [default: 5]
          *    listen-on-direct:{True,False} - If True:  Listen on legacy direct-exchange address for backward compatibility [default]
          *                                    If False: Listen only on the routable direct address
-         *    strict-security:{True,False}  - If True:  Cooperate with the broker to enforce string access control to the network
+         *    strict-security:{True,False}  - If True:  Cooperate with the broker to enforce strict access control to the network
          *                                  - If False: Operate more flexibly with regard to use of messaging facilities [default]
          */
         QMF_EXTERN ConsoleSession(qpid::messaging::Connection&, const std::string& options="");

Modified: qpid/trunk/qpid/cpp/src/qmf/Agent.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/Agent.cpp?rev=1067087&r1=1067086&r2=1067087&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/Agent.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qmf/Agent.cpp Fri Feb  4 05:19:43 2011
@@ -119,7 +119,9 @@ ConsoleEvent AgentImpl::query(const Quer
                 context->cond.wait(context->lock,
                                    qpid::sys::AbsTime(qpid::sys::now(),
                                                       qpid::sys::Duration(milliseconds * qpid::sys::TIME_MSEC)));
-            if (context->response.isValid() && context->response.isFinal())
+            if (context->response.isValid() &&
+                ((context->response.getType() == CONSOLE_QUERY_RESPONSE && context->response.isFinal()) ||
+                 (context->response.getType() == CONSOLE_EXCEPTION)))
                 result = context->response;
             else {
                 auto_ptr<ConsoleEventImpl> impl(new ConsoleEventImpl(CONSOLE_EXCEPTION));
@@ -520,6 +522,8 @@ void AgentImpl::sendQuery(const Query& q
     msg.setReplyTo(session.replyAddress);
     msg.setCorrelationId(boost::lexical_cast<string>(correlator));
     msg.setSubject(directSubject);
+    if (!session.authUser.empty())
+        msg.setUserId(session.authUser);
     encode(QueryImplAccess::get(query).asMap(), msg);
     if (sender.isValid())
         sender.send(msg);
@@ -545,6 +549,8 @@ void AgentImpl::sendMethod(const string&
     msg.setReplyTo(session.replyAddress);
     msg.setCorrelationId(boost::lexical_cast<string>(correlator));
     msg.setSubject(directSubject);
+    if (!session.authUser.empty())
+        msg.setUserId(session.authUser);
     encode(map, msg);
     if (sender.isValid())
         sender.send(msg);
@@ -586,6 +592,8 @@ void AgentImpl::sendSchemaRequest(const 
     msg.setReplyTo(session.replyAddress);
     msg.setContent(content);
     msg.setSubject(directSubject);
+    if (!session.authUser.empty())
+        msg.setUserId(session.authUser);
     if (sender.isValid())
         sender.send(msg);
 

Modified: qpid/trunk/qpid/cpp/src/qmf/ConsoleSession.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/ConsoleSession.cpp?rev=1067087&r1=1067086&r2=1067087&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/ConsoleSession.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qmf/ConsoleSession.cpp Fri Feb  4 05:19:43 2011
@@ -65,9 +65,9 @@ Subscription ConsoleSession::subscribe(c
 //========================================================================================
 
 ConsoleSessionImpl::ConsoleSessionImpl(Connection& c, const string& options) :
-    connection(c), domain("default"), maxAgentAgeMinutes(5), opened(false),
-    thread(0), threadCanceled(false),
-    lastVisit(0), lastAgePass(0), connectedBrokerInAgentList(false), schemaCache(new SchemaCache())
+    connection(c), domain("default"), authUser(c.getAuthenticatedUsername()), maxAgentAgeMinutes(5),
+    opened(false), thread(0), threadCanceled(false), lastVisit(0), lastAgePass(0),
+    connectedBrokerInAgentList(false), schemaCache(new SchemaCache())
 {
     if (!options.empty()) {
         qpid::messaging::AddressParser parser(options);

Modified: qpid/trunk/qpid/cpp/src/qmf/ConsoleSessionImpl.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qmf/ConsoleSessionImpl.h?rev=1067087&r1=1067086&r2=1067087&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qmf/ConsoleSessionImpl.h (original)
+++ qpid/trunk/qpid/cpp/src/qmf/ConsoleSessionImpl.h Fri Feb  4 05:19:43 2011
@@ -72,6 +72,7 @@ namespace qmf {
         qpid::messaging::Sender directSender;
         qpid::messaging::Sender topicSender;
         std::string domain;
+        std::string authUser;
         uint32_t maxAgentAgeMinutes;
         bool listenOnDirect;
         bool strictSecurity;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org