Package java.util

Examples of java.util.UUID


            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);
View Full Code Here


            getNextUpgrader().complete();
        }

        private boolean unknownExchange(final String exchangeIdString)
        {
            UUID exchangeId = UUID.fromString(exchangeIdString);
            ConfiguredObjectRecord localRecord = getUpdateMap().get(exchangeId);
            return !((localRecord != null && localRecord.getType().equals(Exchange.class.getSimpleName()))
                     || _exchangeRegistry.getExchange(exchangeId) != null);
        }
View Full Code Here

                     || _exchangeRegistry.getExchange(exchangeId) != null);
        }

        private boolean unknownQueue(final String queueIdString)
        {
            UUID queueId = UUID.fromString(queueIdString);
            ConfiguredObjectRecord localRecord = getUpdateMap().get(queueId);
            return !((localRecord != null  && localRecord.getType().equals(Queue.class.getSimpleName()))
                     || _virtualHost.getQueue(queueId) != null);
        }
View Full Code Here

    private Binding convertToBinding(AMQQueue queue)
    {
        String queueName = queue.getName();

        UUID exchangeId = UUIDGenerator.generateBindingUUID(ExchangeDefaults.DEFAULT_EXCHANGE_NAME,
                                                            queueName,
                                                            queueName,
                                                            _virtualHost.getName());

        return new Binding(exchangeId, queueName, queue, this, Collections.EMPTY_MAP);
View Full Code Here

        }
    }

    public void testCreateFromExistingLocation() throws Exception
    {
        UUID brokerId = UUID.randomUUID();
        Map<String, Object> brokerAttributes = new HashMap<String, Object>();
        brokerAttributes.put(Broker.NAME, getTestName());
        File file = createStoreFile(brokerId, brokerAttributes);

        JsonConfigurationEntryStore store = new JsonConfigurationEntryStore(file.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
View Full Code Here

        assertEquals("Unexpected version attribute", 1, attributes.get(Broker.STORE_VERSION));
    }

    public void testCreateFromInitialStore() throws Exception
    {
        UUID brokerId = UUID.randomUUID();
        Map<String, Object> brokerAttributes = new HashMap<String, Object>();
        File initialStoreFile = createStoreFile(brokerId, brokerAttributes);

        JsonConfigurationEntryStore initialStore = new JsonConfigurationEntryStore(initialStoreFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());
View Full Code Here

        assertEquals("Unexpected type", "json", getStore().getType());
    }

    public void testUnsupportedStoreVersion() throws Exception
    {
        UUID brokerId = UUID.randomUUID();
        Map<String, Object> brokerAttributes = new HashMap<String, Object>();
        int[] storeVersions = {Integer.MAX_VALUE, 0};
        for (int storeVersion : storeVersions)
        {
            brokerAttributes.put(Broker.STORE_VERSION, storeVersion);
View Full Code Here

        }
    }

    public void testStoreVersionNotSpecified() throws Exception
    {
        UUID brokerId = UUID.randomUUID();
        Map<String, Object> brokerAttributes = new HashMap<String, Object>();
        File storeFile = null;
        try
        {
            storeFile = createStoreFile(brokerId, brokerAttributes, false);
View Full Code Here

        }
    }

    public void testGetPreferencesProvider() throws Exception
    {
        UUID preferencesProviderId = UUID.randomUUID();
        String path = TMP_FOLDER;
        String name = getTestName();

        addPreferencesProvider(preferencesProviderId, name, path);
View Full Code Here

            authenticationAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE,
                    PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
            authenticationAttributes.put(AuthenticationProvider.NAME, "test-authenticator");
            authenticationAttributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH,
                    authenticationProviderFile.getAbsolutePath());
            UUID authenticationId = UUID.randomUUID();

            final PreferencesProviderRecoverer preferencesRecoverer = new PreferencesProviderRecoverer();
            RecovererProvider recovererProvider = new RecovererProvider()
            {
                @Override
                public ConfiguredObjectRecoverer<? extends ConfiguredObject> getRecoverer(String type)
                {
                    return preferencesRecoverer;
                }
            };

            Map<String, Object> preferencesAttributes = new HashMap<String, Object>();
            UUID preferencesId = UUID.randomUUID();
            preferencesAttributes.put(PreferencesProvider.TYPE, FileSystemPreferencesProvider.PROVIDER_TYPE);
            preferencesAttributes.put(PreferencesProvider.NAME, "test-provider");
            File file = TestFileUtils.createTempFile(this, ".prefs.json",
                    "{\"test_user\":{\"pref1\": \"pref1Value\", \"pref2\": 1.0} }");
            preferencesAttributes.put(FileSystemPreferencesProvider.PATH, file.getAbsolutePath());
View Full Code Here

TOP

Related Classes of java.util.UUID

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.