Add update() method to qmf objects to update properties.
--------------------------------------------------------
Key: QPID-1542
URL: https://issues.apache.org/jira/browse/QPID-1542
Project: Qpid
Issue Type: Improvement
Components: Qpid Managment Framework
Reporter: Ian Main
This patch adds an 'update' method to the qmf object class that allows you to
sync new properties/statistics with the server.
diff --git a/lib/qpid/qmf.rb b/lib/qpid/qmf.rb
index f341da7..0309b65 100644
--- a/lib/qpid/qmf.rb
+++ b/lib/qpid/qmf.rb
@@ -974,8 +974,17 @@ module Qpid::Qmf
unless object_id == newer.object_id
raise "Objects with different object-ids"
end
- @properties = newer.getProperties unless newer.properties.empty?
- @statistics = newer.getStatistics unless newer.statistics.empty?
+ @properties = newer.properties unless newer.properties.empty?
+ @statistics = newer.statistics unless newer.statistics.empty?
+ end
+
+ def update
+ obj = @session.object(:object_id => @object_id, :broker => @broker)
+ if obj
+ merge_update(obj)
+ else
+ raise "Underlying object no longer exists."
+ end
end
def to_s
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.