Package org.apache.qpid.server.store

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


        String json = tupleInput.readString();
        ObjectMapper mapper = new ObjectMapper();
        try
        {
            Map<String,Object> value = mapper.readValue(json, Map.class);
            ConfiguredObjectRecord configuredObject = new ConfiguredObjectRecord(_uuid, type, value);
            return configuredObject;
        }
        catch (IOException e)
        {
            //should never happen
View Full Code Here


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

        _configuredObjectBinding.objectToEntry(_object, tupleOutput);

        byte[] entryAsBytes = tupleOutput.getBufferBytes();
        TupleInput tupleInput = new TupleInput(entryAsBytes);

        ConfiguredObjectRecord storedObject = _configuredObjectBinding.entryToObject(tupleInput);
        assertEquals("Unexpected attributes", DUMMY_ATTRIBUTES_MAP, storedObject.getAttributes());
        assertEquals("Unexpected type", DUMMY_TYPE_STRING, storedObject.getType());
    }
View Full Code Here

                                                                         QUEUE_ID,
                                                                         "x-filter-jms-selector",
                                                                         "wibble"));

        final ConfiguredObjectRecord[] expected = {
                new ConfiguredObjectRecord(new UUID(1, 0), "Binding",
                        createBinding("key", DIRECT_EXCHANGE_ID, QUEUE_ID))
        };

        verifyCorrectUpdates(expected);
View Full Code Here

                                             eq(CUSTOM_EXCHANGE_NAME),
                                             eq(HeadersExchange.TYPE.getType()),
                                             anyBoolean())).thenReturn(customExchange);

        final ConfiguredObjectRecord[] expected = {
                new ConfiguredObjectRecord(new UUID(1, 0), "org.apache.qpid.server.model.Binding",
                        createBinding("key", DIRECT_EXCHANGE_ID, QUEUE_ID, "not-a-selector", "moo")),
                new ConfiguredObjectRecord(new UUID(2, 0), "org.apache.qpid.server.model.Binding",
                        createBinding("key", customExchangeId, QUEUE_ID, "not-a-selector", "moo"))
        };

        verifyCorrectUpdates(expected);
View Full Code Here

                                                                         QUEUE_ID,
                                                                         "x-filter-jms-selector",
                                                                         "wibble"));

        final ConfiguredObjectRecord[] expected = {
                new ConfiguredObjectRecord(new UUID(1, 0), "Binding",
                        createBinding("key", TOPIC_EXCHANGE_ID, QUEUE_ID, "x-filter-jms-selector", "wibble"))
        };

        verifyCorrectUpdates(expected);
View Full Code Here

        }

        @Override
        public void configuredObject(final UUID id, final String type, Map<String, Object> attributes)
        {
            _records.put(id, new ConfiguredObjectRecord(id, type, attributes));
        }
View Full Code Here

        @Override
        public void complete()
        {
            for(Map.Entry<UUID,ConfiguredObjectRecord> entry : _records.entrySet())
            {
                ConfiguredObjectRecord record = entry.getValue();
                String type = record.getType();
                Map<String, Object> attributes = record.getAttributes();
                UUID id = record.getId();
                if(type.equals(Binding.class.getName()) && hasSelectorArguments(attributes) && !isTopicExchange(attributes))
                {
                    attributes = new LinkedHashMap<String, Object>(attributes);
                    removeSelectorArguments(attributes);

                    record = new ConfiguredObjectRecord(id, type, attributes);
                    getUpdateMap().put(id, record);
                    entry.setValue(record);

                }
                getNextUpgrader().configuredObject(id, type, attributes);
View Full Code Here

    {
        @Override
        public void configuredObject(final UUID id, String type, final Map<String, Object> attributes)
        {
            type = type.substring(1+type.lastIndexOf('.'));
            getUpdateMap().put(id, new ConfiguredObjectRecord(id, type, attributes));

        }
View Full Code Here

        @Override
        public void complete()
        {
            for(Map.Entry<UUID, ConfiguredObjectRecord> entry : getUpdateMap().entrySet())
            {
                final ConfiguredObjectRecord record = entry.getValue();
                if(isBinding(record.getType()) && (unknownExchange((String) record.getAttributes().get(Binding.EXCHANGE))
                                                   || unknownQueue((String) record.getAttributes().get(Binding.QUEUE))))
                {
                    entry.setValue(null);
                }
                else
                {
                    getNextUpgrader().configuredObject(record.getId(), record.getType(), record.getAttributes());
                }
            }
            getNextUpgrader().complete();
        }
View Full Code Here

TOP

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

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.