Package org.apache.qpid.server.binding

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


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

                b.incrementMatches();

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

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


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

                if(!exch.addBinding(bindingKey, queue, arguments) && ExchangeDefaults.TOPIC_EXCHANGE_CLASS.equals(exch.getTypeShortString()))
                {
                    Binding oldBinding = exch.getBinding(bindingKey, queue, arguments);

                    Map<String, Object> oldArgs = oldBinding.getArguments();
                    if((oldArgs == null && !arguments.isEmpty()) || (oldArgs != null && !oldArgs.equals(arguments)))
                    {
                        exch.replaceBinding(oldBinding.getId(), bindingKey, queue, arguments);
                    }
                }
            }
        }
        catch (AMQException e)
View Full Code Here

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

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

            synchronized (_bindingAdapters)
            {
                return binding == null ? null : _bindingAdapters.get(binding);
            }
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.toString()));
            assertEquals("The binding selector argument is incorrect", SELECTOR_VALUE,
                    binding.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.toString()).toString());
        }
    }
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

   
    protected void unbind(TestQueue queue, String... bindings) throws AMQException
    {
        String queueName = queue.getName();
        //TODO - check this
        exchange.onUnbind(new Binding(null,queueName, queue, exchange, getHeadersMap(bindings)));
    }
View Full Code Here

    private TestQueue bind(String key, String queueName, Map<String,Object> args) throws AMQException
    {
        TestQueue queue = new TestQueue(new AMQShortString(queueName));
        queues.add(queue);
        exchange.onBind(new Binding(null,key, queue, exchange, args));
        return queue;
    }
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

                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(bindingKey, queue, exch, arguments);   
                    }
                }
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.