Package org.apache.qpid.server.binding

Examples of org.apache.qpid.server.binding.Binding


    public void testHashAfterHash() throws AMQException
    {
        AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
                false, null);
        _exchange.registerQueue(new Binding(null, "a.*.#.b.c.#.d",queue, _exchange, null));

        int queueCount = routeMessage("a.c.b.b.c",0l);
        Assert.assertEquals("Message should not route to any queues", 0, queueCount);

        Assert.assertEquals(0, queue.getMessageCount());
View Full Code Here


    public void testHashHash() throws AMQException
    {
        AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a#", false, null, false, false,
                false, null);
        _exchange.registerQueue(new Binding(null, "a.#.*.#.d",queue, _exchange, null));

        int queueCount = routeMessage("a.c.b.b.c",0l);
        Assert.assertEquals("Message should not route to any queues", 0, queueCount);

        Assert.assertEquals(0, queue.getMessageCount());
View Full Code Here

    public void testSubMatchFails() throws AMQException
    {
        AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
                false, null);
        _exchange.registerQueue(new Binding(null, "a.b.c.d",queue, _exchange, null));

        int queueCount = routeMessage("a.b.c",0l);
        Assert.assertEquals("Message should not route to any queues", 0, queueCount);

        Assert.assertEquals(0, queue.getMessageCount());
View Full Code Here

    public void testMoreRouting() throws AMQException
    {
        AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
                false, null);
        _exchange.registerQueue(new Binding(null, "a.b",queue, _exchange, null));


        int queueCount = routeMessage("a.b.c",0l);
        Assert.assertEquals("Message should not route to any queues", 0, queueCount);
View Full Code Here

    public void testMoreQueue() throws AMQException
    {
        AMQQueue queue = _vhost.createQueue(UUIDGenerator.generateRandomUUID(), "a", false, null, false, false,
                false, null);
        _exchange.registerQueue(new Binding(null, "a.b",queue, _exchange, null));


        int queueCount = routeMessage("a",0l);
        Assert.assertEquals("Message should not route to any queues", 0, queueCount);
View Full Code Here

        UUID exchangeId = UUIDGenerator.generateBindingUUID(ExchangeDefaults.DEFAULT_EXCHANGE_NAME,
                                                            queueName,
                                                            queueName,
                                                            _virtualHost.getName());

        return new Binding(exchangeId, queueName, queue, this, Collections.EMPTY_MAP);
    }
View Full Code Here

        for (HeadersBinding hb : _bindingHeaderMatchers)
        {
            if (hb.matches(payload))
            {
                Binding b = hb.getBinding();

                b.incrementMatches();

                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Exchange " + getName() + ": delivering message with headers " +
                                  payload.getMessageHeader() + " to " + b.getQueue().getName());
                }
                queues.add(b.getQueue());
            }
        }

        return new ArrayList<BaseQueue>(queues);
    }
View Full Code Here

        try
        {
            if(!virtualHost.getBindingFactory().addBinding(bindingKey, amqQueue, _exchange, bindingArguments))
            {
                Binding oldBinding = virtualHost.getBindingFactory().getBinding(bindingKey, amqQueue, _exchange,
                                                                                bindingArguments);

                Map<String, Object> oldArgs = oldBinding.getArguments();
                if((oldArgs == null && !bindingArguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(bindingArguments)))
                {
                    virtualHost.getBindingFactory().replaceBinding(oldBinding.getId(), bindingKey, amqQueue, _exchange, bindingArguments);
                }
            }
            Binding binding = virtualHost.getBindingFactory().getBinding(bindingKey, amqQueue, _exchange, bindingArguments);

            synchronized (_bindingAdapters)
            {
                return binding == null ? null : _bindingAdapters.get(binding);
            }
View Full Code Here

       
        for (HeadersBinding hb : _bindingHeaderMatchers)
        {
            if (hb.matches(header))
            {
                Binding b = hb.getBinding();
               
                b.incrementMatches();
               
                if (_logger.isDebugEnabled())
                {
                    _logger.debug("Exchange " + getNameShortString() + ": delivering message with headers " +
                                  header + " to " + b.getQueue().getNameShortString());
                }
                queues.add(b.getQueue());
            }
        }
       
        return new ArrayList<BaseQueue>(queues);
    }
View Full Code Here

    }

    public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
    {
        Binding binding = new Binding(null, null, routingKey.toString(), queue, this, FieldTable.convertToMap(arguments));
       
        if (arguments == null)
        {
            return _bindings.containsKey(binding);
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.binding.Binding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.