Package org.apache.qpid.server.binding

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


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

        BindingImpl b =
                createBinding(UUID.randomUUID(), getQueueName(), _queue, _exchange, bindHeaders);
        assertFalse(new HeadersBinding(b).matches(matchHeaders));
    }
View Full Code Here


        if(arguments != null)
        {
            attributes.put(Binding.ARGUMENTS, arguments);
        }
        attributes.put(Binding.ID, id);
        BindingImpl binding = new BindingImpl(attributes, queue, exchange);
        binding.open();
        return binding;
    }
View Full Code Here

    @Override
    public boolean replaceBinding(final String bindingKey,
                                  final AMQQueue queue,
                                  final Map<String, Object> arguments)
    {
        final BindingImpl existingBinding = getBinding(bindingKey, queue);
        return makeBinding(existingBinding == null ? null : existingBinding.getId(),
                           bindingKey,
                           queue,
                           arguments,
                           true);
    }
View Full Code Here

        }

        // Check access
        _virtualHost.getSecurityManager().authoriseUnbind(binding);

        BindingImpl b = _bindingsMap.remove(new BindingIdentifier(bindingKey,queue));

        if (b != null)
        {
            doRemoveBinding(b);
            queue.removeBinding(b);

            if (b.isDurable())
            {
                _virtualHost.getDurableConfigurationStore().remove(b.asObjectRecord());
            }
            b.delete();
        }

    }
View Full Code Here

        if (id == null)
        {
            id = UUID.randomUUID();
        }

        BindingImpl existingMapping;
        synchronized(this)
        {
            BindingIdentifier bindingIdentifier = new BindingIdentifier(bindingKey, queue);
            existingMapping = _bindingsMap.get(bindingIdentifier);

            if (existingMapping == null)
            {

                Map<String,Object> attributes = new HashMap<String, Object>();
                attributes.put(Binding.NAME,bindingKey);
                attributes.put(Binding.ID, id);
                attributes.put(Binding.ARGUMENTS, arguments);

                BindingImpl b = new BindingImpl(attributes, queue, this);
                b.create(); // Must be called before addBinding as it resolves automated attributes.

                addBinding(b);
                return true;
            }
            else if(force)
View Full Code Here

    }

    @Override
    public boolean deleteBinding(final String bindingKey, final AMQQueue queue)
    {
        final BindingImpl binding = getBinding(bindingKey, queue);
        if(binding == null)
        {
            return false;
        }
        else
        {
            binding.delete();
            return true;
        }
    }
View Full Code Here

                                                              final Queue queue,
                                                              final Map<String, Object> bindingArguments,
                                                              final Map<String, Object> attributes)
    {
        addBinding(bindingKey, (AMQQueue) queue, bindingArguments);
        final BindingImpl binding = getBinding(bindingKey, (AMQQueue) queue);
        return binding;
    }
View Full Code Here

        for (HeadersBinding hb : _bindingHeaderMatchers)
        {
            if (hb.matches(Filterable.Factory.newInstance(payload,instanceProperties)))
            {
                BindingImpl b = hb.getBinding();

                b.incrementMatches();

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

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

        when(queue.getParent(VirtualHost.class)).thenReturn(_virtualHost);
        when(queue.getName()).thenReturn(TEST_QUEUE);
        when(queue.isDurable()).thenReturn(true);
        when(queue.getLifetimePolicy()).thenReturn(LifetimePolicy.PERMANENT);

        BindingImpl binding = mock(BindingImpl.class);
        when(binding.getExchange()).thenReturn(exchange);
        when(binding.getAMQQueue()).thenReturn(queue);
        when(binding.getBindingKey()).thenReturn("bindingKey");

        ObjectProperties properties = new ObjectProperties();
        properties.put(Property.NAME, TEST_EXCHANGE);
        properties.put(Property.VIRTUALHOST_NAME, TEST_VIRTUAL_HOST);
        properties.put(Property.QUEUE_NAME, TEST_QUEUE);
View Full Code Here

        when(queue.getParent(VirtualHost.class)).thenReturn(_virtualHost);
        when(queue.getName()).thenReturn(TEST_QUEUE);
        when(queue.isDurable()).thenReturn(true);
        when(queue.getLifetimePolicy()).thenReturn(LifetimePolicy.PERMANENT);

        BindingImpl binding = mock(BindingImpl.class);
        when(binding.getExchange()).thenReturn(exchange);
        when(binding.getAMQQueue()).thenReturn(queue);
        when(binding.getBindingKey()).thenReturn("bindingKey");

        ObjectProperties properties = new ObjectProperties();
        properties.put(Property.NAME, TEST_EXCHANGE);
        properties.put(Property.VIRTUALHOST_NAME, TEST_VIRTUAL_HOST);
        properties.put(Property.QUEUE_NAME, TEST_QUEUE);
View Full Code Here

TOP

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

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.