qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1557262 - in /qpid/trunk/qpid/cpp/src/qpid/broker/amqp: NodeProperties.cpp NodeProperties.h Session.cpp Session.h
Date Fri, 10 Jan 2014 21:16:56 GMT
Author: gsim
Date: Fri Jan 10 21:16:56 2014
New Revision: 1557262

URL: http://svn.apache.org/r1557262
Log:
QPID-5463: make dynamic nodes auto deleted by default

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp?rev=1557262&r1=1557261&r2=1557262&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp Fri Jan 10 21:16:56 2014
@@ -105,7 +105,8 @@ bool getLifetimeDescriptorSymbol(QueueSe
 
 }
 
-NodeProperties::NodeProperties() : received(false), queue(true), durable(false), autoDelete(false),
exclusive(false), exchangeType("topic"), lifetime(QueueSettings::DELETE_IF_UNUSED) {}
+NodeProperties::NodeProperties(bool isDynamic) : received(false), queue(true), durable(false),
autoDelete(false), exclusive(false),
+                                                 dynamic(isDynamic), exchangeType("topic"),
lifetime(QueueSettings::DELETE_IF_UNUSED) {}
 
 void NodeProperties::read(pn_data_t* data)
 {
@@ -335,7 +336,9 @@ void NodeProperties::onSymbolValue(const
 
 QueueSettings NodeProperties::getQueueSettings()
 {
-    QueueSettings settings(durable, autoDelete);
+    //assume autodelete for dynamic nodes unless explicitly requested
+    //otherwise or unless durability is requested
+    QueueSettings settings(durable, autoDelete || (dynamic && !wasSpecified(AUTO_DELETE)
&& !durable));
     qpid::types::Variant::Map unused;
     settings.populate(properties, unused);
     settings.lifetime = lifetime;

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h?rev=1557262&r1=1557261&r2=1557262&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h Fri Jan 10 21:16:56 2014
@@ -38,7 +38,7 @@ namespace amqp {
 class NodeProperties : public qpid::amqp::MapReader
 {
   public:
-    NodeProperties();
+    NodeProperties(bool isDynamic);
     void read(pn_data_t*);
     void write(pn_data_t*,boost::shared_ptr<Queue>);
     void write(pn_data_t*,boost::shared_ptr<Exchange>);
@@ -75,6 +75,7 @@ class NodeProperties : public qpid::amqp
     bool durable;
     bool autoDelete;
     bool exclusive;
+    bool dynamic;
     std::string exchangeType;
     std::string alternateExchange;
     qpid::types::Variant::Map properties;

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp?rev=1557262&r1=1557261&r2=1557262&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.cpp Fri Jan 10 21:16:56 2014
@@ -216,7 +216,7 @@ Session::ResolvedNode Session::resolve(c
     }
     //check whether user is even allowed access to queues/topics before resolving
     authorise.access(name, isQueueRequested, isTopicRequested);
-    ResolvedNode node;
+    ResolvedNode node(pn_terminus_is_dynamic(terminus));
     if (isTopicRequested || !isQueueRequested) {
         node.topic = connection.getTopics().get(name);
         if (node.topic) node.exchange = node.topic->getExchange();

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.h?rev=1557262&r1=1557261&r2=1557262&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Session.h Fri Jan 10 21:16:56 2014
@@ -100,6 +100,7 @@ class Session : public ManagedSession, p
         boost::shared_ptr<qpid::broker::amqp::Topic> topic;
         boost::shared_ptr<Relay> relay;
         NodeProperties properties;
+        ResolvedNode(bool isDynamic) : properties(isDynamic) {}
     };
 
     ResolvedNode resolve(const std::string name, pn_terminus_t* terminus, bool incoming);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message