rhmessaging commits: r2257 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 18:55:19 -0400 (Tue, 05 Aug 2008)
New Revision: 2257
Modified:
mgmt/trunk/cumin/python/cumin/binding.py
mgmt/trunk/cumin/python/cumin/binding.strings
Log:
Fix bug when selecting multiple xml or headers exchanges
Modified: mgmt/trunk/cumin/python/cumin/binding.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/binding.py 2008-08-05 21:01:29 UTC (rev 2256)
+++ mgmt/trunk/cumin/python/cumin/binding.py 2008-08-05 22:55:19 UTC (rev 2257)
@@ -124,7 +124,10 @@
return self.render_dict_error(session, exchange, "key")
def render_onclick(self, session, exchange):
- return "onclick=\"toggle_row(this, 'xml_extra')\""
+ return "onclick=\"toggle_row(this, 'xml_extra.%s')\"" % str(exchange.id)
+
+ def render_xml_extra(self, session, exchange):
+ return "xml_extra.%s" % str(exchange.id)
def render_xquery_error(self, session, exchange):
return self.render_dict_error(session, exchange, "xquery")
@@ -190,7 +193,10 @@
return self.render_dict_error(session, exchange, "mkey.3")
def render_onclick(self, session, exchange):
- return "onclick=\"toggle_row(this, 'headers_extra')\""
+ return "onclick=\"toggle_row(this, 'headers_extra.%s')\"" % str(exchange.id)
+
+ def render_headers_extra(self, session, exchange):
+ return "headers_extra.%s" % str(exchange.id)
Modified: mgmt/trunk/cumin/python/cumin/binding.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/binding.strings 2008-08-05 21:01:29 UTC (rev 2256)
+++ mgmt/trunk/cumin/python/cumin/binding.strings 2008-08-05 22:55:19 UTC (rev 2257)
@@ -39,7 +39,7 @@
{exchange_name_input}
{exchange_key_input}
</tr>
- <tr id="xml_extra" class="{headers_class}"><td colspan="4"><table>
+ <tr id="{xml_extra}" class="{headers_class}"><td colspan="4"><table>
<tr>
<td>XQuery:</td>
<td colspan="3"><textarea name="{xquery_path}" id="{exchange_name}"
@@ -51,7 +51,7 @@
{exchange_name_input}
{exchange_key_input}
</tr>
- <tr id="headers_extra" class="{headers_class}"><td colspan="4"><table>
+ <tr id="{headers_extra}" class="{headers_class}"><td colspan="4"><table>
<tr>
<td> </td>
<td>x-match Type:</td>
17 years, 8 months
rhmessaging commits: r2256 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 17:01:29 -0400 (Tue, 05 Aug 2008)
New Revision: 2256
Modified:
mgmt/trunk/cumin/python/cumin/exchange.py
mgmt/trunk/cumin/python/cumin/queue.py
Log:
Removed unused import of pdb
Modified: mgmt/trunk/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-05 21:00:14 UTC (rev 2255)
+++ mgmt/trunk/cumin/python/cumin/exchange.py 2008-08-05 21:01:29 UTC (rev 2256)
@@ -9,7 +9,7 @@
from parameters import *
from formats import *
from util import *
-import pdb
+
strings = StringCatalog(__file__)
class ExchangeInputSet(RadioInputSet):
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-08-05 21:00:14 UTC (rev 2255)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-08-05 21:01:29 UTC (rev 2256)
@@ -1,4 +1,4 @@
-import pdb, logging
+import logging
from mint.schema import Queue, Journal, Exchange
from wooly import *
17 years, 8 months
rhmessaging commits: r2255 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 17:00:14 -0400 (Tue, 05 Aug 2008)
New Revision: 2255
Modified:
mgmt/trunk/cumin/python/wooly/__init__.py
mgmt/trunk/cumin/python/wooly/parameters.py
Log:
Added DictParameter class to handle complex form inputs
Modified: mgmt/trunk/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/__init__.py 2008-08-05 20:59:30 UTC (rev 2254)
+++ mgmt/trunk/cumin/python/wooly/__init__.py 2008-08-05 21:00:14 UTC (rev 2255)
@@ -60,6 +60,7 @@
super(Parameter, self).__init__(app, name)
self.is_collection = False
+ self.is_dictionary = False
app.add_parameter(self)
@@ -440,7 +441,15 @@
self.parameter_index = index
- return self.parameter_index.get((page, key))
+ param = self.parameter_index.get((page, key))
+
+ # check for partial match for dictparameters
+ if not param:
+ if "_" in key:
+ dict_key = key.split("_", 1)[0]
+ param = self.parameter_index.get((page, dict_key))
+
+ return param
def add_resource_dir(self, dir):
self.finder.add_dir(dir)
@@ -596,7 +605,10 @@
param = self.app.get_parameter(self.get_page(), key)
if param:
- param.add(self, param.unmarshal(value))
+ if param.is_dictionary:
+ param.add(self, param.unmarshal(value), key)
+ else:
+ param.add(self, param.unmarshal(value))
except ValueError:
pass
Modified: mgmt/trunk/cumin/python/wooly/parameters.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/parameters.py 2008-08-05 20:59:30 UTC (rev 2254)
+++ mgmt/trunk/cumin/python/wooly/parameters.py 2008-08-05 21:00:14 UTC (rev 2255)
@@ -2,6 +2,55 @@
from wooly import *
+class DictParameter(Parameter):
+ def __init__(self, app, name, key):
+ super(DictParameter, self).__init__(app, name)
+
+ self.default = dict()
+ self.is_dictionary = True
+ self.clear_on_add = False
+
+ def set_clear_on_add(self):
+ self.clear_on_add = True
+
+ def add(self, session, value, full_key):
+ # full_key looks like <DictParameter.path>_<stuff>
+
+ if self.clear_on_add:
+ self.clear()
+ self.clear_on_add = False
+
+ keys = self.get(session)
+
+ # separate the DictParameter.path from the stuff
+ foo, stuff = full_key.split("_", 1)
+ if stuff:
+ self.split_stuff(keys, stuff, value)
+
+ def split_stuff(self, keys, stuff, value):
+ """ Each time there is an _ in stuff,
+ create a nested dictionary entry """
+
+ # can't use: stuff_1, stuff_2 = stuff.split("_", 1)
+ stuff_list = stuff.split("_", 1)
+ stuff_1 = stuff_list[0]
+ if len(stuff_list) > 1:
+ stuff_2 = stuff_list[1]
+ if not stuff_1 in keys:
+ keys[stuff_1] = dict()
+ self.split_stuff(keys[stuff_1], stuff_2, value)
+ else:
+ if value:
+ keys[stuff_1] = value
+ elif stuff_1 in keys:
+ del keys[stuff_1]
+
+ def get_instance_key(self, key):
+ return "_".join((self.path, key))
+
+ def clear(self):
+ self.default = dict()
+
class ListParameter(Parameter):
def __init__(self, app, name, param):
super(ListParameter, self).__init__(app, name)
17 years, 8 months
rhmessaging commits: r2254 - mgmt/trunk/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:59:30 -0400 (Tue, 05 Aug 2008)
New Revision: 2254
Modified:
mgmt/trunk/cumin/python/wooly/forms.py
Log:
Added get_form and get_parent_named helper methods
Modified: mgmt/trunk/cumin/python/wooly/forms.py
===================================================================
--- mgmt/trunk/cumin/python/wooly/forms.py 2008-08-05 20:58:19 UTC (rev 2253)
+++ mgmt/trunk/cumin/python/wooly/forms.py 2008-08-05 20:59:30 UTC (rev 2254)
@@ -254,6 +254,9 @@
self.__param = param
return param
+
+ def get_form(self):
+ return self.__form
def get(self, session):
return self.__param.get(session)
@@ -275,6 +278,13 @@
if self.__errors.attr.get(session):
return self.__errors.render(session)
+ def get_parent_named(self, name):
+ progenitor = self.parent
+ while progenitor:
+ if progenitor.path.endswith(name):
+ return progenitor
+ progenitor = progenitor.parent
+
class FormFieldErrors(ItemSet):
def __init__(self, app, name):
super(FormFieldErrors, self).__init__(app, name)
17 years, 8 months
rhmessaging commits: r2253 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:58:19 -0400 (Tue, 05 Aug 2008)
New Revision: 2253
Modified:
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Added optional error field to CuminFieldForm
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-08-05 20:57:21 UTC (rev 2252)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-08-05 20:58:19 UTC (rev 2253)
@@ -13,6 +13,7 @@
<form id="{id}" class="mform" method="post" action="?">
<div class="head">{title}</div>
<div class="body">{fields}</div>
+ {form_error}
<div class="foot">
{submit}
{cancel}
@@ -70,7 +71,7 @@
<h1>{title}</h1>
</div>
<div class="body">
- <span class="legend">Actions</span>
+ <span class="legend">{form_heading}</span>
<fieldset>
<ul>{items}</ul>
</fieldset>
17 years, 8 months
rhmessaging commits: r2252 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:57:21 -0400 (Tue, 05 Aug 2008)
New Revision: 2252
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Changed BindingSet to a CuminTable to allow for active/idle/deleted
Fixed bug with Durable/Exclusive/AutoDelete fields
Added FilteredCheckboxIdSet to not allow removing of built-in exchanges
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-05 20:52:35 UTC (rev 2251)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-08-05 20:57:21 UTC (rev 2252)
@@ -5,7 +5,7 @@
from wooly.widgets import *
from wooly.forms import *
from wooly.tables import *
-from mint import *
+from mint.schema import *
from parameters import *
from charts import *
@@ -185,7 +185,8 @@
return self.parent.render_submit_content(session, *cargs)
class CuminFieldForm(CuminForm, FieldForm, Frame):
- pass
+ def render_form_error(self, session, *args):
+ pass
class CuminConfirmForm(CuminForm):
def __init__(self, app, name):
@@ -227,6 +228,10 @@
def render_item_content(self, session, id):
return "Act on object %i" % id
+
+ def render_form_heading(self, session, *args):
+ return "Actions"
+
class CuminStatus(Widget):
def get_args(self, session):
@@ -462,46 +467,61 @@
def render_item_content(self, session, group):
return group.name
-class BindingSet(PaginatedItemSet):
+class BindingSet(CuminTable):
def __init__(self, app, name):
super(BindingSet, self).__init__(app, name)
- def render_title(self, session, *args):
- return "Bindings"
+ self.ids = CheckboxIdColumn(app, "id", self)
+ self.add_column(self.ids)
+
+ col = self.get_name_col(app)
+ self.add_column(col)
- def get_item_count(self, session, *args):
- return Binding.select().count()
+ col = self.KeyColumn(app, "key")
+ self.add_column(col)
- def do_get_items(self, session, *args):
- start, end = self.get_bounds(session)
- return Binding.select()[start:end]
+ col = self.RateColumn(app, "rate")
+ col.alignment = "right"
+ self.add_column(col)
- def render_item_binding_key(self, session, binding):
- return binding.bindingKey
+ col = self.MatchedColumn(app, "matched")
+ col.alignment = "right"
+ self.add_column(col)
+
+ self.phase = PhaseSwitch(app, "phase")
+ self.add_child(self.phase)
- def render_item_messages_matched(self, session, binding):
- return self.app.model.binding.msgMatched.value(binding)
+ def get_args(self, session):
+ 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}
- def render_item_messages_matched_rate(self, session, binding):
- return self.app.model.binding.msgMatched.rate_html(binding)
+ class KeyColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Key"
-class RouteSet(PaginatedItemSet):
- def __init__(self, app, name):
- super(RouteSet, self).__init__(app, name)
+ class RateColumn(ItemTableColumn):
+ def render_title(self, session, data):
+ return "Message Rate"
- def render_title(self, session, *args):
- return "Routes"
+ def render_content(self, session, data):
+ binding = Binding.get(data["id"])
+ return self.app.model.binding.msgMatched.rate_html(binding)
- def get_item_count(self, session, *args):
- return Bridge.select().count()
+ class MatchedColumn(ItemTableColumn):
+ def render_title(self, session, data):
+ return "Messages Matched"
+
+ def render_content(self, session, data):
+ binding = Binding.get(data["id"])
+ return self.app.model.binding.msgMatched.value(binding)
- def do_get_items(self, session, *args):
- start, end = self.get_bounds(session)
- return Bridge.select()[start:end]
-
- def render_item_route_key(self, session, route):
- return route.key
-
class CheckboxIdColumn(SqlTableColumn):
def __init__(self, app, name, form):
super(CheckboxIdColumn, self).__init__(app, name)
@@ -536,6 +556,20 @@
def render_elem_name(self, session, *args):
return self.column.ids.path
+class FilteredCheckboxIdColumn(CheckboxIdColumn):
+ def __init__(self, app, name, form, col_name, skip_list):
+ super(FilteredCheckboxIdColumn, self).__init__(app, name, form)
+
+ # list of names to skip putting a checkbox by
+ self.__skip_list = skip_list
+ self.__col_name = col_name
+
+ def do_render(self, session, data):
+ if data[self.__col_name] in self.__skip_list:
+ return "<td></td>"
+ else:
+ return super(FilteredCheckboxIdColumn, self).do_render(session, data)
+
class NameField(StringField):
def __init__(self, app, name, form):
super(NameField, self).__init__(app, name, form)
@@ -619,8 +653,13 @@
self.add_parameter(param)
self.set_parameter(param)
- self.add_option(self.Durable(app, "durable", form))
- self.add_option(self.Transient(app, "transient", form))
+ option = self.Durable(app, "durable", form)
+ option.set_value(param.default)
+ self.add_option(option)
+
+ option = self.Transient(app, "transient", form)
+ option.set_value("transient")
+ self.add_option(option)
def render_title(self, session):
return "Durable?"
@@ -648,8 +687,13 @@
self.add_parameter(param)
self.set_parameter(param)
- self.add_option(self.Exclusive(app, "exclusive", form))
- self.add_option(self.NonExclusive(app, "non-exclusive", form))
+ option = self.Exclusive(app, "exclusive", form)
+ option.set_value(param.default)
+ self.add_option(option)
+
+ option = self.NonExclusive(app, "non-exclusive", form)
+ option.set_value("non-exclusive")
+ self.add_option(option)
def render_title(self, session):
return "Exclusive?"
@@ -677,9 +721,14 @@
self.add_parameter(param)
self.set_parameter(param)
- self.add_option(self.AutoDel(app, "autodel", form))
- self.add_option(self.Preserve(app, "preserve", form))
+ option = self.AutoDel(app, "autodel", form)
+ option.set_value(param.default)
+ self.add_option(option)
+ option = self.Preserve(app, "preserve", form)
+ option.set_value("preserve")
+ self.add_option(option)
+
def render_title(self, session):
return "Auto-Delete?"
17 years, 8 months
rhmessaging commits: r2251 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:52:35 -0400 (Tue, 05 Aug 2008)
New Revision: 2251
Modified:
mgmt/trunk/cumin/python/cumin/util.py
Log:
Added is_active utility function for determining active exchanges to be listed on the binding forms.
Modified: mgmt/trunk/cumin/python/cumin/util.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/util.py 2008-08-05 20:51:01 UTC (rev 2250)
+++ mgmt/trunk/cumin/python/cumin/util.py 2008-08-05 20:52:35 UTC (rev 2251)
@@ -1,8 +1,9 @@
-import sys
-from time import mktime
from ConfigParser import SafeConfigParser
+from datetime import *
from logging import getLogger
from random import randint
+from time import mktime
+import sys
def short_id():
return "%08x" % randint(0, sys.maxint)
@@ -39,6 +40,15 @@
return host, port
+def is_active(obj):
+ delTime = obj._get_deletionTime()
+ if not delTime:
+ recTime = obj.statsCurr.recTime
+ delta = timedelta(minutes=10)
+ # mirroring logic in widgets/PhaseSwitch.get_sql_constraint
+ if not recTime or (recTime > datetime.now() - delta):
+ return True
+
class Identifiable(object):
def __init__(self, id=None):
self.id = id
17 years, 8 months
rhmessaging commits: r2250 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:51:01 -0400 (Tue, 05 Aug 2008)
New Revision: 2250
Modified:
mgmt/trunk/cumin/python/cumin/queue.py
mgmt/trunk/cumin/python/cumin/queue.strings
Log:
Added QueueBindingAdd
Modified QueueBindingSet to be a phased set
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-08-05 20:48:37 UTC (rev 2249)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-08-05 20:51:01 UTC (rev 2250)
@@ -1,6 +1,6 @@
import pdb, logging
-from mint import *
+from mint.schema import Queue, Journal, Exchange
from wooly import *
from wooly.widgets import *
from wooly.forms import *
@@ -9,6 +9,7 @@
from datetime import datetime
from sqlobject.sqlbuilder import LEFTJOINOn
+from binding import *
from exchange import ExchangeInputSet
from stat import *
from widgets import *
@@ -201,6 +202,9 @@
self.purge = QueuePurge(app, "purge")
self.add_mode(self.purge)
+
+ self.queue_binding_add = QueueBindingAdd(app, "queuebindingadd")
+ self.add_mode(self.queue_binding_add)
remove = QueueRemove(app, "remove")
self.add_mode(remove)
@@ -209,6 +213,9 @@
def show_purge(self, session):
return self.show_mode(session, self.purge)
+ def show_queue_binding_add(self, session):
+ return self.show_mode(session, self.queue_binding_add)
+
def render_href(self, session, queue):
if queue:
return super(QueueFrame, self).render_href(session, queue)
@@ -272,33 +279,56 @@
data = "model.xml?class=queue;id=%i" % queue.id
return "wooly.setIntervalUpdate('%s', updateQueue, 3000)" % data
-class QueueBindingSet(BindingSet):
- def get_args(self, session):
- return self.frame.get_args(session)
+class QueueBindingSet(BindingSet, Form):
+ def __init__(self, app, name):
+ super(QueueBindingSet, self).__init__(app, name)
- def render_title(self, session, queue):
- count = fmt_count(self.get_item_count(session, queue))
- return "Exchange Bindings %s" % count
+ self.__remove = self.Remove(app, "remove", self)
+ self.add_child(self.__remove)
+
+ def get_name_col(self, app):
+ return self.NameColumn(app, "e_id")
- def get_item_count(self, session, queue):
- return queue.bindings.count()
+ def render_add_queue_binding_url(self, session, vhost):
+ branch = session.branch()
+ self.frame.show_queue_binding_add(branch)
+ return branch.marshal()
+
+ def render_sql_where(self, session, queue):
+ elems = list()
+ elems.append("b.queue_id = %(id)r")
+ elems.append(self.phase.get_sql_constraint(session, queue))
+ return "where %s" % " and ".join(elems)
- def do_get_items(self, session, queue):
- bindings = queue.bindings
+ def render_title(self, session, queue):
+ return "Exchange Bindings %s" % \
+ fmt_count(queue.bindings.count())
- start, end = self.get_bounds(session)
- bindings = bindings[start:end]
+ class NameColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Exchange"
- return bindings
+ 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)
- def render_item_href(self, session, binding):
- branch = session.branch()
- self.frame.frame.show_exchange(branch, binding.exchange)
- return branch.marshal()
-
- def render_item_name(self, session, binding):
- return binding.exchange.name or "<em>Default</em>"
+ class Remove(FormButton):
+ def process_submit(self, session):
+ ids = self.parent.ids.get(session)
+ self.parent.ids.clear(session)
+ queue = self.frame.get_args(session)[0]
+ branch = session.branch()
+ frame = self.frame.frame.show_queue_bindings_remove(branch, queue)
+ frame.ids.set(branch, ids)
+ self.page.set_redirect_url(session, branch.marshal())
+
+ def render_content(self, session):
+ return "Remove"
+
class QueueForm(CuminFieldForm):
def __init__(self, app, name):
super(QueueForm, self).__init__(app, name)
@@ -318,108 +348,11 @@
self.bindings = ExchangeKeysField(app, "bindings", self)
self.add_field(self.bindings)
-
-class ExchangeKeysInput(FormInput):
- def __init__(self, app, name, form):
- super(ExchangeKeysInput, self).__init__(app, name, form)
-
- self.name_param = Parameter(app, "name_param");
- self.add_parameter(self.name_param)
- form.add_form_parameter(self.name_param)
+ def validate(self, session, queue_name):
+ super_error = super(QueueForm, self).validate(session)
+ (errors, form_binding_info) = self.bindings.get_binding_info(session, queue_name)
+ return (errors or super_error, form_binding_info)
- self.names = ListParameter(app, "name", self.name_param)
- self.add_parameter(self.names)
- form.add_form_parameter(self.names)
-
- self.binding_param = Parameter(app, "binding_param")
- self.add_parameter(self.binding_param)
- form.add_form_parameter(self.binding_param)
-
- self.bindings = ListParameter(app, "binding", self.binding_param)
- self.add_parameter(self.bindings)
- form.add_form_parameter(self.bindings)
-
- self.extra_param = Parameter(app, "extra_param")
- self.add_parameter(self.extra_param)
- form.add_form_parameter(self.extra_param)
-
- self.extras = ListParameter(app, "extra", self.extra_param)
- self.add_parameter(self.extras)
- form.add_form_parameter(self.extras)
-
- self.exchangekey_tmpl = Template(self, "exchangekey_html")
-
- # info to help create the <input> elements for various exchange types
- self.binding_typemap = {"direct":{"type":"text",
- "enable":"disabled='disabled'"},
- "topic":{"type":"text", "enable":None},
- "fanout":{"type":"hidden", "enable":None},
-# "headers":{"type":"text", "enable":None},
-# "xml":{"type":"hidden", "enable":None},
- }
- # exchange names to suppress
- self.binding_omit_by_name = ("", "qpid.management", "amq.match")
- self.binding_omit_by_type = ("xml", "headers")
-
- def do_render(self, session, *args):
- writer = Writer()
- # get the registration from the broker frame
- reg = self.frame.frame.get_object(session)
- vhost = reg.getDefaultVhost()
-
- sortedExchanges = sorted_by(vhost.exchanges)
- # render a row for each exchange we support
- for exchange in sortedExchanges:
- if not exchange.name in self.binding_omit_by_name:
- if not exchange.type in self.binding_omit_by_type:
- self.exchangekey_tmpl.render(writer, session, exchange)
-
- return writer.to_string()
-
- def render_exchange_name(self, session, exchange):
- return exchange.name
-
- def render_exchange_fmt_name(self, session, exchange):
- return fmt_shorten(exchange.name)
-
- def render_exchange_path(self, session, *args):
- return self.names.path
-
- def render_exchange_id(self, session, exchange):
- return exchange.id
-
- def render_binding_path(self, session, exchange):
- return self.bindings.path
-
- def render_exchange_type(self, session, exchange):
- return exchange.type
-
- def render_binding_input_type(self, session, exchange):
- return self.binding_typemap[exchange.type]["type"]
-
- def render_binding_disabled(self, session, exchange):
- return self.binding_typemap[exchange.type]["enable"]
-
-class ExchangeKeysField(FormField):
- def __init__(self, app, name, form):
- super(ExchangeKeysField, self).__init__(app, name, form)
-
- self.__input = ExchangeKeysInput(app, "inputs", form)
- self.add_child(self.__input)
- self.inputs = self.__input
-
- def render_title(self, session):
- return "Exchange Bindings:"
-
- def render_exchange_keys(self, session, *args):
- return self.__input.render(session)
-
- def render_exchange_path(self, session, *args):
- return self.inputs.names.path
-
- def render_queue_name_path(self, session, *args):
- return self.inputs.form.namef.get_parameter().path
-
class QueueAdd(QueueForm):
def process_cancel(self, session):
branch = session.branch()
@@ -427,45 +360,31 @@
self.page.set_redirect_url(session, branch.marshal())
def process_submit(self, session):
- errors = self.validate(session)
+ queue_name = self.namef.get(session)
+ durable = self.durable.get(session)
+ exclusive = self.exclusive.get(session)
+ autodelete = self.autodelete.get(session)
+ (errors, form_binding_info) = self.validate(session, queue_name)
if errors:
pass
else:
+ # since we are adding a queue, we don't have
+ # an existing queue to pass, so create a
+ # blank one
+ queue = Queue()
+ queue.name = queue_name
+ queue.durable = (durable == "durable")
+ queue.exclusive = (exclusive == "exclusive")
+ queue.autoDelete = (autodelete == "autodel")
reg = self.frame.get_object(session)
- vhost = reg.getDefaultVhost()
- queue_name = self.namef.get(session)
- durable = self.durable.get(session)
- exclusive = self.exclusive.get(session)
- autodelete = self.autodelete.get(session)
- binding_names = self.bindings.inputs.names.get(session)
- binding_keys = self.bindings.inputs.bindings.get(session)
- #assumes a 1:1 correlation between names and keys
- exchange_keys = dict(zip(binding_names, binding_keys))
-
- # sanity check: this should have been handled by the javascript
- # on the form submit
- for binding_name in binding_names:
- exchange = self.__get_exchange_named(binding_name, vhost.exchanges)
- if exchange.type == 'direct':
- exchange_keys[exchange.name] = queue_name
-
args = {
- "queue": queue_name,
- "durable": durable,
- "exclusive": exclusive,
- "auto_delete": autodelete,
- "exchange_keys": exchange_keys
- }
- log.info("Adding queue:\n\tname: \
- '%s'\n\tdurablility: \
- %s\n\texclusivity: \
- %s\n\tlongevity: %s" % \
- (queue_name, durable, exclusive, autodelete) )
+ "exchange_keys": form_binding_info,
+ "reg": reg}
action = self.app.model.queue.add
- action.invoke(reg, args)
+ action.invoke(queue, args)
# navigate back to main queue frame
self.process_cancel(session)
@@ -474,11 +393,6 @@
reg = self.frame.get_object(session)
return "Add Queue to the Broker '%s'" % reg.name
- def __get_exchange_named(self, name, exchanges):
- for exchange in exchanges:
- if exchange.name == name:
- return exchange
-
class QueueRemove(CuminConfirmForm):
def get_args(self, session):
return self.frame.get_args(session)
@@ -545,6 +459,7 @@
def render_item_content(self, session, id):
return "Purge Queue '%s'" % Queue.get(id).name
+
class QueueSetRemove(CuminBulkActionForm):
def process_return(self, session):
branch = session.branch()
@@ -563,54 +478,97 @@
def render_item_content(self, session, id):
return "Remove Queue '%s'" % Queue.get(id).name
-class QueueBindingAdd(CuminForm):
- def __init__(self, app, name):
- super(QueueBindingAdd, self).__init__(app, name)
+class BindSummaryPropertiesField(FormField):
+ def __init__(self, app, name, form):
+ super(BindSummaryPropertiesField, self).__init__(app, name, form)
- self.exchanges = self.Exchanges(app, "exchanges", self)
- self.add_child(self.exchanges)
+ self.sum_props = self.SummaryProperties(app, "properties")
+ self.add_child(self.sum_props)
- self.binding_key = TextInput(app, "binding_key", self)
- self.add_child(self.binding_key)
+ self.prop_tmpl = Template(self, "properties_html")
+
+ class SummaryProperties(CuminProperties):
+ def do_get_items(self, session, queue):
+ return [("Name:", queue.name),
+ ("Durable:", queue.durable),
+ ("Exclusive:", queue.exclusive),
+ ("Auto-Delete:", queue.autoDelete)]
+ def render_inputs(self, session, *args):
+ writer = Writer()
+ self.prop_tmpl.render(writer, session, args)
+ return writer.to_string()
+
+ def render_prop_items(self, session, args):
+ return self.sum_props.render_items(session, *args)
+
def get_args(self, session):
- return self.frame.get_args(session)
-
- def process_cancel(self, session, queue):
- branch = session.branch()
- self.page.show_queue(branch, queue).show_view(branch)
- self.page.set_redirect_url(session, branch.marshal())
+ return (self.frame.frame.get_object(session),)
- def validate(self, session):
- valid = True
+class QueueBindingAdd(CuminFieldForm):
+ def __init__(self, app, name):
+ super(QueueBindingAdd, self).__init__(app, name)
- if not self.binding_key.get(session):
- valid = False
- self.binding_key.add_error(session, """
- The binding key is empty; it is required
- """)
+ self.props = BindSummaryPropertiesField(app, "props", self)
+ self.add_field(self.props)
- if not self.exchanges.get(session):
- valid = False
- self.exchanges.add_error(session, """
- No exchange selected; it is required
- """)
+ self.bindings = ExchangeKeysField(app, "bindings", self, title="Bind to Exchange:")
+ self.add_field(self.bindings)
+
+ self.errors = self.Errors(self, "errors")
+ self.add_attribute(self.errors)
- return valid
+ def render_form_error(self, session, *args):
+ errors = self.errors.get(session)
+ if "no_exchanges" in errors:
+ return "<ul class=\"errors\" style=\"margin:0; float:left;\"><li>%s</li></ul>" % \
+ "</li><li>".join(errors["no_exchanges"])
+
+ def process_cancel(self, session):
+ branch = session.branch()
+ self.frame.show_view(branch)
+ self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session, queue):
- if self.validate(session):
- raise Exception("Not implemented")
+ def process_submit(self, session):
+ queue = self.frame.get_object(session)
+ (errors, form_binding_info) = self.bindings.get_binding_info(session, queue.name)
- self.process_cancel(session, queue)
+ if not len(form_binding_info):
+ # no exhchanges were selected is not an
+ # error that ExchangeKeysField looks for
+ errors = self.errors.get(session)
+ errs = errors.setdefault("no_exchanges", list())
+ errs.append("At least one exchange must be selected")
+ errors = True
+
+ if errors:
+ pass
+ else:
+ reg = self.frame.frame.get_object(session)
+ args = {
+ "exchange_keys": form_binding_info,
+ "reg": reg}
+
+ action = self.app.model.queue.bind
+ action.invoke(queue, args)
+
+ # navigate back to main queue frame
+ self.process_cancel(session)
- def render_title(self, session, queue):
- return "Add Binding to Queue '%s'" % queue.name
+ def render_title(self, session, *args):
+ queue = self.frame.get_object(session)
+ return "Add Binding to the Queue '%s'" % queue.name
- class Exchanges(ExchangeInputSet):
- def do_get_items(self, session, queue):
- return sorted_by(queue.virtual_host.exchange_items())
+ def find_match_value(self, binding_info, this_exchange, match_info):
+ for m_info in binding_info[this_exchange]:
+ if m_info.startswith(match_info):
+ if m_info.endswith("nv"):
+ return binding_info[this_exchange][m_info]
+ class Errors(Attribute):
+ def get_default(self, session):
+ return dict()
+
class QueueBindingRemove(CuminConfirmForm):
def get_args(self, session):
return self.frame.get_args(session)
@@ -815,3 +773,4 @@
def render_item_unacked_messages(self, session, consumer):
return self.app.model.consumer.unackedMessages.value(consumer)
+
Modified: mgmt/trunk/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.strings 2008-08-05 20:48:37 UTC (rev 2249)
+++ mgmt/trunk/cumin/python/cumin/queue.strings 2008-08-05 20:51:01 UTC (rev 2250)
@@ -126,58 +126,54 @@
//throw new Error();
}
-[QueueBindingSet.html]
-<div class="rfloat">{page}</div>
-<ul class="radiotabs"> </ul>
+[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}
-<table class="QueueBindingSet mobjects">
- <tr>
- <th>Exchange</th>
- <th>Key</th>
- <th class="ralign" colspan="2">Messages Matched</th>
- </tr>
+[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}
- {items}
-</table>
+[QueueBindingSet.html]
+<form id="{id}" method="post" action="?">
-[QueueBindingSet.item_html]
-<tr>
- <td><a href="{item_href}">{item_name}</a></td>
- <td>{item_binding_key}</td>
- <td class="ralign">{item_messages_matched_rate}</td>
- <td class="ralign">{item_messages_matched}</td>
-</tr>
-
-[QueueBindingAdd.html]
-<form id="{id}" class="mform" method="post" action="?">
- <div class="head">
- <h1>{title}</h1>
- </div>
- <div class="body">
- <span class="legend">Exchange</span>
- <fieldset>{exchanges}</fieldset>
-
- <span class="legend">Binding Key</span>
- <fieldset>
- <div class="field">{binding_key}</div>
- </fieldset>
-
- {hidden_inputs}
- </div>
- <div class="foot">
- <a class="help action" href="{help_href}" target="help">Help</a>
- {submit}
- {cancel}
- </div>
+ <div class="rfloat">{phase}</div>
+ <ul class="actions">
+ <li><a class="nav" href="{add_queue_binding_url}">Add Binding</a></li>
+ </ul>
+
+ <div class="sactions">
+ <h2>Act on Selected Bindings:</h2>
+ {remove}
+ </div>
+
+ <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>
-<script type="text/javascript" defer="defer">
-(function() {
- var elem = wooly.doc().elembyid("{id}").node.elements[1];
- elem.focus();
- elem.select();
-}())
-</script>
+[ExchangeBindingSet.item_html]
+<tr>{cells}</tr>
+
[QueueStats.html]
<ul class="radiotabs tabs">{tabs}</ul>
<div class="radiotabs mode">{mode}</div>
@@ -280,105 +276,11 @@
<td class="ralign">{item_unacked_messages}</td>
</tr>
-[QueueAdd.css]
-td.exchange_type {
- font-style: italic;
-}
-
-[QueueAdd.javascript]
-var direct_keys = [];
-var queue_name_field = null;
-
-function attach_submit() {
- var theForm = document.forms[0];
- addEvent(theForm, "submit", associate_keys);
-
- // get list of binding key fields that are 'direct'
- // and add a listener to echo the queue_name
- var inputs = document.getElementsByTagName("input");
- if (inputs) {
- for (var i=0; i<inputs.length; i++) {
- if (inputs[i].className.indexOf("binding_class_direct") != -1) {
- direct_keys[direct_keys.length] = inputs[i];
- }
- }
- var oQueueName = document.forms[0].elements[queue_name];
- if (oQueueName) {
- addEvent(oQueueName, "blur", echo_queue_name);
- addEvent(oQueueName, "keyup", echo_queue_name);
- queue_name_field = oQueueName;
- }
- }
-
-}
-// When the form is submitted, make sure we can correctly associate
-// the input boxes with the checkboxes
-function associate_keys() {
-
- // get the list of exchange chechboxes
- var exchanges = document.forms[0].elements[exchange_path];
- if (exchanges) {
- for (var i=0; i<exchanges.length; i++) {
- var chk_value = exchanges[i].value;
- // get the associated input box
- var oInput = document.getElementById(chk_value);
- if (oInput) {
- oInput.disabled = false; // disabled inputs don't get submitted
- // so there should be a 1:1 relationship
- // between checked boxes and input values
- if (!exchanges[i].checked) {
- oInput.disabled = true;
- oInput.value = '';
- }
- }
- }
- }
-}
-
-// echos the queue_name field into the binding key fields of type 'direct'
-function echo_queue_name() {
- if (queue_name_field) {
- for (var i=0; i<direct_keys.length; i++) {
- direct_keys[i].value = queue_name_field.value;
- }
- }
-}
-
-[ExchangeKeysInput.exchangekey_html]
- <tr>
- <td><input type="checkbox"
- id="{id}.{exchange_id}"
- name="{exchange_path}" value="{exchange_name}" size="15"
- tabindex="100"/></td>
- <td><label for="{id}.{exchange_id}">{exchange_fmt_name}</label></td>
- <td class="exchange_type">{exchange_type}</td>
- <td><input class="binding_class_{exchange_type}"
- type="{binding_input_type}"
- name="{binding_path}" id="{exchange_name}"
- value="" size="32" maxlength="256" tabindex="100" {binding_disabled}/></td>
- </tr>
-
-[ExchangeKeysField.html]
-<div class="field">
- <div class="title">{title}</div>
-
-<div class="inputs">
-<table class="mobjects">
- <thead>
- <tr>
- <th colspan="2">Exchange Name</th>
- <th>Exchange Type</th>
- <th>Binding Key</th>
- </tr>
- </thead>
- <tbody>
- {exchange_keys}
- </tbody>
-</table>
+[BindSummaryPropertiesField.properties_html]
+<div class="properties" style="width:80%">
+ <table class="PropertySet">
+ <tbody>
+ {prop_items}
+ </tbody>
+ </table>
</div>
-</div>
-<script type="text/javascript">
- var exchange_path="{exchange_path}";
- var queue_name="{queue_name_path}";
- addEvent(window, 'load', attach_submit);
-</script>
17 years, 8 months
rhmessaging commits: r2249 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:48:37 -0400 (Tue, 05 Aug 2008)
New Revision: 2249
Modified:
mgmt/trunk/cumin/python/cumin/page.strings
Log:
Removed unused javascript function
Modified: mgmt/trunk/cumin/python/cumin/page.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.strings 2008-08-05 20:47:27 UTC (rev 2248)
+++ mgmt/trunk/cumin/python/cumin/page.strings 2008-08-05 20:48:37 UTC (rev 2249)
@@ -415,18 +415,6 @@
}
}())
-function addEvent(obj, evType, fn){
- if (obj.addEventListener){
- obj.addEventListener(evType, fn, false);
- return true;
- } else if (obj.attachEvent){
- var r = obj.attachEvent("on"+evType, fn);
- return r;
- } else {
- return false;
- }
-}
-
[CuminPage.html]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
17 years, 8 months
rhmessaging commits: r2248 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-08-05 16:47:27 -0400 (Tue, 05 Aug 2008)
New Revision: 2248
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added Queue.bind and Exchange.remove
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-08-05 20:43:48 UTC (rev 2247)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-08-05 20:47:27 UTC (rev 2248)
@@ -1,7 +1,7 @@
-from mint import *
+from mint.schema import *
from wooly import *
from wooly.parameters import *
-from time import mktime
+from time import *
from datetime import datetime, timedelta
from types import *
from logging import getLogger
@@ -142,9 +142,6 @@
else:
return self.name
- def get_modifier(self, session):
- pass
-
def invoke(self, object, args={}):
invoc = CuminActionInvocation(self, object)
@@ -171,6 +168,15 @@
def do_invoke(self, object, args, completion):
pass
+ def getSessionFromRegistration(self, reg):
+ conn = self.cumin_model.data.getConnectionByRegistration(reg)
+ #for sess in conn.mconn.sessions:
+ # if conn.mconn.sessions[sess].name == conn.getSessionId():
+ # #this is active management session
+ # return conn.mconn.sessions[sess]
+ return conn.mconn.session(str(uuid4()))
+
+
class CuminActionInvocation(object):
def __init__(self, action, object):
self.action = action
@@ -182,10 +188,6 @@
def get_description(self, session):
verb = self.action.get_title(session)
- modifier = self.action.get_modifier(session)
- if modifier:
- verb = verb + modifier
-
if self.object:
cls = self.action.cumin_model.get_class_by_object(self.object)
object = cls.get_object_title(session, self.object)
@@ -555,6 +557,18 @@
def get_object_name(self, broker):
return broker.id
+def do_bind(session, queue, binding_info):
+ for exchange in binding_info:
+ if "key" in binding_info[exchange]:
+ binding_key = binding_info[exchange]["key"]
+ else:
+ binding_key = None
+
+ session.exchange_bind(queue=queue.name,
+ exchange=binding_info[exchange]["name"],
+ binding_key=binding_key,
+ arguments=binding_info[exchange]["arguments"])
+
class CuminQueue(RemoteClass):
def __init__(self, model):
super(CuminQueue, self).__init__(model, "queue", Queue, QueueStats)
@@ -729,6 +743,9 @@
action = self.Add(self, "add")
action.summary = True
+ action = self.Bind(self, "bind")
+ action.summary = True
+
def get_title(self, session):
return "Queue"
@@ -761,55 +778,48 @@
return "Remove"
def do_invoke(self, queue, args, completion):
- # once qpid management supports queue_delete
- # replace the rest of this method with
- #queue.delete(self.cumin_model.data, completion)
-
reg = queue.vhost.broker.registration
- conn = self.cumin_model.data.getConnectionByRegistration(reg)
- for sess in conn.mconn.sessions:
- if conn.mconn.sessions[sess].name == conn.getSessionId():
- #this is management session
- msess = conn.mconn.sessions[sess]
- msess.queue_delete(queue=queue.name)
- break
+ session = self.getSessionFromRegistration(reg)
+ session.queue_delete(queue=queue.name)
- #sess = conn.mconn.session(str(uuid4()))
- #sess.queue_delete(queue=queue.name)
completion("OK")
+ class Bind(CuminAction):
+ def show(self, session, queue):
+ frame = self.cumin_class.show_object(session, queue)
+ frame = frame.show_queue(session, queue)
+ return frame.show_queue_binding_add(session)
+
+ def get_title(self, session):
+ return "Bind"
+
+ def do_invoke(self, queue, args, completion):
+ reg = queue.vhost.broker.registration
+ session = self.getSessionFromRegistration(reg)
+ binding_info = args['exchange_keys']
+ do_bind(session, queue, binding_info)
+
+ completion("OK")
+
class Add(CuminAction):
def get_title(self, session):
- return "Add New Queue"
+ return "Add"
- def get_modifier(self, session):
- return " to "
-
def show(self, session, queue):
frame = self.cumin_class.show_object(session, queue)
return frame.show_queue_add(session)
- def do_invoke(self, reg, args, completion):
- conn = self.cumin_model.data.getConnectionByRegistration(reg)
- for sess in conn.mconn.sessions:
- if conn.mconn.sessions[sess].name == conn.getSessionId():
- #this is management session
- msess = conn.mconn.sessions[sess]
- msess.queue_declare(queue=args['queue'],
- exclusive=(args['exclusive'] == "exclusive"),
- durable=(args['durable'] == "durable"),
- auto_delete=(args['auto_delete'] == "autodel"))
-
- # optionally bind to exchanges
- exchange_keys = args['exchange_keys']
- for exchange_name in exchange_keys:
- msess.exchange_bind(queue=args['queue'],
- exchange=exchange_name,
- binding_key=exchange_keys[exchange_name])
-
- break
-
-
+ def do_invoke(self, queue, args, completion):
+ reg = args["reg"]
+ session = self.getSessionFromRegistration(reg)
+ session.queue_declare(queue=queue.name,
+ exclusive=queue.exclusive,
+ durable=queue.durable,
+ auto_delete=queue.autoDelete)
+
+ # optionally bind to exchanges
+ binding_info = args['exchange_keys']
+ do_bind(session, queue, binding_info)
completion("OK")
class CuminExchange(RemoteClass):
@@ -864,7 +874,9 @@
stat.unit = "message"
stat.category = "io"
- action = self.Add(self, "add")
+ self.Add(self, "add")
+
+ action = self.Remove(self, "remove")
action.summary = True
def show_object(self, session, exchange):
@@ -887,20 +899,32 @@
class Add(CuminAction):
def get_title(self, session):
- return "Add New Exchange"
+ return "Add"
def show(self, session, exchange):
frame = self.cumin_class.show_object(session, exchange)
return frame.show_exchange_add(session)
- def do_invoke(self, reg, exchange, completion):
- conn = self.cumin_model.data.getConnectionByRegistration(reg)
- for sess in conn.mconn.sessions:
- if conn.mconn.sessions[sess].name == conn.getSessionId():
- #this is management session
- msess = conn.mconn.sessions[sess]
- msess.exchange_declare(exchange=exchange.name,
+ def do_invoke(self, exchange, reg, completion):
+ session = self.getSessionFromRegistration(reg)
+ session.exchange_declare(exchange=exchange.name,
type=exchange.type)
+ # if the above call fails, an exception is
+ # raised and we won't get here
+ completion("OK")
+
+ class Remove(CuminAction):
+ def get_title(self, session):
+ return "Remove"
+
+ def show(self, session, exchange):
+ frame = self.cumin_class.show_object(session, exchange)
+ frame = frame.show_exchange(session, exchange)
+ return frame.show_remove(session)
+
+ def do_invoke(self, exchange, reg, completion):
+ session = self.getSessionFromRegistration(reg)
+ session.exchange_delete(exchange=exchange.name)
completion("OK")
@@ -916,12 +940,34 @@
stat.title = "Msgs. Matched"
stat.unit = "message"
+ action = self.Remove(self, "remove")
+ action.summary = True
+
def get_title(self, session):
return "Binding"
def get_object_name(self, binding):
- return ""
+ return "between %s and %s" % (binding.exchange.name, binding.queue.name)
+ class Remove(CuminAction):
+ def get_title(self, session):
+ return "Remove"
+
+ def show(self, session, binding):
+ frame = self.cumin_class.show_object(session, binding)
+ frame = frame.show_exchange(session, binding)
+ return frame.show_remove(session)
+
+ def do_invoke(self, binding, args, completion):
+ reg = binding.exchange.vhost.broker.registration
+ session = self.getSessionFromRegistration(reg)
+ session.exchange_unbind (queue=binding.queue.name,
+ exchange=binding.exchange.name,
+ binding_key=binding.bindingKey)
+
+ completion("OK")
+
+
class CuminRoute(RemoteClass):
def __init__(self, model):
super(CuminRoute, self).__init__(model, "route",
17 years, 8 months