Package org.apache.qpid.server.binding

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


    }

    private AMQQueue bindQueue()
    {
        AMQQueue queue = mock(AMQQueue.class);
        _exchange.addBinding(new Binding(UUID.randomUUID(), "does not matter", queue, _exchange, null));
        return queue;
    }
View Full Code Here


                String bindingKey = String.valueOf(routingKey);
                Map<String,Object> arguments = FieldTable.convertToMap(body.getArguments());

                if(!virtualHost.getBindingFactory().addBinding(bindingKey, queue, exch, arguments))
                {
                    Binding oldBinding = virtualHost.getBindingFactory().getBinding(bindingKey, queue, exch, arguments);

                    Map<String, Object> oldArgs = oldBinding.getArguments();
                    if((oldArgs == null && !arguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(arguments)))
                    {
                        virtualHost.getBindingFactory().replaceBinding(oldBinding.getId(), bindingKey, queue, exch, arguments);
                    }
                }
            }
        }
        catch (AMQException e)
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, routingKey.toString(), queue, this, FieldTable.convertToMap(arguments));
       
        if (arguments == null)
        {
            return _bindings.containsKey(binding);
        }
View Full Code Here

        }
    }

    public boolean isBound(String bindingKey, Map<String, Object> arguments, AMQQueue queue)
    {
        Binding binding = new Binding(null, bindingKey, queue, this, arguments);
        if (arguments == null)
        {
            return _bindings.containsKey(binding);
        }
        else
View Full Code Here

     */
    private void validateBindingProperties(List<Binding> bindings, boolean useSelectors)
    {
        assertEquals("Each queue should only be bound once.", 1, bindings.size());

        Binding binding = bindings.get(0);

        if (useSelectors)
        {
            assertTrue("Binding does not contain a Selector argument.",
                    binding.getArguments().containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()));
            assertEquals("The binding selector argument is incorrect", SELECTOR_VALUE,
                    binding.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.getValue()).toString());
        }
    }
View Full Code Here

    {
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");

        Binding b = new Binding(null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");
        matchHeaders.setString("B", "Value of B");

        Binding b = new Binding(null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

    {
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Altered value of A");

        Binding b = new Binding(null, getQueueName(), _queue, null, bindHeaders);
        assertFalse(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here

        bindHeaders.put("X-match", "all");
        bindHeaders.put("A", "Value of A");

        matchHeaders.setString("A", "Value of A");

        Binding b = new Binding(null, getQueueName(), _queue, null, bindHeaders);
        assertTrue(new HeadersBinding(b).matches(matchHeaders));
    }
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.