Author: elecharny
Date: Wed Aug 29 17:13:56 2012
New Revision: 1378653
URL: http://svn.apache.org/viewvc?rev=1378653&view=rev
Log:
As the RFC says :
"In LDAP, UUID values are encoded using the [ASCII] character string
representation described in [RFC4122]. For example,
"597ae2f6-16a6-1027-98f4-d28b5365dc14".",
o translated all the UUID to String on the server.
Modified:
directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
directory/apacheds/branches/apacheds-mvbt/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UuidSerializer.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java
directory/apacheds/branches/apacheds-mvbt/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/MasterTable.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlMasterTable.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/AndEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/ApproximateEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/EqualityEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/LeafEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/LessEqEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/NotEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OrEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/PresenceEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubstringEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/AbstractIndexCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/PartitionTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
directory/shared/branches/shared-mvbt/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UuidComparator.java
directory/shared/branches/shared-mvbt/util/src/main/java/org/apache/directory/shared/util/Strings.java
Modified: directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java Wed Aug 29 17:13:56 2012
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
import java.io.File;
import java.util.Set;
-import java.util.UUID;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
@@ -68,7 +67,7 @@ public class AvlPartitionFactory impleme
}
AvlPartition avlPartition = ( AvlPartition ) partition;
- Set<Index<?, Entry, UUID>> indexedAttributes = avlPartition.getIndexedAttributes();
+ Set<Index<?, Entry, String>> indexedAttributes = avlPartition.getIndexedAttributes();
AvlIndex<Object, Entry> index = new AvlIndex<Object, Entry>( attributeId, false );
//index.setCacheSize( cacheSize );
Modified: directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java Wed Aug 29 17:13:56 2012
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
import java.io.File;
import java.util.Set;
-import java.util.UUID;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
@@ -68,7 +67,7 @@ public class JdbmPartitionFactory implem
}
JdbmPartition jdbmPartition = ( JdbmPartition ) partition;
- Set<Index<?, Entry, UUID>> indexedAttributes = jdbmPartition.getIndexedAttributes();
+ Set<Index<?, Entry, String>> indexedAttributes = jdbmPartition.getIndexedAttributes();
JdbmIndex<Object, Entry> index = new JdbmIndex<Object, Entry>( attributeId, false );
index.setCacheSize( cacheSize );
Modified: directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java Wed Aug 29 17:13:56 2012
@@ -21,7 +21,6 @@ package org.apache.directory.server.core
import java.io.File;
import java.util.Set;
-import java.util.UUID;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.ldif.LdifPartition;
@@ -68,7 +67,7 @@ public class LdifPartitionFactory implem
}
LdifPartition ldifPartition = ( LdifPartition ) partition;
- Set<Index<?, Entry, UUID>> indexedAttributes = ldifPartition.getIndexedAttributes();
+ Set<Index<?, Entry, String>> indexedAttributes = ldifPartition.getIndexedAttributes();
AvlIndex<Object, Entry> index = new AvlIndex<Object, Entry>( attributeId, false );
//index.setCacheSize( cacheSize );
Modified: directory/apacheds/branches/apacheds-mvbt/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/core-api/src/main/java/org/apache/directory/server/core/api/partition/Partition.java Wed Aug 29 17:13:56 2012
@@ -54,10 +54,10 @@ import org.apache.directory.shared.ldap.
public interface Partition
{
/** root ID common to all partitions */
- UUID ROOT_ID = new UUID( 0L, 0L );
+ String ROOT_ID = new UUID( 0L, 0L ).toString();
/** Default id used for context entry if context entry doesn't exists */
- UUID DEFAULT_ID = new UUID( 0L, 1L );
+ String DEFAULT_ID = new UUID( 0L, 1L ).toString();
// -----------------------------------------------------------------------
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Wed Aug 29 17:13:56 2012
@@ -24,7 +24,6 @@ import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URI;
-import java.util.UUID;
import jdbm.RecordManager;
import jdbm.recman.BaseRecordManager;
@@ -52,7 +51,7 @@ import org.slf4j.LoggerFactory;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class JdbmIndex<K, V> extends AbstractIndex<K, V, UUID>
+public class JdbmIndex<K, V> extends AbstractIndex<K, V, String>
{
/** A logger for this class */
private static final Logger LOG = LoggerFactory.getLogger( JdbmIndex.class.getSimpleName() );
@@ -73,14 +72,14 @@ public class JdbmIndex<K, V> extends Abs
* the value of the btree is the entry id of the entry containing an attribute with
* that value
*/
- protected JdbmTable<K, UUID> forward;
+ protected JdbmTable<K, String> forward;
/**
* the reverse btree where the btree key is the entry id of the entry containing a
* value for the indexed attribute, and the btree value is the value of the indexed
* attribute
*/
- protected JdbmTable<UUID, K> reverse;
+ protected JdbmTable<String, K> reverse;
/**
* the JDBM record manager for the file containing this index
@@ -209,7 +208,7 @@ public class JdbmIndex<K, V> extends Abs
UuidComparator.INSTANCE.setSchemaManager( schemaManager );
comp.setSchemaManager( schemaManager );
- forward = new JdbmTable<K, UUID>( schemaManager, attributeType.getOid() + FORWARD_BTREE, numDupLimit, recMan,
+ forward = new JdbmTable<K, String>( schemaManager, attributeType.getOid() + FORWARD_BTREE, numDupLimit, recMan,
comp, UuidComparator.INSTANCE, null, UuidSerializer.INSTANCE );
/*
@@ -222,12 +221,12 @@ public class JdbmIndex<K, V> extends Abs
{
if ( attributeType.isSingleValued() )
{
- reverse = new JdbmTable<UUID, K>( schemaManager, attributeType.getOid() + REVERSE_BTREE, recMan,
+ reverse = new JdbmTable<String, K>( schemaManager, attributeType.getOid() + REVERSE_BTREE, recMan,
UuidComparator.INSTANCE, UuidSerializer.INSTANCE, null );
}
else
{
- reverse = new JdbmTable<UUID, K>( schemaManager, attributeType.getOid() + REVERSE_BTREE, numDupLimit,
+ reverse = new JdbmTable<String, K>( schemaManager, attributeType.getOid() + REVERSE_BTREE, numDupLimit,
recMan,
UuidComparator.INSTANCE, comp, UuidSerializer.INSTANCE, null );
}
@@ -332,7 +331,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* @see Index#forwardLookup(java.lang.Object)
*/
- public UUID forwardLookup( K attrVal ) throws Exception
+ public String forwardLookup( K attrVal ) throws Exception
{
return forward.get( attrVal );
}
@@ -341,7 +340,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public K reverseLookup( UUID id ) throws Exception
+ public K reverseLookup( String id ) throws Exception
{
if ( withReverse )
{
@@ -361,7 +360,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public synchronized void add( K attrVal, UUID id ) throws Exception
+ public synchronized void add( K attrVal, String id ) throws Exception
{
// The pair to be removed must exists
forward.put( attrVal, id );
@@ -376,7 +375,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public synchronized void drop( K attrVal, UUID id ) throws Exception
+ public synchronized void drop( K attrVal, String id ) throws Exception
{
// The pair to be removed must exists
if ( forward.has( attrVal, id ) )
@@ -394,7 +393,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public void drop( UUID entryId ) throws Exception
+ public void drop( String entryId ) throws Exception
{
if ( withReverse )
{
@@ -402,7 +401,7 @@ public class JdbmIndex<K, V> extends Abs
{
// Build a cursor to iterate on all the keys referencing
// this entryId
- Cursor<Tuple<UUID, K>> values = reverse.cursor( entryId );
+ Cursor<Tuple<String, K>> values = reverse.cursor( entryId );
while ( values.next() )
{
@@ -429,7 +428,7 @@ public class JdbmIndex<K, V> extends Abs
// Index Cursor Operations
// ------------------------------------------------------------------------
@SuppressWarnings("unchecked")
- public Cursor<IndexEntry<K, UUID>> reverseCursor() throws Exception
+ public Cursor<IndexEntry<K, String>> reverseCursor() throws Exception
{
if ( withReverse )
{
@@ -443,14 +442,14 @@ public class JdbmIndex<K, V> extends Abs
@SuppressWarnings("unchecked")
- public Cursor<IndexEntry<K, UUID>> forwardCursor() throws Exception
+ public Cursor<IndexEntry<K, String>> forwardCursor() throws Exception
{
return new IndexCursorAdaptor<K>( ( Cursor ) forward.cursor(), true );
}
@SuppressWarnings("unchecked")
- public Cursor<IndexEntry<K, UUID>> reverseCursor( UUID id ) throws Exception
+ public Cursor<IndexEntry<K, String>> reverseCursor( String id ) throws Exception
{
if ( withReverse )
{
@@ -464,13 +463,13 @@ public class JdbmIndex<K, V> extends Abs
@SuppressWarnings("unchecked")
- public Cursor<IndexEntry<K, UUID>> forwardCursor( K key ) throws Exception
+ public Cursor<IndexEntry<K, String>> forwardCursor( K key ) throws Exception
{
return new IndexCursorAdaptor<K>( ( Cursor ) forward.cursor( key ), true );
}
- public Cursor<K> reverseValueCursor( UUID id ) throws Exception
+ public Cursor<K> reverseValueCursor( String id ) throws Exception
{
if ( withReverse )
{
@@ -483,7 +482,7 @@ public class JdbmIndex<K, V> extends Abs
}
- public Cursor<UUID> forwardValueCursor( K key ) throws Exception
+ public Cursor<String> forwardValueCursor( K key ) throws Exception
{
return forward.valueCursor( key );
}
@@ -504,7 +503,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean forward( K attrVal, UUID id ) throws Exception
+ public boolean forward( K attrVal, String id ) throws Exception
{
return forward.has( attrVal, id );
}
@@ -513,7 +512,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverse( UUID id ) throws Exception
+ public boolean reverse( String id ) throws Exception
{
if ( withReverse )
{
@@ -529,7 +528,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverse( UUID id, K attrVal ) throws Exception
+ public boolean reverse( String id, K attrVal ) throws Exception
{
return forward.has( attrVal, id );
}
@@ -547,7 +546,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean forwardGreaterOrEq( K attrVal, UUID id ) throws Exception
+ public boolean forwardGreaterOrEq( K attrVal, String id ) throws Exception
{
return forward.hasGreaterOrEqual( attrVal, id );
}
@@ -565,7 +564,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean forwardLessOrEq( K attrVal, UUID id ) throws Exception
+ public boolean forwardLessOrEq( K attrVal, String id ) throws Exception
{
return forward.hasLessOrEqual( attrVal, id );
}
@@ -574,7 +573,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverseGreaterOrEq( UUID id ) throws Exception
+ public boolean reverseGreaterOrEq( String id ) throws Exception
{
if ( withReverse )
{
@@ -590,7 +589,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverseGreaterOrEq( UUID id, K attrVal ) throws Exception
+ public boolean reverseGreaterOrEq( String id, K attrVal ) throws Exception
{
if ( withReverse )
{
@@ -606,7 +605,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverseLessOrEq( UUID id ) throws Exception
+ public boolean reverseLessOrEq( String id ) throws Exception
{
if ( withReverse )
{
@@ -622,7 +621,7 @@ public class JdbmIndex<K, V> extends Abs
/**
* {@inheritDoc}
*/
- public boolean reverseLessOrEq( UUID id, K attrVal ) throws Exception
+ public boolean reverseLessOrEq( String id, K attrVal ) throws Exception
{
if ( withReverse )
{
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java Wed Aug 29 17:13:56 2012
@@ -37,7 +37,7 @@ import org.apache.directory.shared.ldap.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class JdbmMasterTable<E> extends JdbmTable<UUID, E> implements MasterTable<E>
+public class JdbmMasterTable<E> extends JdbmTable<String, E> implements MasterTable<E>
{
private static final StringComparator STRCOMP = new StringComparator();
@@ -104,9 +104,9 @@ public class JdbmMasterTable<E> extends
* @throws Exception if the admin table storing sequences cannot be
* read and written to.
*/
- public UUID getNextId( E entry ) throws Exception
+ public String getNextId( E entry ) throws Exception
{
- return UUID.randomUUID();
+ return UUID.randomUUID().toString();
}
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Wed Aug 29 17:13:56 2012
@@ -27,7 +27,6 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.UUID;
import jdbm.RecordManager;
import jdbm.recman.BaseRecordManager;
@@ -160,18 +159,18 @@ public class JdbmPartition extends Abstr
// then add all index objects to a list
List<String> allIndices = new ArrayList<String>();
- for ( Index<?, Entry, UUID> index : systemIndices.values() )
+ for ( Index<?, Entry, String> index : systemIndices.values() )
{
allIndices.add( index.getAttribute().getOid() );
}
- List<Index<?, Entry, UUID>> indexToBuild = new ArrayList<Index<?, Entry, UUID>>();
+ List<Index<?, Entry, String>> indexToBuild = new ArrayList<Index<?, Entry, String>>();
// this loop is used for two purposes
// one for collecting all user indices
// two for finding a new index to be built
// just to avoid another iteration for determining which is the new index
- for ( Index<?, Entry, UUID> index : userIndices.values() )
+ for ( Index<?, Entry, String> index : userIndices.values() )
{
String indexOid = index.getAttribute().getOid();
allIndices.add( indexOid );
@@ -203,18 +202,18 @@ public class JdbmPartition extends Abstr
/**
* {@inheritDoc}}
*/
- public UUID getDefaultId()
+ public String getDefaultId()
{
- return new UUID( 0L, 1L );
+ return Partition.DEFAULT_ID;
}
/**
* {@inheritDoc}
*/
- public UUID getRootId()
+ public String getRootId()
{
- return new UUID( 0L, 0L );
+ return Partition.ROOT_ID;
}
@@ -232,13 +231,13 @@ public class JdbmPartition extends Abstr
}
// Sync all system indices
- for ( Index<?, Entry, UUID> idx : systemIndices.values() )
+ for ( Index<?, Entry, String> idx : systemIndices.values() )
{
idx.sync();
}
// Sync all user defined userIndices
- for ( Index<?, Entry, UUID> idx : userIndices.values() )
+ for ( Index<?, Entry, String> idx : userIndices.values() )
{
idx.sync();
}
@@ -254,9 +253,9 @@ public class JdbmPartition extends Abstr
* @param userIndexes then user defined indexes to create
* @throws Exception in case of any problems while building the index
*/
- private void buildUserIndex( List<Index<?, Entry, UUID>> userIndexes ) throws Exception
+ private void buildUserIndex( List<Index<?, Entry, String>> userIndexes ) throws Exception
{
- Cursor<Tuple<UUID, Entry>> cursor = master.cursor();
+ Cursor<Tuple<String, Entry>> cursor = master.cursor();
cursor.beforeFirst();
while ( cursor.next() )
@@ -269,9 +268,9 @@ public class JdbmPartition extends Abstr
LOG.info( "building the index for attribute type {}", atType );
- Tuple<UUID, Entry> tuple = cursor.get();
+ Tuple<String, Entry> tuple = cursor.get();
- UUID id = tuple.getKey();
+ String id = tuple.getKey();
Entry entry = tuple.getValue();
Attribute entryAttr = entry.get( atType );
@@ -344,7 +343,7 @@ public class JdbmPartition extends Abstr
/**
* {@inheritDoc}
*/
- protected Index<?, Entry, UUID> convertAndInit( Index<?, Entry, UUID> index ) throws Exception
+ protected Index<?, Entry, String> convertAndInit( Index<?, Entry, String> index ) throws Exception
{
JdbmIndex<?, Entry> jdbmIndex;
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java Wed Aug 29 17:13:56 2012
@@ -24,7 +24,6 @@ package org.apache.directory.server.core
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.UUID;
import javax.naming.NamingException;
@@ -127,13 +126,13 @@ public class JdbmRdnIndex extends JdbmIn
throw new IOException( I18n.err( I18n.ERR_574, attributeType.getName() ) );
}
- ParentIdAndRdnComparator<UUID> comp = new ParentIdAndRdnComparator<UUID>( mr.getOid() );
+ ParentIdAndRdnComparator<String> comp = new ParentIdAndRdnComparator<String>( mr.getOid() );
UuidComparator.INSTANCE.setSchemaManager( schemaManager );
- forward = new JdbmTable<ParentIdAndRdn, UUID>( schemaManager, attributeType.getOid() + FORWARD_BTREE,
+ forward = new JdbmTable<ParentIdAndRdn, String>( schemaManager, attributeType.getOid() + FORWARD_BTREE,
recMan, comp, null, UuidSerializer.INSTANCE );
- reverse = new JdbmTable<UUID, ParentIdAndRdn>( schemaManager, attributeType.getOid() + REVERSE_BTREE,
+ reverse = new JdbmTable<String, ParentIdAndRdn>( schemaManager, attributeType.getOid() + REVERSE_BTREE,
recMan, UuidComparator.INSTANCE, UuidSerializer.INSTANCE, null );
}
}
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UuidSerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UuidSerializer.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UuidSerializer.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UuidSerializer.java Wed Aug 29 17:13:56 2012
@@ -21,10 +21,11 @@ package org.apache.directory.server.core
import java.io.IOException;
-import java.util.UUID;
import jdbm.helper.Serializer;
+import org.apache.directory.shared.util.Strings;
+
/**
* A {@link Serializer} for Longs
@@ -39,71 +40,14 @@ public class UuidSerializer implements S
public byte[] serialize( Object o ) throws IOException
{
- UUID uuid = ( UUID ) o;
- byte[] bites = new byte[16];
-
- long id = uuid.getMostSignificantBits();
+ String uuid = ( String ) o;
- bites[0] = ( byte ) ( id >> 56 );
- bites[1] = ( byte ) ( id >> 48 );
- bites[2] = ( byte ) ( id >> 40 );
- bites[3] = ( byte ) ( id >> 32 );
- bites[4] = ( byte ) ( id >> 24 );
- bites[5] = ( byte ) ( id >> 16 );
- bites[6] = ( byte ) ( id >> 8 );
- bites[7] = ( byte ) id;
-
- id = uuid.getLeastSignificantBits();
-
- bites[8] = ( byte ) ( id >> 56 );
- bites[9] = ( byte ) ( id >> 48 );
- bites[10] = ( byte ) ( id >> 40 );
- bites[11] = ( byte ) ( id >> 32 );
- bites[12] = ( byte ) ( id >> 24 );
- bites[13] = ( byte ) ( id >> 16 );
- bites[14] = ( byte ) ( id >> 8 );
- bites[15] = ( byte ) id;
-
- return bites;
+ return Strings.getBytesUtf8( uuid );
}
- public Object deserialize( byte[] bites ) throws IOException
+ public Object deserialize( byte[] bytes ) throws IOException
{
- long msb;
- msb = bites[0] + ( ( bites[0] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[1] + ( ( bites[1] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[2] + ( ( bites[2] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[3] + ( ( bites[3] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[4] + ( ( bites[4] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[5] + ( ( bites[5] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[6] + ( ( bites[6] < 0 ) ? 256 : 0 );
- msb <<= 8;
- msb += bites[7] + ( ( bites[7] < 0 ) ? 256 : 0 );
-
- long lsb;
- lsb = bites[8] + ( ( bites[8] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[9] + ( ( bites[9] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[10] + ( ( bites[10] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[11] + ( ( bites[11] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[12] + ( ( bites[12] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[13] + ( ( bites[13] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[14] + ( ( bites[14] < 0 ) ? 256 : 0 );
- lsb <<= 8;
- lsb += bites[15] + ( ( bites[15] < 0 ) ? 256 : 0 );
-
- return new UUID( msb, lsb );
+ return Strings.utf8ToString( bytes );
}
}
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Wed Aug 29 17:13:56 2012
@@ -28,7 +28,6 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
-import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.directory.server.xdbm.Index;
@@ -58,7 +57,7 @@ import org.junit.Test;
public class JdbmIndexTest
{
private static File dbFileDir;
- Index<String, Entry, UUID> idx;
+ Index<String, Entry, String> idx;
private static SchemaManager schemaManager;
@@ -377,11 +376,11 @@ public class JdbmIndexTest
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "foo" ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
idx.add( "foo", Strings.getUUID( 1L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "foo" ) );
@@ -389,12 +388,12 @@ public class JdbmIndexTest
assertTrue( idx.forward( "foo", Strings.getUUID( 1L ) ) );
assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 2L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
idx.add( "bar", Strings.getUUID( 0L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "bar" ) );
@@ -404,15 +403,15 @@ public class JdbmIndexTest
assertTrue( idx.forwardGreaterOrEq( "bar", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 2L ) ) );
assertFalse( idx.forwardGreaterOrEq( "bar", Strings.getUUID( 1L ) ) );
assertTrue( idx.forwardLessOrEq( "bar", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
- assertFalse( idx.forwardLessOrEq( "bar", Strings.getUUID( -1L ) ) );
+ assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
+ assertTrue( idx.forwardLessOrEq( "bar", Strings.getUUID( -1L ) ) );
}
@@ -506,23 +505,23 @@ public class JdbmIndexTest
assertEquals( 3, idx.count() );
// use forward index's cursor
- Cursor<IndexEntry<String, UUID>> cursor = idx.forwardCursor();
+ Cursor<IndexEntry<String, String>> cursor = idx.forwardCursor();
cursor.beforeFirst();
assertEquals( 3, idx.count() );
cursor.next();
- IndexEntry<String, UUID> e1 = cursor.get();
+ IndexEntry<String, String> e1 = cursor.get();
assertEquals( Strings.getUUID( 555L ), e1.getId() );
assertEquals( "bar", e1.getKey() );
cursor.next();
- IndexEntry<String, UUID> e2 = cursor.get();
+ IndexEntry<String, String> e2 = cursor.get();
assertEquals( Strings.getUUID( 333L ), e2.getId() );
assertEquals( "foo", e2.getKey() );
cursor.next();
- IndexEntry<String, UUID> e3 = cursor.get();
+ IndexEntry<String, String> e3 = cursor.get();
assertEquals( Strings.getUUID( 1234L ), e3.getId() );
assertEquals( "foo", e3.getKey() );
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java Wed Aug 29 17:13:56 2012
@@ -27,7 +27,6 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
-import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.directory.server.constants.ApacheSchemaConstants;
@@ -58,7 +57,7 @@ import org.junit.Test;
public class JdbmRdnIndexTest
{
private static File dbFileDir;
- Index<ParentIdAndRdn, Entry, UUID> idx;
+ Index<ParentIdAndRdn, Entry, String> idx;
private static SchemaManager schemaManager;
@@ -350,23 +349,23 @@ public class JdbmRdnIndexTest
assertEquals( 5, idx.count() );
// use forward index's cursor
- Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = idx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = idx.forwardCursor();
cursor.beforeFirst();
cursor.next();
- IndexEntry<ParentIdAndRdn, UUID> e1 = cursor.get();
+ IndexEntry<ParentIdAndRdn, String> e1 = cursor.get();
assertEquals( Strings.getUUID( 0L ), e1.getId() );
assertEquals( "cn=key", e1.getKey().getRdns()[0].getName() );
assertEquals( Strings.getUUID( 0L ), e1.getKey().getParentId() );
cursor.next();
- IndexEntry<ParentIdAndRdn, UUID> e2 = cursor.get();
+ IndexEntry<ParentIdAndRdn, String> e2 = cursor.get();
assertEquals( Strings.getUUID( 1L ), e2.getId() );
assertEquals( "cn=key1", e2.getKey().getRdns()[0].getName() );
assertEquals( Strings.getUUID( 1L ), e2.getKey().getParentId() );
cursor.next();
- IndexEntry<ParentIdAndRdn, UUID> e3 = cursor.get();
+ IndexEntry<ParentIdAndRdn, String> e3 = cursor.get();
assertEquals( Strings.getUUID( 2L ), e3.getId() );
assertEquals( "cn=key2", e3.getKey().getRdns()[0].getName() );
assertEquals( Strings.getUUID( 2 ), e3.getKey().getParentId() );
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Wed Aug 29 17:13:56 2012
@@ -222,7 +222,7 @@ public class JdbmStoreTest
store2.add( new AddOperationContext( null, entry ) );
// lookup the context entry
- UUID id = store2.getEntryId( suffixDn );
+ String id = store2.getEntryId( suffixDn );
Entry lookup = store2.lookup( id, suffixDn );
assertEquals( 2, lookup.getDn().size() );
@@ -238,7 +238,7 @@ public class JdbmStoreTest
jdbmPartition.setSyncOnWrite( true ); // for code coverage
assertNull( jdbmPartition.getAliasIndex() );
- Index<String, Entry, UUID> index = new JdbmIndex<String, Entry>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
+ Index<String, Entry, String> index = new JdbmIndex<String, Entry>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID,
true );
( ( Store<Entry> ) jdbmPartition ).addIndex( index );
assertNotNull( jdbmPartition.getAliasIndex() );
@@ -486,7 +486,7 @@ public class JdbmStoreTest
{
assertEquals( 3, store.getChildCount( Strings.getUUID( 1L ) ) );
- Cursor<IndexEntry<UUID, UUID>> cursor = store.list( Strings.getUUID( 1L ) );
+ Cursor<IndexEntry<String, String>> cursor = store.list( Strings.getUUID( 1L ) );
assertNotNull( cursor );
cursor.beforeFirst();
assertTrue( cursor.next() );
@@ -613,7 +613,7 @@ public class JdbmStoreTest
store.rename( dn, rdn, true, null );
Dn dn2 = new Dn( schemaManager, "sn=Ja\\+es,ou=Engineering,o=Good Times Co." );
- UUID id = store.getEntryId( dn2 );
+ String id = store.getEntryId( dn2 );
assertNotNull( id );
Entry entry2 = store.lookup( id, dn2 );
assertEquals( "Ja+es", entry2.get( "sn" ).getString() );
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java Wed Aug 29 17:13:56 2012
@@ -22,8 +22,8 @@ package org.apache.directory.server.core
import java.net.URI;
-import java.util.UUID;
+import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
import org.apache.directory.shared.ldap.model.csn.CsnFactory;
import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -56,9 +56,9 @@ public abstract class AbstractLdifPartit
/**
* {@inheritDoc}
*/
- public UUID getDefaultId()
+ public String getDefaultId()
{
- return new UUID( 0L, 1L );
+ return Partition.DEFAULT_ID;
}
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Wed Aug 29 17:13:56 2012
@@ -226,7 +226,7 @@ public class LdifPartition extends Abstr
/**
* {@inheritDoc}
*/
- public void delete( UUID id ) throws LdapException
+ public void delete( String id ) throws LdapException
{
Entry entry = lookup( id );
@@ -258,7 +258,7 @@ public class LdifPartition extends Abstr
*/
public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
- UUID id = getEntryId( modifyContext.getDn() );
+ String id = getEntryId( modifyContext.getDn() );
try
{
@@ -297,7 +297,7 @@ public class LdifPartition extends Abstr
public void move( MoveOperationContext moveContext ) throws LdapException
{
Dn oldDn = moveContext.getDn();
- UUID id = getEntryId( oldDn );
+ String id = getEntryId( oldDn );
super.move( moveContext );
@@ -321,7 +321,7 @@ public class LdifPartition extends Abstr
public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Dn oldDn = moveAndRenameContext.getDn();
- UUID id = getEntryId( oldDn );
+ String id = getEntryId( oldDn );
super.moveAndRename( moveAndRenameContext );
@@ -346,7 +346,7 @@ public class LdifPartition extends Abstr
public void rename( RenameOperationContext renameContext ) throws LdapException
{
Dn oldDn = renameContext.getDn();
- UUID id = getEntryId( oldDn );
+ String id = getEntryId( oldDn );
// Create the new entry
super.rename( renameContext );
@@ -379,12 +379,12 @@ public class LdifPartition extends Abstr
* @param deleteOldEntry a flag to tell whether to delete the old entry files
* @throws Exception
*/
- private void entryMoved( Dn oldEntryDn, Entry modifiedEntry, UUID entryIdOld ) throws Exception
+ private void entryMoved( Dn oldEntryDn, Entry modifiedEntry, String entryIdOld ) throws Exception
{
// First, add the new entry
addEntry( modifiedEntry );
- UUID baseId = getEntryId( modifiedEntry.getDn() );
+ String baseId = getEntryId( modifiedEntry.getDn() );
ParentIdAndRdn parentIdAndRdn = getRdnIndex().reverseLookup( baseId );
IndexEntry indexEntry = new ForwardIndexEntry();
@@ -392,18 +392,18 @@ public class LdifPartition extends Abstr
indexEntry.setId( baseId );
indexEntry.setKey( parentIdAndRdn );
- Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
+ Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
indexEntry );
- UUID parentId = parentIdAndRdn.getParentId();
+ String parentId = parentIdAndRdn.getParentId();
- Cursor<IndexEntry<UUID, UUID>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );
+ Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );
// Then, if there are some children, move then to the new place
try
{
while ( scopeCursor.next() )
{
- IndexEntry<UUID, UUID> entry = scopeCursor.get();
+ IndexEntry<String, String> entry = scopeCursor.get();
// except the parent entry add the rest of entries
if ( entry.getId() != entryIdOld )
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java Wed Aug 29 17:13:56 2012
@@ -262,7 +262,7 @@ public class SingleFileLdifPartition ext
@Override
- public void delete( UUID id ) throws LdapException
+ public void delete( String id ) throws LdapException
{
synchronized ( lock )
{
@@ -292,7 +292,7 @@ public class SingleFileLdifPartition ext
{
ldifFile.setLength( 0 ); // wipe the file clean
- UUID suffixId = getEntryId( suffixDn );
+ String suffixId = getEntryId( suffixDn );
if ( suffixId == null )
{
@@ -325,20 +325,20 @@ public class SingleFileLdifPartition ext
}
- private void appendRecursive( UUID id, int nbSibbling ) throws Exception
+ private void appendRecursive( String id, int nbSibbling ) throws Exception
{
// Start with the root
- Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = rdnIdx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = rdnIdx.forwardCursor();
- IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
+ IndexEntry<ParentIdAndRdn, String> startingPos = new ForwardIndexEntry<ParentIdAndRdn, String>();
startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
cursor.before( startingPos );
int countChildren = 0;
while ( cursor.next() && ( countChildren < nbSibbling ) )
{
- IndexEntry<ParentIdAndRdn, UUID> element = cursor.get();
- UUID childId = element.getId();
+ IndexEntry<ParentIdAndRdn, String> element = cursor.get();
+ String childId = element.getId();
Entry entry = lookup( childId );
appendLdif( entry );
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java Wed Aug 29 17:13:56 2012
@@ -276,7 +276,7 @@ public class SingleFileLdifPartitionTest
partition.add( addCtx );
- UUID id = partition.getEntryId( contextEntry.getDn() );
+ String id = partition.getEntryId( contextEntry.getDn() );
assertNotNull( id );
assertEquals( contextEntry, partition.lookup( id ) );
@@ -843,7 +843,7 @@ public class SingleFileLdifPartitionTest
partition.add( addCtx );
// search works fine
- UUID id = partition.getEntryId( contextEntry.getDn() );
+ String id = partition.getEntryId( contextEntry.getDn() );
assertNotNull( id );
assertEquals( contextEntry, partition.lookup( id ) );
Modified: directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Wed Aug 29 17:13:56 2012
@@ -33,7 +33,6 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.UUID;
import org.apache.directory.server.config.beans.AdsBaseBean;
import org.apache.directory.server.config.beans.ConfigBean;
@@ -728,7 +727,7 @@ public class ConfigPartitionReader
// Prepare the search request
AttributeType adsdAt = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
EqualityNode<?> filter = new EqualityNode( adsdAt, new StringValue( name ) );
- Cursor<IndexEntry<UUID, UUID>> cursor = null;
+ Cursor<IndexEntry<String, String>> cursor = null;
// Create a container for all the read beans
List<AdsBaseBean> beans = new ArrayList<AdsBaseBean>();
@@ -760,7 +759,7 @@ public class ConfigPartitionReader
// Loop on all the found elements
do
{
- ForwardIndexEntry<UUID, UUID> forwardEntry = ( ForwardIndexEntry<UUID, UUID> ) cursor
+ ForwardIndexEntry<String, String> forwardEntry = ( ForwardIndexEntry<String, String> ) cursor
.get();
// Now, get the entry
Modified: directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java Wed Aug 29 17:13:56 2012
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertTru
import static org.junit.Assert.fail;
import java.io.File;
-import java.util.UUID;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.xdbm.Index;
@@ -120,7 +119,7 @@ public class IndexTest
}
- private void doTest( Index<String, Entry, UUID> idx ) throws Exception
+ private void doTest( Index<String, Entry, String> idx ) throws Exception
{
String alphabet = "abcdefghijklmnopqrstuvwxyz";
@@ -132,7 +131,7 @@ public class IndexTest
assertEquals( 26, idx.count() );
- Cursor<IndexEntry<String, UUID>> cursor1 = idx.forwardCursor();
+ Cursor<IndexEntry<String, String>> cursor1 = idx.forwardCursor();
cursor1.beforeFirst();
assertHasNext( cursor1, Strings.getUUID( 1L ) );
@@ -151,7 +150,7 @@ public class IndexTest
}
- private void assertHasNext( Cursor<IndexEntry<String, UUID>> cursor1, UUID expectedId ) throws Exception
+ private void assertHasNext( Cursor<IndexEntry<String, String>> cursor1, String expectedId ) throws Exception
{
assertTrue( cursor1.next() );
assertEquals( expectedId, cursor1.get().getId() );
Modified: directory/apacheds/branches/apacheds-mvbt/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java Wed Aug 29 17:13:56 2012
@@ -31,7 +31,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
-import java.util.UUID;
import org.apache.directory.server.config.ConfigSchemaConstants;
import org.apache.directory.server.config.ConfigurationException;
@@ -1135,10 +1134,11 @@ public class ServiceBuilder
/**
* Create the list of Index from the configuration
*/
- private static Set<Index<?, Entry, UUID>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans,
+ private static Set<Index<?, Entry, String>> createJdbmIndexes( JdbmPartition partition,
+ List<IndexBean> indexesBeans,
DirectoryService directoryService ) //throws Exception
{
- Set<Index<?, Entry, UUID>> indexes = new HashSet<Index<?, Entry, UUID>>();
+ Set<Index<?, Entry, String>> indexes = new HashSet<Index<?, Entry, String>>();
for ( IndexBean indexBean : indexesBeans )
{
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java?rev=1378653&r1=1378652&r2=1378653&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java Wed Aug 29 17:13:56 2012
@@ -21,9 +21,9 @@ package org.apache.directory.server.core
import java.net.URI;
-import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
import org.apache.directory.server.xdbm.Index;
import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
@@ -99,18 +99,18 @@ public class AvlPartition extends Abstra
/**
* {@inheritDoc}
*/
- public UUID getDefaultId()
+ public String getDefaultId()
{
- return new UUID( 0L, 1L );
+ return Partition.DEFAULT_ID;
}
/**
* {@inheritDoc}
*/
- public UUID getRootId()
+ public String getRootId()
{
- return new UUID( 0L, 0L );
+ return Partition.ROOT_ID;
}
@@ -144,7 +144,7 @@ public class AvlPartition extends Abstra
@Override
- protected Index<?, Entry, UUID> convertAndInit( Index<?, Entry, UUID> index ) throws Exception
+ protected Index<?, Entry, String> convertAndInit( Index<?, Entry, String> index ) throws Exception
{
AvlIndex<?, Entry> avlIndex;
|