diff options
author | Ted Ross <tross@apache.org> | 2009-10-02 21:43:22 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2009-10-02 21:43:22 +0000 |
commit | 2df0b393db42d098f590f6b00fb96b0c15b1f6f9 (patch) | |
tree | c6e271c2cf17df3e3661d871856edca0e213b0aa | |
parent | 0f7c02dae11afed532bf60302cf2185f422fd23c (diff) | |
download | qpid-python-2df0b393db42d098f590f6b00fb96b0c15b1f6f9.tar.gz |
QMF Fixes in Ruby Console:
- AgentProxy object now has broker_bank and agent_bank accessors
- Fixed a bug in the returning og reference values (ObjectId)
- Added package_name accessor to SchemaObjectClass
- Added accessors for agent/broker bank to ObjectId
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@821181 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/bindings/qmf/ruby/qmf.rb | 38 | ||||
-rwxr-xr-x | qpid/cpp/bindings/qmf/tests/ruby_console.rb | 7 | ||||
-rw-r--r-- | qpid/cpp/include/qmf/engine/Console.h | 2 | ||||
-rw-r--r-- | qpid/cpp/include/qmf/engine/ObjectId.h | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/engine/BrokerProxyImpl.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/engine/BrokerProxyImpl.h | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp | 4 |
7 files changed, 50 insertions, 9 deletions
diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb index f79fb5ed88..fbf95215fd 100644 --- a/qpid/cpp/bindings/qmf/ruby/qmf.rb +++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb @@ -252,7 +252,7 @@ module Qmf when TYPE_SSTR, TYPE_LSTR then val.asString when TYPE_ABSTIME then val.asInt64 when TYPE_DELTATIME then val.asUint64 - when TYPE_REF then val.asObjectId + when TYPE_REF then ObjectId.new(val.asObjectId) when TYPE_BOOL then val.asBool when TYPE_FLOAT then val.asFloat when TYPE_DOUBLE then val.asDouble @@ -463,11 +463,19 @@ module Qmf end def object_num_high - return @impl.getObjectNumHi + @impl.getObjectNumHi end def object_num_low - return @impl.getObjectNumLo + @impl.getObjectNumLo + end + + def broker_bank + @impl.getBrokerBank + end + + def agent_bank + @impl.getAgentBank end def ==(other) @@ -522,7 +530,7 @@ module Qmf when TYPE_SSTR, TYPE_LSTR then val.asString when TYPE_ABSTIME then val.asInt64 when TYPE_DELTATIME then val.asUint64 - when TYPE_REF then val.asObjectId + when TYPE_REF then ObjectId.new(val.asObjectId) when TYPE_BOOL then val.asBool when TYPE_FLOAT then val.asFloat when TYPE_DOUBLE then val.asDouble @@ -796,7 +804,15 @@ module Qmf @impl.addMethod(meth.impl) end - def name + def class_key + SchemaClassKey.new(@impl.getClassKey) + end + + def package_name + @impl.getClassKey.getPackageName + end + + def class_name @impl.getClassKey.getClassName end end @@ -1027,14 +1043,23 @@ module Qmf def label @impl.getLabel end + + def broker_bank + @impl.getBrokerBank + end + + def agent_bank + @impl.getAgentBank + end end class Broker < ConnectionHandler include MonitorMixin - attr_reader :impl, :conn, :console + attr_reader :impl, :conn, :console, :broker_bank def initialize(console, conn) super() + @broker_bank = 1 @console = console @conn = conn @session = nil @@ -1281,5 +1306,4 @@ module Qmf do_events end end - end diff --git a/qpid/cpp/bindings/qmf/tests/ruby_console.rb b/qpid/cpp/bindings/qmf/tests/ruby_console.rb index f4420c9fc6..0fa856c724 100755 --- a/qpid/cpp/bindings/qmf/tests/ruby_console.rb +++ b/qpid/cpp/bindings/qmf/tests/ruby_console.rb @@ -25,7 +25,7 @@ require 'socket' class App < Qmf::ConsoleHandler def agent_added(agent) - puts "AgentAdded: #{agent.label}" + puts "AgentAdded: #{agent.label} broker=#{agent.broker_bank} agent=#{agent.agent_bank}" end def agent_deleted(agent) @@ -41,7 +41,10 @@ class App < Qmf::ConsoleHandler end def object_update(object, hasProps, hasStats) - puts "ObjectUpdate: #{object.object_class.name} props=#{hasProps} stats=#{hasStats}" + puts "ObjectUpdate: #{object.object_class.class_name} props=#{hasProps} stats=#{hasStats}" + puts " broker-bank=#{object.object_id.broker_bank}" + puts " agent-bank=#{object.object_id.agent_bank}" + puts " package=#{object.object_class.package_name}" end def event_received(event); end diff --git a/qpid/cpp/include/qmf/engine/Console.h b/qpid/cpp/include/qmf/engine/Console.h index f53f351760..ce72360da7 100644 --- a/qpid/cpp/include/qmf/engine/Console.h +++ b/qpid/cpp/include/qmf/engine/Console.h @@ -136,6 +136,8 @@ namespace engine { public: ~AgentProxy(); const char* getLabel() const; + uint32_t getBrokerBank() const; + uint32_t getAgentBank() const; private: friend struct StaticContext; diff --git a/qpid/cpp/include/qmf/engine/ObjectId.h b/qpid/cpp/include/qmf/engine/ObjectId.h index b71473a799..2055972c00 100644 --- a/qpid/cpp/include/qmf/engine/ObjectId.h +++ b/qpid/cpp/include/qmf/engine/ObjectId.h @@ -39,6 +39,10 @@ namespace engine { uint32_t getObjectNumLo() const; bool isDurable() const; const char* str() const; + uint8_t getFlags() const; + uint16_t getSequence() const; + uint32_t getBrokerBank() const; + uint32_t getAgentBank() const; bool operator==(const ObjectId& other) const; bool operator<(const ObjectId& other) const; diff --git a/qpid/cpp/src/qmf/engine/BrokerProxyImpl.cpp b/qpid/cpp/src/qmf/engine/BrokerProxyImpl.cpp index e296254bf8..1a2b3e6555 100644 --- a/qpid/cpp/src/qmf/engine/BrokerProxyImpl.cpp +++ b/qpid/cpp/src/qmf/engine/BrokerProxyImpl.cpp @@ -730,6 +730,8 @@ bool MethodContext::handleMessage(uint8_t opcode, uint32_t sequence, const strin AgentProxy::AgentProxy(AgentProxyImpl* i) : impl(i) {} AgentProxy::~AgentProxy() { delete impl; } const char* AgentProxy::getLabel() const { return impl->getLabel().c_str(); } +uint32_t AgentProxy::getBrokerBank() const { return impl->getBrokerBank(); } +uint32_t AgentProxy::getAgentBank() const { return impl->getAgentBank(); } BrokerProxy::BrokerProxy(Console& console) : impl(new BrokerProxyImpl(*this, console)) {} BrokerProxy::~BrokerProxy() { delete impl; } diff --git a/qpid/cpp/src/qmf/engine/BrokerProxyImpl.h b/qpid/cpp/src/qmf/engine/BrokerProxyImpl.h index 738424bce1..798a5fdc76 100644 --- a/qpid/cpp/src/qmf/engine/BrokerProxyImpl.h +++ b/qpid/cpp/src/qmf/engine/BrokerProxyImpl.h @@ -108,6 +108,8 @@ namespace engine { } ~AgentProxyImpl() {} const std::string& getLabel() const { return label; } + uint32_t getBrokerBank() const { return 1; } + uint32_t getAgentBank() const { return agentBank; } void addSequence(uint32_t seq) { inFlightSequences.insert(seq); } void delSequence(uint32_t seq) { inFlightSequences.erase(seq); } void releaseInFlight(SequenceManager& seqMgr) { diff --git a/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp b/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp index 5b925045bf..b08ae2756c 100644 --- a/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp +++ b/qpid/cpp/src/qmf/engine/ObjectIdImpl.cpp @@ -156,6 +156,10 @@ uint32_t ObjectId::getObjectNumHi() const { return impl->getObjectNumHi(); } uint32_t ObjectId::getObjectNumLo() const { return impl->getObjectNumLo(); } bool ObjectId::isDurable() const { return impl->isDurable(); } const char* ObjectId::str() const { return impl->asString().c_str(); } +uint8_t ObjectId::getFlags() const { return impl->getFlags(); } +uint16_t ObjectId::getSequence() const { return impl->getSequence(); } +uint32_t ObjectId::getBrokerBank() const { return impl->getBrokerBank(); } +uint32_t ObjectId::getAgentBank() const { return impl->getAgentBank(); } bool ObjectId::operator==(const ObjectId& other) const { return *impl == *other.impl; } bool ObjectId::operator<(const ObjectId& other) const { return *impl < *other.impl; } bool ObjectId::operator>(const ObjectId& other) const { return *impl > *other.impl; } |