Package org.apache.qpid.server.model

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


                        Class<? extends ConfiguredObject> clazz =
                                (Class<? extends ConfiguredObject>) Class.forName(type);
                        try
                        {
                            ConfiguredObject child = _managedObject.createChild(clazz, (Map) messageBody);
                            if(child == null)
                            {
                                child = _entities.get(entityType).get(message.getMessageHeader().getHeader(NAME_ATTRIBUTE));
                            }
                            response = performReadOperation(message, child);
View Full Code Here


    }

    private ConfiguredObject findSubject(final String name, final String id, final String type)
    {
        ConfiguredObject subject;
        ManagedEntityType met = _entityTypes.get(type);
        if(met == null)
        {
            return null;
        }
View Full Code Here

    {

        Map<String, ConfiguredObject> objects = _entities.get(entityType);
        if(name != null)
        {
            ConfiguredObject subject = objects.get(name);
            if(subject != null)
            {
                return subject;
            }
        }
View Full Code Here

     * configured object itself
     */
    public void testConfiguredObjectWithSingleConfiguredObjectAttribute() throws Exception
    {
        final String attributeName = "attribute";
        final ConfiguredObject attributeValue = mock(ConfiguredObject.class);
        when(attributeValue.getName()).thenReturn("attributeConfiguredObjectName");

        configureMockToReturnOneAttribute(_configuredObject, attributeName, attributeValue);

        Map<String, Object> resultMap = _converter.convertObjectToMap(_configuredObject, ConfiguredObject.class, 0,
                                                                      false, false, false);
View Full Code Here

                          + "    } ]\n"
                          + "  } ]\n"
                          + "} ";

        ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());
        ConfiguredObject parent = mock(ConfiguredObject.class);
        when(parent.getId()).thenReturn(UUID.randomUUID());
        when(parent.getCategoryClass()).thenReturn(VirtualHostNode.class);
        Collection<ConfiguredObjectRecord> records =
                converter.readFromJson(VirtualHost.class, parent, new StringReader(jsonData));

        UUID exchangeId = null;
        for (ConfiguredObjectRecord record : records)
View Full Code Here

                              + "    } ]\n"
                              + "  } ]\n"
                              + "} ";

            ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());
            ConfiguredObject parent = mock(ConfiguredObject.class);
            when(parent.getId()).thenReturn(UUID.randomUUID());
            when(parent.getCategoryClass()).thenReturn(VirtualHostNode.class);
            try
            {
                converter.readFromJson(VirtualHost.class, parent, new StringReader(jsonData));
                fail("The records should not be converted as there is an unresolved reference");
            }
View Full Code Here

    public void testStateChanged()
    {
        notifyBrokerStarted();
        UUID id = UUID.randomUUID();
        ConfiguredObject object = mock(VirtualHost.class);
        when(object.getId()).thenReturn(id);
        ConfiguredObjectRecord record = mock(ConfiguredObjectRecord.class);
        when(object.asObjectRecord()).thenReturn(record);
        _listener.stateChanged(object, State.ACTIVE, State.DELETED);
        verify(_store).remove(record);
    }
View Full Code Here

    public void testStateChanged()
    {
        notifyBrokerStarted();
        UUID id = UUID.randomUUID();
        ConfiguredObject object = mock(VirtualHost.class);
        when(object.getId()).thenReturn(id);
        ConfiguredObjectRecord record = mock(ConfiguredObjectRecord.class);
        when(object.asObjectRecord()).thenReturn(record);
        _listener.stateChanged(object, State.ACTIVE, State.DELETED);
        verify(_store).remove(record);
    }
View Full Code Here

        Iterator<ConfiguredObject<?>> iter = filteredObj.iterator();

        while(iter.hasNext())
        {
            ConfiguredObject obj = iter.next();
            for(Map.Entry<String, Collection<String>> entry : filters.entrySet())
            {
                Object value = obj.getAttribute(entry.getKey());
                if(!entry.getValue().contains(String.valueOf(value)))
                {
                    iter.remove();
                }
            }
View Full Code Here

        for(Class<? extends ConfiguredObject> parentClazz : parentTypes)
        {
            if(parentClazz == ancestorType)
            {
                ConfiguredObject parent = child.getParent(parentClazz);
                if(parent != null)
                {
                    ancestors.add(parent);
                }
            }
            else
            {
                ConfiguredObject parent = child.getParent(parentClazz);
                if(parent != null)
                {
                    ancestors.addAll(getAncestors(parentClazz, ancestorType, parent));
                }
            }
View Full Code Here

TOP

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

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.