Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.VirtualHost


        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        VirtualHost vhost = _queue.getParent(VirtualHost.class);
        final Queue destinationQueue = MBeanUtils.findQueueFromQueueName(vhost, toQueue);

        vhost.executeTransaction(new VirtualHost.TransactionalOperation()
        {
            public void withinTransaction(final VirtualHost.Transaction txn)
            {
                _queue.visit(new QueueEntryVisitor()
                {
View Full Code Here


        File file = TestFileUtils.createTempFile(this, ".xml", "<virtualhosts><virtualhost><name>" + name + "</name><" + name
                + "></" + name + "></virtualhost></virtualhosts>");
        attributes.put(VirtualHost.CONFIG_PATH, file.getAbsolutePath());
        when(entry.getAttributes()).thenReturn(attributes);

        VirtualHost host = recoverer.create(null, entry, parent);

        assertNotNull("Null is returned", host);
        assertEquals("Unexpected name", getName(), host.getName());
    }
View Full Code Here

        attributes.put(VirtualHost.NAME, getName());
        attributes.put(VirtualHost.STORE_PATH, "/path/to/virtualhost/store");
        attributes.put(VirtualHost.STORE_TYPE, "DERBY");
        when(entry.getAttributes()).thenReturn(attributes);

        VirtualHost host = recoverer.create(null, entry, parent);

        assertNotNull("Null is returned", host);
        assertEquals("Unexpected name", getName(), host.getName());
    }
View Full Code Here

        when(_mockVirtualHostMBean.getRegistry()).thenReturn(_mockManagedObjectRegistry);

        _mockQueue1 = createMockQueue(QUEUE1_NAME);
        _mockQueue2 = createMockQueue(QUEUE2_NAME);

        VirtualHost mockVirtualHost = mock(VirtualHost.class);
        when(mockVirtualHost.getQueues()).thenReturn(Arrays.asList(new Queue[] {_mockQueue1, _mockQueue2}));
        when(_mockExchange.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);

        _exchangeMBean = new ExchangeMBean(_mockExchange, _mockVirtualHostMBean);

        _mockHeadersExchange = mock(Exchange.class);
View Full Code Here

        when(mockExchange2.getName()).thenReturn("exchange2");

        Exchange mockExchange3 = mock(Exchange.class);
        when(mockExchange3.getName()).thenReturn("exchange3");

        VirtualHost mockVirtualHost = mock(VirtualHost.class);
        when(mockVirtualHost.getExchanges()).thenReturn(Arrays.asList(new Exchange[] {mockExchange1, mockExchange2, mockExchange3}));
        when(_mockQueue.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);

        _queueMBean.setAlternateExchange("exchange2");
        verify(_mockQueue).setAttribute(Queue.ALTERNATE_EXCHANGE, null, mockExchange2);
    }
View Full Code Here

    public void testSetAlternateExchangeWithUnknownExchangeName() throws Exception
    {
        Exchange mockExchange = mock(Exchange.class);
        when(mockExchange.getName()).thenReturn("exchange1");

        VirtualHost mockVirtualHost = mock(VirtualHost.class);
        when(mockVirtualHost.getExchanges()).thenReturn(Collections.singletonList(mockExchange));
        when(_mockQueue.getParent(VirtualHost.class)).thenReturn(mockVirtualHost);

        try
        {
            _queueMBean.setAlternateExchange("notknown");
View Full Code Here

        {
            security = _broker.getSecurityManager();
        }
        else
        {
            VirtualHost virtualHost = _broker.findVirtualHostByName(vhost);
            if (virtualHost == null)
            {
                throw new IllegalArgumentException("Virtual host with name '" + vhost + "' is not found.");
            }
            security = virtualHost.getSecurityManager();
        }

        methodName = getMethodName(method, args);
        if (isAccessMethod(methodName) || impact == MBeanOperationInfo.INFO)
        {
View Full Code Here

            try
            {
                AMQManagedObject mbean;
                if(child instanceof VirtualHost)
                {
                    VirtualHost vhostChild = (VirtualHost)child;
                    mbean = new VirtualHostMBean(vhostChild, _objectRegistry);
                }
                else if(child instanceof PasswordCredentialManagingAuthenticationProvider)
                {
                    mbean = new UserManagementMBean((PasswordCredentialManagingAuthenticationProvider) child, _objectRegistry);
View Full Code Here

                    arguments.put(keyAndValue[0], keyAndValue[1]);
                }
            }
        }

        VirtualHost virtualHost = _exchange.getParent(VirtualHost.class);
        Queue queue = MBeanUtils.findQueueFromQueueName(virtualHost, queueName);
        _exchange.createBinding(binding, queue, arguments, Collections.EMPTY_MAP);
    }
View Full Code Here

    }

    public void removeBinding(String queueName, String bindingKey)
            throws IOException, JMException
    {
        VirtualHost virtualHost = _exchange.getParent(VirtualHost.class);
        Queue queue = MBeanUtils.findQueueFromQueueName(virtualHost, queueName);;

        boolean deleted = false;
        for(Binding binding : _exchange.getBindings())
        {
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.VirtualHost

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.