rhmessaging commits: r2317 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-18 13:54:17 -0400 (Mon, 18 Aug 2008)
New Revision: 2317
Modified:
mgmt/trunk/cumin/python/cumin/exchange.py
mgmt/trunk/cumin/python/cumin/exchange.strings
mgmt/trunk/cumin/python/cumin/queue.py
mgmt/trunk/cumin/python/cumin/queue.strings
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Implement ExchangeBindingSet and QueueBindingSet using hidden columns
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-18 17:54:17 UTC (rev 2317)
@@ -305,9 +305,8 @@
self.__remove = self.Remove(app, "remove", self)
self.add_child(self.__remove)
- def get_name_col(self, app):
- return self.NameColumn(app, "q_id")
-
+ self.show_column("q_id")
+
def render_title(self, session, exchange):
return "Queue Bindings %s" % \
fmt_count(exchange.bindings.count())
@@ -318,16 +317,6 @@
elems.append(self.phase.get_sql_constraint(session, exchange))
return "where %s" % " and ".join(elems)
- class NameColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Queue"
-
- def render_content(self, session, data):
- queue = Identifiable(data["q_id"])
- branch = session.branch()
- self.frame.frame.show_queue(branch, queue).show_view(branch)
- return fmt_olink(branch, Queue.get(data["q_id"]))
-
class Remove(FormButton):
def process_submit(self, session):
ids = self.parent.ids.get(session)
Modified: mgmt/trunk/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.strings 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/exchange.strings 2008-08-18 17:54:17 UTC (rev 2317)
@@ -191,23 +191,6 @@
cumin.runObjectListeners(exchange);
}
-[ExchangeBindingSet.sql]
-select
- b.id,
- b.queue_id as q_id,
- b.binding_key as key
-from binding as b
-left outer join binding_stats as c on c.id = b.stats_curr_id
-{sql_where}
-{sql_orderby}
-{sql_limit}
-
-[ExchangeBindingSet.count_sql]
-select count(*)
-from binding as b
-left outer join binding_stats as c on c.id = b.stats_curr_id
-{sql_where}
-
[ExchangeBindingSet.html]
<form id="{id}" method="post" action="?">
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-08-18 17:54:17 UTC (rev 2317)
@@ -287,9 +287,8 @@
self.__remove = self.Remove(app, "remove", self)
self.add_child(self.__remove)
- def get_name_col(self, app):
- return self.NameColumn(app, "e_id")
-
+ self.show_column("e_id")
+
def render_add_queue_binding_url(self, session, vhost):
branch = session.branch()
self.frame.show_queue_binding_add(branch)
@@ -305,17 +304,6 @@
return "Exchange Bindings %s" % \
fmt_count(queue.bindings.count())
- class NameColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Exchange"
-
- def render_content(self, session, data):
- exchange = Identifiable(data["e_id"])
- branch = session.branch()
- self.frame.frame.show_exchange(branch, exchange).show_view(branch)
- name = Exchange.get(data["e_id"]).name or "<em>Default</em>"
- return fmt_olink(branch, exchange, name=name)
-
class Remove(FormButton):
def process_submit(self, session):
ids = self.parent.ids.get(session)
Modified: mgmt/trunk/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.strings 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/queue.strings 2008-08-18 17:54:17 UTC (rev 2317)
@@ -126,23 +126,6 @@
//throw new Error();
}
-[QueueBindingSet.sql]
-select
- b.id,
- b.exchange_id as e_id,
- b.binding_key as key
-from binding as b
-left outer join binding_stats as c on c.id = b.stats_curr_id
-{sql_where}
-{sql_orderby}
-{sql_limit}
-
-[QueueBindingSet.count_sql]
-select count(*)
-from binding as b
-left outer join binding_stats as c on c.id = b.stats_curr_id
-{sql_where}
-
[QueueBindingSet.html]
<form id="{id}" method="post" action="?">
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-18 17:54:17 UTC (rev 2317)
@@ -493,9 +493,12 @@
self.ids = CheckboxIdColumn(app, "id", self)
self.add_column(self.ids)
- col = self.get_name_col(app)
+ col = self.QNameColumn(app, "q_id", hidden=True)
self.add_column(col)
+ col = self.ENameColumn(app, "e_id", hidden=True)
+ self.add_column(col)
+
col = self.KeyColumn(app, "key")
self.add_column(col)
@@ -514,13 +517,30 @@
obj = self.frame.get_object(session)
return (obj,)
- def get_name_col(self):
- # implemented in derived class
- pass
-
def get_sql_values(self, session, obj):
return {"id": obj.id}
+ class QNameColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Queue"
+
+ def render_content(self, session, data):
+ queue = Identifiable(data["q_id"])
+ branch = session.branch()
+ self.frame.frame.show_queue(branch, queue).show_view(branch)
+ return fmt_olink(branch, Queue.get(data["q_id"]))
+
+ class ENameColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Exchange"
+
+ def render_content(self, session, data):
+ exchange = Identifiable(data["e_id"])
+ branch = session.branch()
+ self.frame.frame.show_exchange(branch, exchange).show_view(branch)
+ name = Exchange.get(data["e_id"]).name or "<em>Default</em>"
+ return fmt_olink(branch, exchange, name=name)
+
class KeyColumn(SqlTableColumn):
def render_title(self, session, data):
return "Key"
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-08-15 19:17:19 UTC (rev 2316)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-08-18 17:54:17 UTC (rev 2317)
@@ -1,3 +1,22 @@
+[BindingSet.sql]
+select
+ b.id,
+ b.exchange_id as e_id,
+ b.queue_id as q_id,
+ b.binding_key as key
+from binding as b
+left outer join binding_stats as c on c.id = b.stats_curr_id
+{sql_where}
+{sql_orderby}
+{sql_limit}
+
+[BindingSet.count_sql]
+select count(*)
+from binding as b
+left outer join binding_stats as c on c.id = b.stats_curr_id
+{sql_where}
+
+
[CuminView.html]
<script type="text/javascript">
{script}
16 years, 6 months
rhmessaging commits: r2316 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-15 15:17:19 -0400 (Fri, 15 Aug 2008)
New Revision: 2316
Modified:
mgmt/trunk/cumin/python/cumin/test.py
Log:
Added tests for:
- Create new Broker Link
- Create Route
- Remove Route
- Remove Broker Link
- Binding to Direct exchange
- Binding to Topic exchange
- Binding to Fanout exchange
- Binding to Headers exchange
- Remove queue binding
Modified: mgmt/trunk/cumin/python/cumin/test.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/test.py 2008-08-15 14:48:59 UTC (rev 2315)
+++ mgmt/trunk/cumin/python/cumin/test.py 2008-08-15 19:17:19 UTC (rev 2316)
@@ -13,7 +13,6 @@
from util import *
import time
-
class TestBroker(Thread):
def __init__(self, path, port):
super(TestBroker, self).__init__()
@@ -251,6 +250,136 @@
BrokerGroupTest(env, self)
BrokerRegistrationTest(env, self)
+class BrokerLinkTest(Test):
+ def __init__(self, env, parent):
+ super(BrokerLinkTest, self).__init__(env, parent)
+
+ RouteTest(env, self)
+ self.LinkRemove(env, self)
+
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg).show_broker_link_add(s)
+
+ host = dict()
+ host["name"] = "localhost"
+ host["port"] = "9991"
+ host["password"] = ""
+ host["username"] = ""
+ form.host.set(s, host)
+ form.durable.set(s, "transient")
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ vhost = self.env.vhost
+
+ def predicate():
+ for item in Link.selectBy(vhost=vhost, host="localhost", port=9991):
+ return True
+
+ wait(predicate)
+
+ try:
+ self.env.link = Link.selectBy(vhost=vhost, host="localhost", port=9991)[0]
+ except IndexError:
+ raise Exception("Link not created")
+
+ self.run_children(session)
+
+ class LinkRemove(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg).show_broker_links_close(s)
+
+ ids = [self.env.link.id]
+ form.ids.set(s, ids)
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ def predicate():
+ return self.env.link.deletionTime
+
+ wait(predicate)
+
+ # if it timed out, raise an exception
+ if not self.env.link.deletionTime:
+ raise Exception("Link not removed")
+
+class RouteTest(Test):
+ def __init__(self, env, parent):
+ super(RouteTest, self).__init__(env, parent)
+
+ self.Add(env, self)
+ self.Remove(env, self)
+
+ def do_run(self, session):
+ self.run_children(session)
+
+ class Add(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg).show_peer(s, self.env.link).show_bridge_add(s)
+
+ vhost = self.env.vhost
+ exchange = Exchange.selectBy(vhost=vhost, name=self.env.broker_exchange.name)[0]
+ form.exchange.set(s, str(exchange.id))
+
+ form.key.set(s, "cumin.key")
+ form.tag.set(s, "cumin.tag")
+ form.excludes.set(s, "cumin.tag")
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ def predicate():
+ for item in Bridge.selectBy(link=self.env.link, dest=self.env.broker_exchange.name, key="cumin.key"):
+ return True
+
+ wait(predicate)
+
+ try:
+ self.env.bridge = Bridge.selectBy(link=self.env.link, dest=self.env.broker_exchange.name, key="cumin.key")[0]
+ except IndexError:
+ raise Exception("Route not created")
+
+ class Remove(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg).show_peer(s, self.env.link).show_routes_close(s)
+
+ ids = [self.env.bridge.id]
+ form.ids.set(s, ids)
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ def predicate():
+ return self.env.bridge.deletionTime
+
+ wait(predicate)
+
+ # if it timed out, raise an exception
+ if not self.env.bridge.deletionTime:
+ raise Exception("Route not removed")
+
class BrokerRegistrationTest(Test):
def __init__(self, env, parent):
super(BrokerRegistrationTest, self).__init__(env, parent)
@@ -381,6 +510,7 @@
QueueTest(env, self)
ExchangeTest(env, self)
ConnectionTest(env, self)
+ BrokerLinkTest(env, self)
def do_run(self, session):
def predicate():
@@ -397,113 +527,249 @@
self.run_children(session)
-class QueueTest(Test):
+class BindQueueTest(Test):
def __init__(self, env, parent):
- super(QueueTest, self).__init__(env, parent)
+ super(BindQueueTest, self).__init__(env, parent)
- self.Add(env, self)
- self.Bind(env, self)
- self.Remove(env, self)
-
- self.queue = None
+ self.BindDirect(env, self)
+ self.BindTopic(env, self)
+ self.BindFanout(env, self)
+ self.BindHeaders(env, self)
+ self.RemoveBindDirect(env, self)
- def set_queue(self, queue):
- self.queue = queue
+ def do_run(self, session):
+ self.run_children(session)
- def get_queue(self):
- return self.queue
-
- def do_run(self, session):
- vhost = self.env.vhost
- name = self.env.broker_queue.name
+ class BindDirect(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
- def predicate():
- for item in Queue.selectBy(vhost=vhost, name=name):
- return True
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg)
+ form = form.show_queue(s, self.env.queue)
+ form = form.show_queue_binding_add(s)
+ binding = dict()
+ binding["test"] = {}
+ direct = binding["test"]
+ direct["name"] = "amq.direct"
+ direct["type"] = "direct"
+ form.bindings.dict_param.set(s, binding)
+
+ form.submit(s)
+ p.process(s)
- wait(predicate)
+ self.env.check_redirect(p, s)
- try:
- self.env.queue = Queue.selectBy(vhost=vhost, name=name)[0]
- except IndexError:
- raise Exception("Queue not found")
+ def predicate():
+ for item in Binding.selectBy(queue=self.env.queue, bindingKey=self.env.queue.name):
+ return True
- self.run_children(session)
+ wait(predicate)
- class Add(Test):
+ # if it timed out, raise an exception
+ try:
+ self.env.binding_direct = Binding.selectBy(queue=self.env.queue, bindingKey=self.env.queue.name)[0]
+ except IndexError:
+ raise Exception("Direct Binding not added")
+
+ class BindTopic(Test):
def do_run(self, session):
- name = "cumin.queue.%s" % session.id
p, s = self.env.page_and_session()
reg = self.env.broker_registration
- form = p.show_main(s).show_broker(s, reg).show_queue_add(s)
- form.namef.set(s, name)
- form.durable.set(s, "durable")
- form.autodelete.set(s, "preserve")
-
+ form = p.show_main(s).show_broker(s, reg)
+ form = form.show_queue(s, self.env.queue)
+ form = form.show_queue_binding_add(s)
+ binding = dict()
+ binding["test"] = {}
+ direct = binding["test"]
+ direct["name"] = "amq.topic"
+ direct["type"] = "topic"
+ direct["key"] = "topic.key"
+ form.bindings.dict_param.set(s, binding)
+
form.submit(s)
p.process(s)
self.env.check_redirect(p, s)
- vhost = self.env.vhost
-
- # wait for newly created queue to show up
def predicate():
- for item in Queue.selectBy(vhost=vhost, name=name):
+ for item in Binding.selectBy(queue=self.env.queue, bindingKey="topic.key"):
return True
wait(predicate)
# if it timed out, raise an exception
try:
- queue = Queue.selectBy(vhost=vhost, name=name)[0]
- self.parent.set_queue(queue)
+ Binding.selectBy(queue=self.env.queue, bindingKey="topic.key")[0]
except IndexError:
- raise Exception("Queue %s not added" % name)
- self.parent.set_queue(None)
+ raise Exception("Topic Binding not added")
- class Bind(Test):
+ class BindFanout(Test):
def do_run(self, session):
- name = "cumin.queue.%s" % session.id
- queue = self.parent.get_queue()
- if not queue:
- raise Exception("Bind skipped because Queue %s not added" % name)
+ p, s = self.env.page_and_session()
- # try to bind to it
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg)
+ form = form.show_queue(s, self.env.queue)
+ form = form.show_queue_binding_add(s)
+ binding = dict()
+ binding["test"] = {}
+ direct = binding["test"]
+ direct["name"] = "amq.fanout"
+ direct["type"] = "fanout"
+ form.bindings.dict_param.set(s, binding)
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ def predicate():
+ for item in Binding.selectBy(queue=self.env.queue):
+ if item.exchange.name == "amq.fanout":
+ return True
+
+ wait(predicate)
+
+ for item in Binding.selectBy(queue=self.env.queue):
+ if item.exchange.name == "amq.fanout":
+ return
+
+ raise Exception("Fanout Binding not added")
+
+ class BindHeaders(Test):
+ def do_run(self, session):
p, s = self.env.page_and_session()
reg = self.env.broker_registration
form = p.show_main(s).show_broker(s, reg)
- form = form.show_queue(s, queue)
+ form = form.show_queue(s, self.env.queue)
form = form.show_queue_binding_add(s)
binding = dict()
binding["test"] = {}
direct = binding["test"]
- direct["name"] = "amq.direct"
- direct["type"] = "direct"
+ direct["name"] = "amq.match"
+ direct["type"] = "headers"
+ direct["key"] = "headers.key"
+ direct["x-match"] = "all"
+ direct["mkey.1"] = "key1"
+ direct["mkey.1.nv"] = "name.value.1"
form.bindings.dict_param.set(s, binding)
form.submit(s)
+ p.process(s)
+ self.env.check_redirect(p, s)
+
+ def predicate():
+ for item in Binding.selectBy(queue=self.env.queue, bindingKey="headers.key"):
+ return True
+
+ wait(predicate)
+
+ # if it timed out, raise an exception
+ try:
+ Binding.selectBy(queue=self.env.queue, bindingKey="headers.key")[0]
+ except IndexError:
+ raise Exception("Headers Binding not added")
+
+ class RemoveBindDirect(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg)
+ form = form.show_queue_bindings_remove(s, self.env.queue)
+
+ ids = [self.env.binding_direct.id]
+ form.ids.set(s, ids)
+
+ form.submit(s)
p.process(s)
self.env.check_redirect(p, s)
+ def predicate():
+ return self.env.binding_direct.deletionTime
+
+ wait(predicate)
+
+ # if it timed out, raise an exception
+ if not self.env.binding_direct.deletionTime:
+ raise Exception("Direct Binding not removed")
+
+class AddQueueTest(Test):
+ def __init__(self, env, parent):
+ super(AddQueueTest, self).__init__(env, parent)
+
+ BindQueueTest(env, self)
+
+ def do_run(self, session):
+ name = "cumin.queue.%s" % session.id
+ p, s = self.env.page_and_session()
+
+ reg = self.env.broker_registration
+ form = p.show_main(s).show_broker(s, reg).show_queue_add(s)
+ form.namef.set(s, name)
+ form.durable.set(s, "durable")
+ form.autodelete.set(s, "preserve")
+
+ form.submit(s)
+ p.process(s)
+
+ self.env.check_redirect(p, s)
+
+ vhost = self.env.vhost
+
+ # wait for newly created queue to show up
+ def predicate():
+ for item in Queue.selectBy(vhost=vhost, name=name):
+ return True
+
+ wait(predicate)
+
+ # if it timed out, raise an exception
+ try:
+ self.env.queue = Queue.selectBy(vhost=vhost, name=name)[0]
+ except IndexError:
+ raise Exception("Queue %s not added" % name)
+
+ self.run_children(session)
+
+
+class QueueTest(Test):
+ def __init__(self, env, parent):
+ super(QueueTest, self).__init__(env, parent)
+
+ AddQueueTest(env, self)
+ self.Remove(env, self)
+
+ def do_run(self, session):
+ vhost = self.env.vhost
+ name = self.env.broker_queue.name
+
+ def predicate():
+ for item in Queue.selectBy(vhost=vhost, name=name):
+ return True
+
+ wait(predicate)
+
+ try:
+ self.env.broker_queue = Queue.selectBy(vhost=vhost, name=name)[0]
+ except IndexError:
+ raise Exception("Queue not found")
+
+ self.run_children(session)
+
class Remove(Test):
def do_run(self, session):
- name = "cumin.queue.%s" % session.id
- queue = self.parent.get_queue()
- if not queue:
- raise Exception("Remove skipped because Queue %s not added" % name)
-
- # try to delete it
p, s = self.env.page_and_session()
reg = self.env.broker_registration
form = p.show_main(s).show_broker(s, reg).show_queues_remove(s)
- ids = [queue.id]
+ ids = [self.env.queue.id]
form.ids.set(s, ids)
form.submit(s)
@@ -513,22 +779,20 @@
# wait for newly created queue to get marked as deleted
def predicate():
- return queue.deletionTime
+ return self.env.queue.deletionTime
wait(predicate)
# if it timed out, raise an exception
- if not queue.deletionTime:
- raise Exception("Queue %s not removed" % name)
+ if not self.env.queue.deletionTime:
+ raise Exception("Queue not removed")
class ExchangeTest(Test):
def __init__(self, env, parent):
super(ExchangeTest, self).__init__(env, parent)
self.Add(env, self)
- self.Added(env, self)
self.Remove(env, self)
- self.Removed(env, self)
def do_run(self, session):
vhost = self.env.vhost
@@ -556,11 +820,7 @@
self.env.check_redirect(p, s)
- class Added(Test):
- def do_run(self, session):
vhost = self.env.vhost
- name = "cumin.exchange.%s" % session.id
-
# wait for newly created exchange to show up
def predicate():
for item in Exchange.selectBy(vhost=vhost, name=name):
@@ -590,8 +850,6 @@
self.env.check_redirect(p, s)
- class Removed(Test):
- def do_run(self, session):
name = "cumin.exchange.%s" % session.id
# wait for newly created exchange to get marked as deleted
@@ -603,7 +861,6 @@
if not self.env.added_exchange.deletionTime:
raise Exception("Exchange %s not removed" % name)
-
class ConnectionTest(Test):
def do_run(self, session):
raise Exception("Not implemented")
16 years, 7 months
rhmessaging commits: r2315 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-15 10:48:59 -0400 (Fri, 15 Aug 2008)
New Revision: 2315
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
Log:
Making RouteAdd parameters non private (no __) so test.py can set them
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-15 12:54:07 UTC (rev 2314)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-15 14:48:59 UTC (rev 2315)
@@ -411,22 +411,22 @@
def __init__(self, app, name):
super(BridgeAdd, self).__init__(app, name)
- self.__exchange = ExchangeRadioField(app, "exchange", self)
- self.add_field(self.__exchange)
+ self.exchange = ExchangeRadioField(app, "exchange", self)
+ self.add_field(self.exchange)
- self.__key = TextField(app, "key", self)
- self.__key.set_title("Routing Key")
- self.add_field(self.__key)
+ self.key = TextField(app, "key", self)
+ self.key.set_title("Routing Key")
+ self.add_field(self.key)
- self.__tag = TextField(app, "tag", self)
- self.__tag.set_required(False)
- self.__tag.set_title("Tag")
- self.add_field(self.__tag)
+ self.tag = TextField(app, "tag", self)
+ self.tag.set_required(False)
+ self.tag.set_title("Tag")
+ self.add_field(self.tag)
- self.__excludes = TextField(app, "excludes", self)
- self.__excludes.set_required(False)
- self.__excludes.set_title("Excludes")
- self.add_field(self.__excludes)
+ self.excludes = TextField(app, "excludes", self)
+ self.excludes.set_required(False)
+ self.excludes.set_title("Excludes")
+ self.add_field(self.excludes)
def get_args(self, session):
@@ -436,13 +436,13 @@
return "Add Route to '%s:%d'" % (link.host, link.port)
def pre_process(self, session, *args):
- self.__exchange.pre_process(session, *args)
+ self.exchange.pre_process(session, *args)
def process_cancel(self, session, *args):
- self.__key.set(session, "")
- self.__tag.set(session, "")
- self.__excludes.set(session, "")
- self.__exchange.set(session, "")
+ self.key.set(session, "")
+ self.tag.set(session, "")
+ self.excludes.set(session, "")
+ self.exchange.set(session, "")
branch = session.branch()
self.frame.show_view(branch)
@@ -453,10 +453,10 @@
if errors:
pass
else:
- key = self.__key.get(session)
- tag = self.__tag.get(session)
- excludes = self.__excludes.get(session)
- exchange_id = self.__exchange.get(session)
+ key = self.key.get(session)
+ tag = self.tag.get(session)
+ excludes = self.excludes.get(session)
+ exchange_id = self.exchange.get(session)
exchange = Exchange.get(int(exchange_id))
durable = exchange.durable
16 years, 7 months
rhmessaging commits: r2314 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-15 08:54:07 -0400 (Fri, 15 Aug 2008)
New Revision: 2314
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
Log:
Fix imports to get the correct Link
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-15 12:49:07 UTC (rev 2313)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-15 12:54:07 UTC (rev 2314)
@@ -1,16 +1,13 @@
-from cumin.binding import ExchangeKeysField, ExchangeState
-from cumin.exchange import ExchangeInfo
-from formats import *
-from model import *
-from parameters import *
-from stat import *
-from util import *
-from widgets import *
+from mint import *
from wooly import *
-from wooly.forms import *
-from wooly.resources import *
from wooly.widgets import *
+from queue import *
+from exchange import *
+from widgets import *
+from parameters import *
+from formats import *
+from util import *
strings = StringCatalog(__file__)
16 years, 7 months
rhmessaging commits: r2313 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-15 08:49:07 -0400 (Fri, 15 Aug 2008)
New Revision: 2313
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.strings
Log:
Remove extraneous {phase} from BrokerLinkAdd
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-15 11:36:55 UTC (rev 2312)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-15 12:49:07 UTC (rev 2313)
@@ -156,7 +156,6 @@
<div class="head">{title}</div>
<div class="body">
<div class="field multiple">
- <div class="rfloat">{phase}</div>
<div class="title">Source Broker</div>
<div class="inputs"><div class="input_prompt">Address</div><input type="text" name="{broker_name_path}" value="{broker_name_value}" tabindex="100" size="32"/>{broker_name_error}</div>
<div class="optional">
16 years, 7 months
rhmessaging commits: r2312 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-08-15 07:36:55 -0400 (Fri, 15 Aug 2008)
New Revision: 2312
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Minor correction where variable is used only in assert.
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-08-14 20:40:44 UTC (rev 2311)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-08-15 11:36:55 UTC (rev 2312)
@@ -1037,8 +1037,7 @@
// Write abort record
txn_rec ar(amagic, ++rd._h_rid, xid.data(), xid.size(), rd._owi);
- u_int32_t res = ar.encode(buff, 0, abort_dblks);
- assert(res == abort_dblks);
+ ar.encode(buff, 0, abort_dblks);
ofs.write((const char*)buff, JRNL_DBLK_SIZE);
assert(!ofs.fail());
// log write action
16 years, 7 months
rhmessaging commits: r2311 - in store/branches/mrg-1.0/cpp: rhel4-support and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-08-14 16:40:44 -0400 (Thu, 14 Aug 2008)
New Revision: 2311
Modified:
store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp
store/branches/mrg-1.0/cpp/rhel4-support/rhel4.patch
Log:
Minor corrections
Modified: store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp 2008-08-14 18:50:27 UTC (rev 2310)
+++ store/branches/mrg-1.0/cpp/lib/jrnl/jcntl.cpp 2008-08-14 20:40:44 UTC (rev 2311)
@@ -1043,8 +1043,7 @@
// Write abort record
txn_rec ar(amagic, ++rd._h_rid, xid.data(), xid.size(), rd._owi);
- u_int32_t res = ar.encode(buff, 0, abort_dblks);
- assert(res == abort_dblks);
+ ar.encode(buff, 0, abort_dblks);
ofs.write((const char*)buff, JRNL_DBLK_SIZE);
assert(!ofs.fail());
// log write action
Modified: store/branches/mrg-1.0/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/branches/mrg-1.0/cpp/rhel4-support/rhel4.patch 2008-08-14 18:50:27 UTC (rev 2310)
+++ store/branches/mrg-1.0/cpp/rhel4-support/rhel4.patch 2008-08-14 20:40:44 UTC (rev 2311)
@@ -253,7 +253,7 @@
===================================================================
--- lib/BdbMessageStore.cpp (revision 2179)
+++ lib/BdbMessageStore.cpp (working copy)
-@@ -224,10 +224,6 @@
+@@ -226,10 +226,6 @@
try {
env.open(getBdbBaseDir().c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON, 0);
} catch (const DbException& e) {
16 years, 7 months
rhmessaging commits: r2310 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-14 14:50:27 -0400 (Thu, 14 Aug 2008)
New Revision: 2310
Modified:
mgmt/trunk/cumin/python/cumin/brokerlink.py
mgmt/trunk/cumin/python/cumin/brokerlink.strings
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added Route (bridge) remove
Changed PeerRouteSet from a PaginatedItemSet to an SQLTable to allow for selecting multiple routes, filtering, and sorting
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-14 18:46:21 UTC (rev 2309)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.py 2008-08-14 18:50:27 UTC (rev 2310)
@@ -18,9 +18,12 @@
def __init__(self, app, name):
super(PeerSet, self).__init__(app, name)
- self.ids = CheckboxIdColumn(app, "id", self)
+ self.ids = FilteredCheckboxIdColumn(app, "id", self, callback=self.disable_closed)
self.add_column(self.ids)
+ #self.ids = CheckboxIdColumn(app, "id", self)
+ #self.add_column(self.ids)
+
col = self.AddressColumn(app, "addr")
self.add_column(col)
@@ -61,6 +64,9 @@
def get_sql_values(self, session, vhost):
return {"vhost_id": vhost.id}
+ def disable_closed(self, session, data):
+ return data["state"] == "Closed"
+
class AddressColumn(SqlTableColumn):
def render_title(self, session, data):
return "Address"
@@ -115,6 +121,96 @@
frame.ids.set(branch, ids)
self.page.set_redirect_url(session, branch.marshal())
+class PeerRouteSet(CuminTable, Form):
+ def __init__(self, app, name):
+ super(PeerRouteSet, self).__init__(app, name)
+
+ self.ids = CheckboxIdColumn(app, "id", self)
+ self.add_column(self.ids)
+
+ #col = self.SourceColumn(app, "source")
+ #self.add_column(col)
+
+ #col = self.DestinationColumn(app, "managed_broker")
+ #self.add_column(col)
+
+ col = self.ExchangeColumn(app, "exchange")
+ self.add_column(col)
+
+ col = self.KeyColumn(app, "key")
+ self.add_column(col)
+
+ col = self.TagColumn(app, "tag")
+ self.add_column(col)
+
+ col = self.ExcludesColumn(app, "excludes")
+ self.add_column(col)
+
+ self.__remove = self.Remove(app, "remove", self)
+ self.add_child(self.__remove)
+
+ def get_args(self, session):
+ return self.frame.get_args(session)
+
+ def render_title(self, session, link):
+ count = self.get_item_count(session, link)
+ return "Link Routes %s" % fmt_count(count)
+
+ def render_sql_where(self, session, link):
+ return "where l.id = %(link_id)r and b.deletion_time is null"
+
+ def get_sql_values(self, session, link):
+ return {"link_id": link.id}
+
+ def render_add_bridge_url(self, session, route):
+ branch = session.branch()
+ self.frame.show_bridge_add(branch)
+ return branch.marshal()
+
+ class SourceColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Source"
+
+ def render_content(self, session, data):
+ return "%s:%i" % (data["host"], data["port"])
+
+ def get_orderby_sql(self, session):
+ dir = self.parent.is_reversed(session) and "desc" or "asc"
+ return "order by l.host, l.port %s" % dir
+
+ class DestinationColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Destination"
+
+ class ExchangeColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Exchange"
+
+ class KeyColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Routing Key"
+
+ class TagColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Tag"
+
+ class ExcludesColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Excludes"
+
+ class Remove(FormButton):
+ def render_content(self, session):
+ return "Remove"
+
+ def process_submit(self, session):
+ ids = self.parent.ids.get(session)
+ self.parent.ids.clear(session)
+
+ branch = session.branch()
+ frame = self.frame.show_routes_close(branch)
+ frame.ids.set(branch, ids)
+ self.page.set_redirect_url(session, branch.marshal())
+
class PeerFrame(CuminFrame):
def __init__(self, app, name):
super(PeerFrame, self).__init__(app, name)
@@ -132,6 +228,10 @@
self.__bridge_add = BridgeAdd(app, "bridgeadd")
self.add_mode(self.__bridge_add)
+
+ self.__routes_close = PeerRouteSetClose(app, "routesclose")
+ self.add_mode(self.__routes_close)
+
def render_title(self, session, peer):
return super(PeerFrame, self).render_title(session, peer)
@@ -140,6 +240,10 @@
self.page.set_current_frame(session, self.__bridge_add)
return self.show_mode(session, self.__bridge_add)
+ def show_routes_close(self, session):
+ self.page.set_current_frame(session, self.__routes_close)
+ return self.show_mode(session, self.__routes_close)
+
class LinkRemove(CuminConfirmForm):
def get_args(self, session):
return self.frame.get_args(session)
@@ -209,38 +313,6 @@
data = "model.xml?class=peer;id=%i" % peer.id
return "wooly.setIntervalUpdate('%s', updatePeer, 3000)" % data
-class PeerRouteSet(PaginatedItemSet):
- def get_args(self, session):
- return self.frame.get_args(session)
-
- def render_title(self, session, peer):
- return "Link Routes %s" % \
- fmt_count(self.get_item_count(session, peer))
-
- def get_item_count(self, session, peer):
- return peer.bridges.count()
-
- def do_get_items(self, session, peer):
- start, end = self.get_bounds(session)
- return peer.bridges[start:end]
-
- def render_add_bridge_url(self, session, route):
- branch = session.branch()
- self.frame.show_bridge_add(branch)
- return branch.marshal()
-
- def render_item_destination(self, session, route):
- return route.link.managedBroker
-
- def render_item_src(self, session, route):
- return "%s:%d" % (route.link.host, route.link.port)
-
- def render_item_exchange(self, session, route):
- return route.dest
-
- def render_item_routing_key(self, session, route):
- return route.key
-
class PeerStats(TabbedModeSet):
def __init__(self, app, name):
super(PeerStats, self).__init__(app, name)
@@ -541,10 +613,33 @@
return "Close Broker Link"
def render_form_heading(self, session, *args):
- return "Close Link to:"
+ return "Close Link to"
def render_item_content(self, session, id):
link = Link.get(id)
return "Broker: %s:%d" % (link.host, link.port)
-
\ No newline at end of file
+class PeerRouteSetClose(CuminBulkActionForm):
+ def process_return(self, session):
+ branch = session.branch()
+ self.frame.show_view(branch)
+ self.page.set_current_frame(branch, self.frame)
+ self.page.set_redirect_url(session, branch.marshal())
+
+ def process_item(self, session, id):
+ bridge = Bridge.get(id)
+ action = self.app.model.route.remove
+ action.invoke(bridge)
+
+ def render_title(self, session):
+ link = self.parent.get_object(session)
+ return "Remove Route from %s:%i" % (link.host, link.port)
+
+ def render_form_heading(self, session, *args):
+ return "Remove Route"
+
+ def render_item_content(self, session, id):
+ bridge = Bridge.get(id)
+ return "<td>%s</td><td>%s</td>" % (bridge.dest, bridge.key)
+
+
\ No newline at end of file
Modified: mgmt/trunk/cumin/python/cumin/brokerlink.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-14 18:46:21 UTC (rev 2309)
+++ mgmt/trunk/cumin/python/cumin/brokerlink.strings 2008-08-14 18:50:27 UTC (rev 2310)
@@ -47,33 +47,58 @@
<div>{hidden_inputs}</div>
</form>
+[PeerRouteSet.sql]
+select
+ b.id,
+ b.src,
+ b.dest as exchange,
+ b.key,
+ b.tag,
+ b.excludes,
+ l.host,
+ l.port,
+ l.managed_broker
+from bridge as b
+join link as l on l.id = b.link_id
+left outer join bridge_stats as c on c.id = b.stats_curr_id
+left outer join bridge_stats as p on p.id = b.stats_prev_id
+{sql_where}
+{sql_orderby}
+{sql_limit}
+
+[PeerRouteSet.count_sql]
+select count(*)
+from bridge as b
+join link as l on l.id = b.link_id
+{sql_where}
+
[PeerRouteSet.html]
+<form id="{id}" method="post" action="?">
+
<ul class="actions">
<li><a class="nav" href="{add_bridge_url}">Add Route</a></li>
</ul>
-<div class="rfloat">{page}</div>
-<ul class="radiotabs"> </ul>
+ <div class="sactions">
+ <h2>Act on Selected Routes:</h2>
+ {remove}
+ </div>
-<table class="ExchangeBindingSet mobjects">
- <tr>
- <th>Source</th>
- <th>Destination</th>
- <th>Exchange</th>
- <th>Routing Key</th>
- </tr>
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th class="setnav" colspan="{column_count}">
+ <div class="rfloat">{page}</div>
+ {count}
+ </th>
+ </tr>
+ <tr>{headers}</tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+ <div>{hidden_inputs}</div>
+</form>
- {items}
-</table>
-
-[PeerRouteSet.item_html]
-<tr>
- <td>{item_src}</td>
- <td>{item_destination}</a></td>
- <td>{item_exchange}</td>
- <td>{item_routing_key}</td>
-</tr>
-
[BrokerLinkAdd.css]
div.field div.input_prompt {
width: 5em;
@@ -169,3 +194,34 @@
{exchanges}
</fieldset>
+[PeerRouteSetClose.html]
+<form id="{id}" class="mform" method="post" action="?">
+ <div class="head">
+ <h1>{title}</h1>
+ </div>
+ <div class="body">
+ <span class="legend">{form_heading}</span>
+ <table class="mobjects">
+ <thead>
+ <tr>
+ <th>Exchange</th>
+ <th>Key</th>
+ </tr>
+ </thead>
+ <tbody>{items}</tbody>
+ </table>
+ {hidden_inputs}
+ </div>
+ <div class="foot">
+ {help}
+ {submit}
+ {cancel}
+ </div>
+</form>
+<script type="text/javascript">
+ wooly.doc().elembyid("{id}").node.elements[0].focus();
+</script>
+
+[PeerRouteSetClose.item_html]
+<tr>{item_content}</tr>
+
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-08-14 18:46:21 UTC (rev 2309)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-08-14 18:50:27 UTC (rev 2310)
@@ -1016,8 +1016,23 @@
super(CuminRoute, self).__init__(model, "route",
Bridge, BridgeStats)
- prop = CuminProperty(self, "routeKey")
+ prop = CuminProperty(self, "key")
prop.title = "Route Key"
+
+ prop = CuminProperty(self, "tag")
+ prop.title = "Tag"
+
+ prop = CuminProperty(self, "excludes")
+ prop.title = "Excludes"
+
+ prop = CuminProperty(self, "durable")
+ prop.title = "Durable"
+
+ prop = CuminProperty(self, "dest")
+ prop.title = "Exchange"
+
+ action = self.Remove(self, "remove")
+ #action.summary = True
def get_title(self, session):
return "Route"
@@ -1025,6 +1040,18 @@
def get_object_name(self, route):
return route.src
+ class Remove(CuminAction):
+ def get_title(self, session):
+ return "Remove"
+
+ def show(self, session, peer):
+ frame = self.cumin_class.show_object(session, peer)
+ frame = frame.show_peer(session, peer)
+ return frame.show_remove(session)
+
+ def do_invoke(self, bridge, args, completion):
+ bridge.close(self.cumin_model.data, completion)
+
class CuminConnection(RemoteClass):
def __init__(self, model):
super(CuminConnection, self).__init__(model, "connection",
@@ -1179,9 +1206,11 @@
prop = CuminProperty(self, "useSsl")
prop.title = "Use SSL"
+ prop.summary = True
prop = CuminProperty(self, "durable")
prop.title = "Durable"
+ prop.summary = True
stat = CuminStat(self, "closing")
stat.title = "Closing Down"
16 years, 7 months
rhmessaging commits: r2309 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-14 14:46:21 -0400 (Thu, 14 Aug 2008)
New Revision: 2309
Modified:
mgmt/trunk/cumin/python/cumin/exchange.py
Log:
Using new FilteredCheckboxIdColumn api
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-14 18:45:18 UTC (rev 2308)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-14 18:46:21 UTC (rev 2309)
@@ -36,8 +36,7 @@
def __init__(self, app, name):
super(ExchangeSet, self).__init__(app, name)
- self.ids = FilteredCheckboxIdColumn(app, "id", self, "name",
- ExchangeInfo.get_builtins())
+ self.ids = FilteredCheckboxIdColumn(app, "id", self, callback=self.disable_exchange)
self.add_column(self.ids)
col = self.NameColumn(app, "name")
@@ -76,6 +75,9 @@
reg = self.frame.get_object(session)
return (reg.getDefaultVhost(),)
+ def disable_exchange(self, session, data):
+ return data["name"] in ExchangeInfo.get_builtins()
+
def render_add_exchange_url(self, session, vhost):
branch = session.branch()
self.frame.show_exchange_add(branch)
16 years, 7 months
rhmessaging commits: r2308 - mgmt/trunk/cumin/resources.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-14 14:45:18 -0400 (Thu, 14 Aug 2008)
New Revision: 2308
Modified:
mgmt/trunk/cumin/resources/help.html
Log:
Adding help for Route Remove page
Modified: mgmt/trunk/cumin/resources/help.html
===================================================================
--- mgmt/trunk/cumin/resources/help.html 2008-08-14 18:44:43 UTC (rev 2307)
+++ mgmt/trunk/cumin/resources/help.html 2008-08-14 18:45:18 UTC (rev 2308)
@@ -176,6 +176,24 @@
</li>
</ul>
+
+ <div class="titlepage">
+ <a name="main.broker.peer.routesclose.help"/>
+ <h3 class="title">Remove a Link Route</h3>
+ </div>
+ <p>
+ Closes and deletes a route between the current broker and a linked broker.
+ </p>
+
+<ul class="docnav">
+ <li class="up">
+ <a accesskey="u" href="#top">
+ <strong>Help Index</strong>
+ </a>
+ </li>
+</ul>
+
+
</div><!-- section -->
<div style="height:1000px;"><!-- --></div>
16 years, 7 months