summaryrefslogtreecommitdiff
path: root/cpp/bindings
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2011-02-04 08:22:30 +0000
committerTed Ross <tross@apache.org>2011-02-04 08:22:30 +0000
commite46939c93ba0682d74f025eeec7bdb88229b4277 (patch)
treeeb55184ad87bc9c31168bf955256959541fc117b /cpp/bindings
parente7f02a8b8b25d9fcce6525ccc5b794f8438995f0 (diff)
downloadqpid-python-e46939c93ba0682d74f025eeec7bdb88229b4277.tar.gz
Added missing even handling in the console.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1067111 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings')
-rw-r--r--cpp/bindings/qmf2/examples/python/find_agents.py3
-rw-r--r--cpp/bindings/qmf2/examples/ruby/find_agents.rb4
-rw-r--r--cpp/bindings/qmf2/python/qmf2.py3
-rw-r--r--cpp/bindings/qmf2/ruby/qmf2.rb3
4 files changed, 13 insertions, 0 deletions
diff --git a/cpp/bindings/qmf2/examples/python/find_agents.py b/cpp/bindings/qmf2/examples/python/find_agents.py
index 15cc83649c..5fd71b3f1c 100644
--- a/cpp/bindings/qmf2/examples/python/find_agents.py
+++ b/cpp/bindings/qmf2/examples/python/find_agents.py
@@ -37,6 +37,9 @@ class FindAgents(qmf2.ConsoleHandler):
def agentSchemaUpdated(self, agent):
print "Agent Schema Updated: %r" % agent
+ def eventRaised(self, agent, data, timestamp, severity):
+ print "Event: data=%r time=%d sev=%d" % (data.getProperties(), timestamp, severity)
+
url = "localhost"
diff --git a/cpp/bindings/qmf2/examples/ruby/find_agents.rb b/cpp/bindings/qmf2/examples/ruby/find_agents.rb
index deefd5491a..712e5007be 100644
--- a/cpp/bindings/qmf2/examples/ruby/find_agents.rb
+++ b/cpp/bindings/qmf2/examples/ruby/find_agents.rb
@@ -41,6 +41,10 @@ class FindAgents < Qmf2::ConsoleHandler
def agent_schema_updated(agent)
puts "Agent with new Schemata: #{agent.to_s}"
end
+
+ def event_raised(agent, data, timestamp, severity)
+ puts "Event Raised time=#{timestamp} sev=#{severity} data=#{data.properties}"
+ end
end
diff --git a/cpp/bindings/qmf2/python/qmf2.py b/cpp/bindings/qmf2/python/qmf2.py
index 9bf464e155..61a5453f8e 100644
--- a/cpp/bindings/qmf2/python/qmf2.py
+++ b/cpp/bindings/qmf2/python/qmf2.py
@@ -173,6 +173,9 @@ class ConsoleHandler(Thread):
elif event.getType() == cqmf2.CONSOLE_AGENT_SCHEMA_UPDATE:
self.agentSchemaUpdated(Agent(event.getAgent()))
+ elif event.getType() == cqmf2.CONSOLE_EVENT:
+ self.eventRaised(Agent(event.getAgent()), Data(event.getData(0)), event.getTimestamp(), event.getSeverity())
+
##
## The following methods are intended to be overridden in a sub-class. They are
## handlers for events that occur on QMF consoles.
diff --git a/cpp/bindings/qmf2/ruby/qmf2.rb b/cpp/bindings/qmf2/ruby/qmf2.rb
index 642af35eca..6d1741ebc0 100644
--- a/cpp/bindings/qmf2/ruby/qmf2.rb
+++ b/cpp/bindings/qmf2/ruby/qmf2.rb
@@ -297,6 +297,9 @@ module Qmf2
when Cqmf2::CONSOLE_AGENT_SCHEMA_UPDATE
agent_schema_updated(Agent.new(event.getAgent))
+ when Cqmf2::CONSOLE_EVENT
+ event_raised(Agent.new(event.getAgent), Data.new(event.getData(0)), event.getTimestamp, event.getSeverity)
+
end
end
end