Package java.util

Examples of java.util.UUID


        AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
        when(managerFactory.createInstance(any(Broker.class), any(Map.class))).thenReturn(mock(AuthenticationManager.class));
        when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));

        AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader);
        UUID id = UUID.randomUUID();
        AuthenticationProvider provider = providerFactory.create(id, broker, new HashMap<String, Object>());

        assertNotNull("Provider is not created", provider);
        assertEquals("Unexpected ID", id, provider.getId());
    }
View Full Code Here


                    {
                        newDequeues = new NewRecordImpl[oldDequeues.length];
                        for (int i = 0; i < newDequeues.length; i++)
                        {
                            OldRecordImpl dequeue = oldDequeues[i];
                            UUID id = UUIDGenerator.generateQueueUUID(dequeue.getQueueName(), virtualHostName);
                            newDequeues[i] = new NewRecordImpl(id, dequeue.getMessageNumber());
                        }
                    }
                    if (oldEnqueues != null)
                    {
                        newEnqueues = new NewRecordImpl[oldEnqueues.length];
                        for (int i = 0; i < newEnqueues.length; i++)
                        {
                            OldRecordImpl enqueue = oldEnqueues[i];
                            UUID id = UUIDGenerator.generateQueueUUID(enqueue.getQueueName(), virtualHostName);
                            newEnqueues[i] = new NewRecordImpl(id, enqueue.getMessageNumber());
                        }
                    }
                    NewPreparedTransaction newPreparedTransaction = new NewPreparedTransaction(newEnqueues, newDequeues);
                    DatabaseEntry newValue = new DatabaseEntry();
View Full Code Here

                @Override
                public void processEntry(Database oldDeliveryDatabase, Database newDeliveryDatabase,
                        Transaction transaction, DatabaseEntry key, DatabaseEntry value)
                {
                    OldQueueEntryKey oldEntryRecord = oldBinding.entryToObject(key);
                    UUID queueId = UUIDGenerator.generateQueueUUID(oldEntryRecord.getQueueName().asString(), virtualHostName);

                    NewQueueEntryKey newEntryRecord = new NewQueueEntryKey(queueId, oldEntryRecord.getMessageId());
                    DatabaseEntry newKey = new DatabaseEntry();
                    newBinding.objectToEntry(newEntryRecord, newKey);
                    put(newDeliveryDatabase, transaction, newKey, value);
View Full Code Here

                    String exchangeName = bindingRecord.getExchangeName() == null ? ExchangeDefaults.DEFAULT_EXCHANGE_NAME : bindingRecord.getExchangeName().asString();
                    String queueName = bindingRecord.getQueueName().asString();
                    String routingKey = bindingRecord.getRoutingKey().asString();
                    FieldTable arguments = bindingRecord.getArguments();

                    UUID bindingId = UUIDGenerator.generateBindingUUID(exchangeName, queueName, routingKey, virtualHostName);
                    UpgradeConfiguredObjectRecord configuredObject = createBindingConfiguredObjectRecord(exchangeName, queueName,
                            routingKey, arguments, virtualHostName);
                    storeConfiguredObjectEntry(configuredObjectsDatabase, bindingId, configuredObject, transaction);
                }
View Full Code Here

                    if (!DEFAULT_EXCHANGES_SET.contains(exchangeName) && !"<<default>>".equals(exchangeName))
                    {
                        String exchangeType = exchangeRecord.getType().asString();
                        boolean autoDelete = exchangeRecord.isAutoDelete();

                        UUID exchangeId = UUIDGenerator.generateExchangeUUID(exchangeName, virtualHostName);

                        UpgradeConfiguredObjectRecord configuredObject = createExchangeConfiguredObjectRecord(exchangeName,
                                exchangeType, autoDelete);
                        storeConfiguredObjectEntry(configuredObjectsDatabase, exchangeId, configuredObject, transaction);
                        exchangeNames.add(exchangeName);
View Full Code Here

                    queueNames.add(queueName);
                    String owner = queueRecord.getOwner() == null ? null : queueRecord.getOwner().asString();
                    boolean exclusive = queueRecord.isExclusive();
                    FieldTable arguments = queueRecord.getArguments();

                    UUID queueId = UUIDGenerator.generateQueueUUID(queueName, virtualHostName);
                    UpgradeConfiguredObjectRecord configuredObject = createQueueConfiguredObjectRecord(queueName, owner, exclusive,
                            arguments);
                    storeConfiguredObjectEntry(configuredObjectsDatabase, queueId, configuredObject, transaction);
                }
            };
View Full Code Here

    static class UpgradeUUIDBinding extends TupleBinding<UUID>
    {
        public UUID entryToObject(final TupleInput tupleInput)
        {
            return new UUID(tupleInput.readLong(), tupleInput.readLong());
        }
View Full Code Here

    static class NewQueueEntryBinding extends TupleBinding<NewQueueEntryKey>
    {

        public NewQueueEntryKey entryToObject(TupleInput tupleInput)
        {
            UUID queueId = new UUID(tupleInput.readLong(), tupleInput.readLong());
            long messageId = tupleInput.readLong();

            return new NewQueueEntryKey(queueId, messageId);
        }
View Full Code Here

            return new NewQueueEntryKey(queueId, messageId);
        }

        public void objectToEntry(NewQueueEntryKey mk, TupleOutput tupleOutput)
        {
            UUID uuid = mk.getQueueId();
            tupleOutput.writeLong(uuid.getMostSignificantBits());
            tupleOutput.writeLong(uuid.getLeastSignificantBits());
            tupleOutput.writeLong(mk.getMessageId());
        }
View Full Code Here

        private NewRecordImpl[] readRecords(TupleInput input)
        {
            NewRecordImpl[] records = new NewRecordImpl[input.readInt()];
            for (int i = 0; i < records.length; i++)
            {
                records[i] = new NewRecordImpl(new UUID(input.readLong(), input.readLong()), input.readLong());
            }
            return records;
        }
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.