Package org.apache.qpid.server.store

Examples of org.apache.qpid.server.store.ConfiguredObjectRecordImpl


    private boolean setObjectAttributes(ConfiguredObjectRecord entry, Map<String, Object> attributes)
    {
        Map<String, Object> newAttributes = new HashMap<String, Object>(entry.getAttributes());
        newAttributes.putAll(attributes);
        ConfiguredObjectRecord newEntry = new ConfiguredObjectRecordImpl(entry.getId(), entry.getType(), newAttributes,
                                                                         entry.getParents());
        _store.update(false, newEntry);
        return true;
    }
View Full Code Here


        return visitor.getFoundRecord();
    }

    private void addObjectConfiguration(UUID id, String type, Map<String, Object> attributes)
    {
        ConfiguredObjectRecord entry = new ConfiguredObjectRecordImpl(id, type, attributes, Collections.singletonMap(Broker.class.getSimpleName(), findObject(Broker.class,null).getId()));

        _store.update(true, entry);
    }
View Full Code Here

    private boolean setObjectAttribute(ConfiguredObjectRecord entry, String attributeName, Object value)
    {
        Map<String, Object> attributes = new HashMap<String, Object>(entry.getAttributes());
        attributes.put(attributeName, value);
        ConfiguredObjectRecord newEntry = new ConfiguredObjectRecordImpl(entry.getId(), entry.getType(), attributes, entry.getParents());
        _store.update(false, newEntry);
        return true;
    }
View Full Code Here

    }

    public void addPreferencesProviderConfiguration(String authenticationProvider, Map<String, Object> attributes)
    {
        ConfiguredObjectRecord authProviderRecord = findObject(AuthenticationProvider.class, authenticationProvider);
        ConfiguredObjectRecord pp = new ConfiguredObjectRecordImpl(UUIDGenerator.generateRandomUUID(),
                                                                   PreferencesProvider.class.getSimpleName(), attributes, Collections.singletonMap(AuthenticationProvider.class.getSimpleName(),authProviderRecord.getId()));

        _store.create(pp);
    }
View Full Code Here

    public BDBHAVirtualHostNode<?> recoverHaVHN(UUID id, Map<String, Object> attributes)
    {
        Map<String,UUID> parents = new HashMap<>();
        parents.put(Broker.class.getSimpleName(),_broker.getId());
        ConfiguredObjectRecordImpl record = new ConfiguredObjectRecordImpl(id, VirtualHostNode.class.getSimpleName(), attributes, parents );

        @SuppressWarnings("unchecked")
        UnresolvedConfiguredObject<BDBHAVirtualHostNodeImpl> unresolved =  _objectFactory.recover(record, _broker);
        BDBHAVirtualHostNode<?> node = unresolved.resolve();
        node.open();
View Full Code Here

    {
        Map<String,Object> hostAttributes = new LinkedHashMap<>(vhostRecord.getAttributes());
        hostAttributes.put(VirtualHost.MODEL_VERSION, BrokerModel.MODEL_VERSION);
        hostAttributes.put(VirtualHost.NAME, getGroupName());
        hostAttributes.put(VirtualHost.TYPE, BDBHAVirtualHostImpl.VIRTUAL_HOST_TYPE);
        return new ConfiguredObjectRecordImpl(vhostRecord.getId(), vhostRecord.getType(),
                                              hostAttributes, vhostRecord.getParents());
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        _configuredObjectBinding = ConfiguredObjectBinding.getInstance();
        _object = new ConfiguredObjectRecordImpl(UUIDGenerator.generateRandomUUID(), DUMMY_TYPE_STRING,
                DUMMY_ATTRIBUTES_MAP);
    }
View Full Code Here

    {
        List<ConfiguredObjectRecord> replacements = new ArrayList<>(records.size());

        for(ConfiguredObjectRecord record : records)
        {
            replacements.add(new ConfiguredObjectRecordImpl(record.getId(), record.getType(),
                                                            enrichAttributesWithAuditInformation(record.getAttributes()),
                                                            record.getParents()));
        }
        records.clear();
        records.addAll(replacements);
View Full Code Here

        {
            final Map<String, Object> exchangeAttributes = new HashMap<>();
            exchangeAttributes.put(ConfiguredObject.NAME, exchangeName);
            exchangeAttributes.put(ConfiguredObject.TYPE, exchangeClass);

            records.add(new ConfiguredObjectRecordImpl(UUID.randomUUID(), Exchange.class.getSimpleName(),
                                                       exchangeAttributes, Collections.singletonMap(VirtualHost.class.getSimpleName(), vhostRecord.getId())));
        }
    }
View Full Code Here

            updatedAttributes.put(ConfiguredObject.NAME, getName());
            if (!updatedAttributes.containsKey(VirtualHost.MODEL_VERSION))
            {
                updatedAttributes.put(VirtualHost.MODEL_VERSION, getBroker().getModelVersion());
            }
            replacementRecord = new ConfiguredObjectRecordImpl(vhostRecord.getId(),
                                                               vhostRecord.getType(),
                                                               updatedAttributes,
                                                               vhostRecord.getParents());
        }
        else if (vhostRecord.getAttributes().get(VirtualHost.MODEL_VERSION) == null)
        {
            Map<String, Object> updatedAttributes = new LinkedHashMap<>(vhostRecord.getAttributes());

            updatedAttributes.put(VirtualHost.MODEL_VERSION, getBroker().getModelVersion());

            replacementRecord = new ConfiguredObjectRecordImpl(vhostRecord.getId(),
                                                               vhostRecord.getType(),
                                                               updatedAttributes,
                                                               vhostRecord.getParents());
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.ConfiguredObjectRecordImpl

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.