diff options
Diffstat (limited to 'qpid/python/qpid/messaging/driver.py')
-rw-r--r-- | qpid/python/qpid/messaging/driver.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py index 9d58616804..a09686badd 100644 --- a/qpid/python/qpid/messaging/driver.py +++ b/qpid/python/qpid/messaging/driver.py @@ -28,7 +28,6 @@ from qpid.framing import OpEncoder, SegmentEncoder, FrameEncoder, \ FrameDecoder, SegmentDecoder, OpDecoder from qpid.messaging import address from qpid.messaging.constants import UNLIMITED -from qpid.messaging.endpoints import Pattern from qpid.messaging.exceptions import ConnectError from qpid.messaging.message import get_codec, Message from qpid.ops import * @@ -64,6 +63,21 @@ DURABLE_DEFAULT=True # XXX +class Pattern: + """ + The pattern filter matches the supplied wildcard pattern against a + message subject. + """ + + def __init__(self, value): + self.value = value + + # XXX: this should become part of the driver + def _bind(self, sst, exchange, queue): + from qpid.ops import ExchangeBind + sst.write_cmd(ExchangeBind(exchange=exchange, queue=queue, + binding_key=self.value.replace("*", "#"))) + FILTER_DEFAULTS = { "topic": Pattern("*"), "amq.failover": Pattern("DUMMY") |