directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1164667 [4/6] - in /directory/apacheds/branches/one-sub-level-index-removal: ./ all/ core-annotations/ core-annotations/src/test/java/org/apache/directory/server/core/factory/ core-api/ core-api/src/main/java/org/apache/directory/server/co...
Date Fri, 02 Sep 2011 18:31:02 GMT
Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageHeader.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageHeader.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageHeader.java Fri Sep  2 18:30:57 2011
@@ -47,6 +47,8 @@
 package jdbm.recman;
 
 
+import java.io.IOException;
+
 import org.apache.directory.server.i18n.I18n;
 
 
@@ -58,6 +60,7 @@ import org.apache.directory.server.i18n.
  *   <li>2 bytes: the short block type code</li>
  *   <li>8 bytes: the long block id of the next block in the block list</li>
  *   <li>8 bytes: the long block id of the previous block in the block list</li>
+ *   <li>4 bytes: the size of this page
  * </ol>
  * 
  * The page header block view hence sees 18 bytes of page header data.
@@ -65,34 +68,36 @@ import org.apache.directory.server.i18n.
 public class PageHeader implements BlockView 
 {
     // offsets into page header's (BlockIo's) buffer
-    
     /** the page (BlockIo's type code) short magic code */
     private static final short O_MAGIC = 0; 
+    
     /** the long block id of the next block in the block list */
     private static final short O_NEXT = Magic.SZ_SHORT;  
+    
     /** the long block id of the previous block in the block list */
     private static final short O_PREV = O_NEXT + Magic.SZ_LONG; 
     
-    /** the size of this page header = 18 bytes */
+    /** the size of this page header */
     protected static final short SIZE = O_PREV + Magic.SZ_LONG;
 
     /** the page header block this view is associated with */
-    protected BlockIo block;
+    protected BlockIo blockIo;
 
     
     /**
      * Constructs a PageHeader object from a block
      *
-     * @param block The block that contains the page header
+     * @param blockIo The block that contains the page header
      * @throws IOException if the block is too short to keep the page header.
      */
-    protected PageHeader( BlockIo block ) 
+    protected PageHeader( BlockIo blockIo ) 
     {
-        this.block = block;
-        block.setView( this );
+        this.blockIo = blockIo;
+        blockIo.setView( this );
+        
         if ( ! magicOk() )
         {
-            throw new Error( I18n.err( I18n.ERR_546, block.getBlockId(), getMagic() ) );
+            throw new Error( I18n.err( I18n.ERR_546, blockIo.getBlockId(), getMagic() ) );
         }
     }
     
@@ -101,10 +106,10 @@ public class PageHeader implements Block
      * Constructs a new PageHeader of the indicated type. Used for newly
      * created pages.
      */
-    PageHeader( BlockIo block, short type ) 
+    PageHeader( BlockIo blockIo, short type ) 
     {
-        this.block = block;
-        block.setView( this );
+        this.blockIo = blockIo;
+        blockIo.setView( this );
         setType( type );
     }
     
@@ -112,16 +117,17 @@ public class PageHeader implements Block
     /**
      * Factory method to create or return a page header for the indicated block.
      */
-    static PageHeader getView ( BlockIo block ) 
+    static PageHeader getView ( BlockIo blockIo ) 
     {
-        BlockView view = block.getView();
+        BlockView view = blockIo.getView();
+        
         if ( view != null && view instanceof PageHeader )
         {
             return ( PageHeader ) view;
         }
         else
         {
-            return new PageHeader( block );
+            return new PageHeader( blockIo );
         }
     }
     
@@ -132,6 +138,7 @@ public class PageHeader implements Block
     private boolean magicOk() 
     {
         int magic = getMagic();
+        
         return magic >= Magic.BLOCK
             && magic <= ( Magic.BLOCK + Magic.FREEPHYSIDS_PAGE );
     }
@@ -149,48 +156,140 @@ public class PageHeader implements Block
     }
     
     
-    /** Returns the magic code */
+    /** 
+     * @return The magic code (ie, the 2 first bytes of the inner BlockIo) 
+     */
     short getMagic() 
     {
-        return block.readShort( O_MAGIC );
+        return blockIo.readShort( O_MAGIC );
     }
 
     
-    /** Returns the next block. */
+    /**
+     * @return the next block (ie the long at position 2 in the BlockIo)
+     */
     long getNext() 
     {
         paranoiaMagicOk();
-        return block.readLong( O_NEXT );
+        
+        return blockIo.readLong( O_NEXT );
     }
     
     
-    /** Sets the next block. */
+    /** 
+     * Sets the next blockIo.
+     * 
+     * @param The next Block ID
+     */
     void setNext( long next ) 
     {
         paranoiaMagicOk();
-        block.writeLong( O_NEXT, next );
+        blockIo.writeLong( O_NEXT, next );
     }
     
     
-    /** Returns the previous block. */
+    /** 
+     * @return the previous block (ie the long at position 10 in the BlockIo)
+     */
     long getPrev() 
     {
         paranoiaMagicOk();
-        return block.readLong( O_PREV );
+        
+        return blockIo.readLong( O_PREV );
     }
     
     
-    /** Sets the previous block. */
+    /** 
+     * Sets the previous block. 
+     */
     void setPrev( long prev ) 
     {
         paranoiaMagicOk();
-        block.writeLong( O_PREV, prev );
+        blockIo.writeLong( O_PREV, prev );
     }
     
     
-    /** Sets the type of the page header */
-    void setType ( short type ) 
+    /** 
+     * Sets the type of the page header
+     * 
+     *  @param type The PageHeader type to store at position 0
+     */
+    void setType( short type ) 
     {
-        block.writeShort( O_MAGIC, ( short ) ( Magic.BLOCK + type ) );
+        blockIo.writeShort( O_MAGIC, ( short ) ( Magic.BLOCK + type ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() 
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "PageHeader ( " );
+        
+        // The blockIO
+        sb.append( "BlockIO ( " );
+        
+        // The blockID
+        sb.append( blockIo.getBlockId() ).append( ", " );
+        
+        // Is it dirty ?
+        if ( blockIo.isDirty() )
+        {
+            sb.append( "dirty, " );
+        }
+        else
+        {
+            sb.append( "clean, " );
+        }
+        
+        // The transaction count
+        if ( blockIo.isInTransaction() )
+        {
+            sb.append( "in tx" );
+        }
+        else
+        {
+            sb.append( "no tx" );
+        }
+
+        sb.append( " ), " );
+        
+        // The Type
+        int magic = getMagic();
+        
+        switch ( magic - Magic.BLOCK )
+        {
+            case Magic.FREE_PAGE :
+                sb.append( "FREE_PAGE" ).append( ", " );
+                break;
+                
+            case Magic.USED_PAGE :
+                sb.append( "USED_PAGE" ).append( ", " );
+                break;
+                
+            case Magic.TRANSLATION_PAGE :
+                sb.append( "TRANSLATION_PAGE" ).append( ", " );
+                break;
+                
+            case Magic.FREELOGIDS_PAGE :
+                sb.append( "FREELOGIDS_PAGE" ).append( ", " );
+                break;
+                
+            case Magic.FREEPHYSIDS_PAGE :
+                sb.append( "FREEPHYSIDS_PAGE" ).append( ", " );
+                break;
+                
+        }
+        
+        // The previous page
+        sb.append( "[p:" ).append( getPrev() ).append( ", " );
+        
+        // The next page
+        sb.append( "n:" ).append( getNext() ).append( "] )" );
+        
+        return sb.toString();
     }
 }

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageManager.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageManager.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PageManager.java Fri Sep  2 18:30:57 2011
@@ -47,28 +47,34 @@
 package jdbm.recman;
 
 
-import java.io.*;
+import java.io.IOException;
 
 import org.apache.directory.server.i18n.I18n;
 
 
 /**
- * This class manages the linked lists of pages that make up a recordFile.
+ * This class manages the linked lists of pages that make up a recordFile. It contains
+ * a FileHeadrer and a reference to the recordFile it manages.<br/>
  */
 final class PageManager 
 {
-    // our record recordFile
+    /** our record recordFile */
     private RecordFile recordFile;
     
-    // header data
+    /** header data */
     private FileHeader header;
     
-    // recordFile header containing block
+    /** recordFile header containing block */
     private BlockIo headerBuf;
 
     
     /**
      * Creates a new page manager using the indicated record recordFile.
+     * We will load in memory the associated FileHeader, which is
+     * read from the RecordFile if it exists, or is created if it doesn't.
+     * 
+     * @param The associated RecordFile
+     * @throws IOException If there is an issue storing data into the recordFile
      */
     PageManager( RecordFile recordFile ) throws IOException 
     {
@@ -78,54 +84,54 @@ final class PageManager 
         headerBuf = recordFile.get( 0 );
         
         // Assume recordFile is new if the recordFile header's magic number is 0. 
-        if ( headerBuf.readShort( 0 ) == 0 )
-        {
-            header = new FileHeader( headerBuf, true );
-        }
-        else // header is for existing recordFile
-        {
-            header = new FileHeader( headerBuf, false );
-        }
+        boolean isNew = headerBuf.readShort( 0 ) == 0;
+
+        header = new FileHeader( headerBuf, isNew );
     }
     
     
     /**
-     * Allocates a page of the indicated type. Returns recid of the page.
+     * Allocates a page of the indicated type. 
+     * 
+     * @param The page type we want to allocate
+     * @return The record ID of the page.
      */
     long allocate( short type ) throws IOException 
     {
         if ( type == Magic.FREE_PAGE )
         {
+            // We can't allocate FREE page. A page becomes FREE after it ha sbeen used.
             throw new Error( I18n.err( I18n.ERR_548 ) );
         }
         
         boolean isNew = false;
         
         // Do we have something on the free list?
-        long retval = header.getFirstOf( Magic.FREE_PAGE );
-        if ( retval != 0 ) 
+        long freeBlock = header.getFirstOf( Magic.FREE_PAGE );
+        
+        if ( freeBlock != 0 ) 
         {
             // yes. Point to it and make the next of that page the
             // new first free page.
-            header.setFirstOf( Magic.FREE_PAGE, getNext( retval ) );
+            header.setFirstOf( Magic.FREE_PAGE, getNext( freeBlock ) );
         }
         else 
         {
             // nope. make a new record
-            retval = header.getLastOf( Magic.FREE_PAGE );
+            freeBlock = header.getLastOf( Magic.FREE_PAGE );
 
-            if ( retval == 0 )
+            if ( freeBlock == 0 )
             {
                 // very new recordFile - allocate record #1
-                retval = 1;
+                freeBlock = 1;
             }
             
-            header.setLastOf( Magic.FREE_PAGE, retval + 1 );
+            header.setLastOf( Magic.FREE_PAGE, freeBlock + 1 );
             isNew = true;
         }
         
         // Cool. We have a record, add it to the correct list
-        BlockIo buf = recordFile.get( retval );
+        BlockIo buf = recordFile.get( freeBlock );
         PageHeader pageHdr = null;
         
         if ( isNew )
@@ -148,25 +154,25 @@ final class PageManager 
         if ( oldLast == 0 )
         {
             // This was the first one of this type
-            header.setFirstOf( type, retval );
+            header.setFirstOf( type, freeBlock );
         }
         
-        header.setLastOf( type, retval );
-        recordFile.release( retval, true );
+        header.setLastOf( type, freeBlock );
+        recordFile.release( freeBlock, true );
         
         // If there's a previous, fix up its pointer
         if ( oldLast != 0 ) 
         {
             buf = recordFile.get( oldLast );
             pageHdr = PageHeader.getView( buf );
-            pageHdr.setNext( retval );
+            pageHdr.setNext( freeBlock );
             recordFile.release( oldLast, true );
         }
         
         // remove the view, we have modified the type.
         buf.setView( null );
         
-        return retval;
+        return freeBlock;
     }
     
     

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PhysicalRowIdManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PhysicalRowIdManager.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PhysicalRowIdManager.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/PhysicalRowIdManager.java Fri Sep  2 18:30:57 2011
@@ -64,8 +64,7 @@ final class PhysicalRowIdManager
      *  Creates a new rowid manager using the indicated record file.
      *  and page manager.
      */
-    PhysicalRowIdManager( PageManager pageManager )
-        throws IOException
+    PhysicalRowIdManager( PageManager pageManager ) throws IOException
     {
         this.pageManager = pageManager;
         this.file = pageManager.getRecordFile();
@@ -75,63 +74,69 @@ final class PhysicalRowIdManager
     /**
      *  Inserts a new record. Returns the new physical rowid.
      */
-    Location insert( byte[] data, int start, int length )
-        throws IOException
+    Location insert( byte[] data, int start, int length ) throws IOException
     {
         Location retval = alloc( length );
         write( retval, data, start, length );
+        
         return retval;
     }
+    
 
     /**
      *  Updates an existing record. Returns the possibly changed
      *  physical rowid.
      */
-    Location update( Location rowid, byte[] data, int start, int length )
-        throws IOException
+    Location update( Location rowid, byte[] data, int start, int length ) throws IOException
     {
         // fetch the record header
         BlockIo block = pageManager.getRecordFile().get( rowid.getBlock() );
         RecordHeader head = new RecordHeader( block, rowid.getOffset() );
         
-        if ( length > head.getAvailableSize() ) {
+        if ( length > head.getAvailableSize() ) 
+        {
             // not enough space - we need to copy to a new rowid.
             pageManager.getRecordFile().release( block );
             free( rowid );
             rowid = alloc( length );
-        } else {
+        } 
+        else 
+        {
             pageManager.getRecordFile().release( block );
         }
 
         // 'nuff space, write it in and return the rowid.
         write( rowid, data, start, length );
+        
         return rowid;
     }
+    
 
     /**
      *  Deletes a record.
      */
-    void delete( Location rowid )
-        throws IOException
+    void delete( Location rowid ) throws IOException
     {
         free( rowid );
     }
+    
 
     /**
      *  Retrieves a record.
      */
-    byte[] fetch( Location rowid )
-        throws IOException 
+    byte[] fetch( Location rowid ) throws IOException 
     {
         // fetch the record header
         PageCursor curs = new PageCursor( pageManager, rowid.getBlock() );
-        BlockIo block = file.get( curs.getCurrent() );
+        BlockIo block = file.get( curs.getBlockId() );
         RecordHeader head = new RecordHeader( block, rowid.getOffset() );
 
         // allocate a return buffer
         byte[] retval = new byte[ head.getCurrentSize() ];
-        if ( retval.length == 0 ) {
-            file.release( curs.getCurrent(), false );
+        
+        if ( retval.length == 0 ) 
+        {
+            file.release( curs.getBlockId(), false );
             return retval;
         }
 
@@ -139,12 +144,17 @@ final class PhysicalRowIdManager
         int offsetInBuffer = 0;
         int leftToRead = retval.length;
         short dataOffset = (short) (rowid.getOffset() + RecordHeader.SIZE);
-        while ( leftToRead > 0 ) {
+        
+        while ( leftToRead > 0 ) 
+        {
             // copy current page's data to return buffer
             int toCopy = RecordFile.BLOCK_SIZE - dataOffset;
-            if ( leftToRead < toCopy ) {
+            
+            if ( leftToRead < toCopy ) 
+            {
                 toCopy = leftToRead;
             }
+            
             System.arraycopy( block.getData(), dataOffset,
                               retval, offsetInBuffer,
                               toCopy );
@@ -155,7 +165,8 @@ final class PhysicalRowIdManager
 
             file.release( block );
 
-            if ( leftToRead > 0 ) {
+            if ( leftToRead > 0 ) 
+            {
                 block = file.get( curs.next() );
                 dataOffset = DataPage.O_DATA;
             }
@@ -168,14 +179,16 @@ final class PhysicalRowIdManager
     /**
      *  Allocate a new rowid with the indicated size.
      */
-    private Location alloc( int size )
-        throws IOException
+    private Location alloc( int size ) throws IOException
     {
         Location retval = freeman.get( size );
-        if ( retval == null ) {
+        
+        if ( retval == null ) 
+        {
             // temporary work around for DIRSERVER-1459
             retval = allocNew( size * 2, pageManager.getLast( Magic.USED_PAGE ) );
         }
+        
         return retval;
     }
 
@@ -184,12 +197,13 @@ final class PhysicalRowIdManager
      *  allow for a recursive call - it indicates where the search
      *  should start.
      */
-    private Location allocNew( int size, long start )
-        throws IOException
+    private Location allocNew( int size, long start ) throws IOException
     {
         BlockIo curBlock;
         DataPage curPage;
-        if ( start == 0 ) {
+        
+        if ( start == 0 ) 
+        {
             // we need to create a new page.
             start = pageManager.allocate( Magic.USED_PAGE );
             curBlock = file.get( start );
@@ -198,7 +212,9 @@ final class PhysicalRowIdManager
             RecordHeader hdr = new RecordHeader( curBlock, DataPage.O_DATA );
             hdr.setAvailableSize( 0 );
             hdr.setCurrentSize( 0 );
-        } else {
+        } 
+        else 
+        {
             curBlock = file.get( start );
             curPage = DataPage.getDataPageView( curBlock );
         }
@@ -206,16 +222,22 @@ final class PhysicalRowIdManager
         // follow the rowids on this page to get to the last one. We don't
         // fall off, because this is the last page, remember?
         short pos = curPage.getFirst();
-        if ( pos == 0 ) {
+        
+        if ( pos == 0 ) 
+        {
             // page is exactly filled by the last block of a record
             file.release( curBlock );
             return allocNew( size, 0 );
         }
 
         RecordHeader hdr = new RecordHeader( curBlock, pos );
-        while ( hdr.getAvailableSize() != 0 && pos < RecordFile.BLOCK_SIZE ) {
+        
+        while ( hdr.getAvailableSize() != 0 && pos < RecordFile.BLOCK_SIZE ) 
+        {
             pos += hdr.getAvailableSize() + RecordHeader.SIZE;
-            if ( pos == RecordFile.BLOCK_SIZE ) {
+            
+            if ( pos == RecordFile.BLOCK_SIZE ) 
+            {
                 // Again, a filled page.
                 file.release( curBlock );
                 return allocNew( size, 0 );
@@ -224,7 +246,8 @@ final class PhysicalRowIdManager
             hdr = new RecordHeader( curBlock, pos );
         }
 
-        if ( pos == RecordHeader.SIZE ) {
+        if ( pos == RecordHeader.SIZE ) 
+        {
             // the last record exactly filled the page. Restart forcing
             // a new page.
             file.release( curBlock );
@@ -234,12 +257,16 @@ final class PhysicalRowIdManager
         // enough space.
         Location retval = new Location( start, pos );
         int freeHere = RecordFile.BLOCK_SIZE - pos - RecordHeader.SIZE;
-        if ( freeHere < size ) {
+        
+        if ( freeHere < size ) 
+        {
             // check whether the last page would have only a small bit left.
             // if yes, increase the allocation. A small bit is a record
             // header plus 16 bytes.
             int lastSize = (size - freeHere) % DataPage.DATA_PER_PAGE;
-            if (( DataPage.DATA_PER_PAGE - lastSize ) < (RecordHeader.SIZE + 16) ) {
+            
+            if (( DataPage.DATA_PER_PAGE - lastSize ) < (RecordHeader.SIZE + 16) ) 
+            {
                 size += (DataPage.DATA_PER_PAGE - lastSize);
             }
 
@@ -248,8 +275,10 @@ final class PhysicalRowIdManager
             file.release( start, true );
 
             int neededLeft = size - freeHere;
+            
             // Refactor these two blocks!
-            while ( neededLeft >= DataPage.DATA_PER_PAGE ) {
+            while ( neededLeft >= DataPage.DATA_PER_PAGE ) 
+            {
                 start = pageManager.allocate( Magic.USED_PAGE );
                 curBlock = file.get( start );
                 curPage = DataPage.getDataPageView( curBlock );
@@ -257,7 +286,9 @@ final class PhysicalRowIdManager
                 file.release( start, true );
                 neededLeft -= DataPage.DATA_PER_PAGE;
             }
-            if ( neededLeft > 0 ) {
+            
+            if ( neededLeft > 0 ) 
+            {
                 // done with whole chunks, allocate last fragment.
                 start = pageManager.allocate( Magic.USED_PAGE );
                 curBlock = file.get( start );
@@ -265,23 +296,25 @@ final class PhysicalRowIdManager
                 curPage.setFirst( (short) (DataPage.O_DATA + neededLeft) );
                 file.release( start, true );
             }
-        } else {
+        } else 
+        {
             // just update the current page. If there's less than 16 bytes
             // left, we increase the allocation (16 bytes is an arbitrary
             // number).
-            if ( freeHere - size <= (16 + RecordHeader.SIZE) ) {
+            if ( freeHere - size <= (16 + RecordHeader.SIZE) ) 
+            {
                 size = freeHere;
             }
+            
             hdr.setAvailableSize( size );
             file.release( start, true );
         }
+        
         return retval;
-
     }
 
 
-    private void free( Location id )
-        throws IOException
+    private void free( Location id ) throws IOException
     {
         // get the rowid, and write a zero current size into it.
         BlockIo curBlock = file.get( id.getBlock() );
@@ -292,6 +325,7 @@ final class PhysicalRowIdManager
         // write the rowid to the free list
         freeman.put( id, hdr.getAvailableSize() );
     }
+    
 
     /**
      *  Writes out data to a rowid. Assumes that any resizing has been
@@ -301,11 +335,13 @@ final class PhysicalRowIdManager
         throws IOException
     {
         PageCursor curs = new PageCursor( pageManager, rowid.getBlock() );
-        BlockIo block = file.get( curs.getCurrent() );
+        BlockIo block = file.get( curs.getBlockId() );
         RecordHeader hdr = new RecordHeader( block, rowid.getOffset() );
         hdr.setCurrentSize( length );
-        if ( length == 0 ) {
-            file.release( curs.getCurrent(), true );
+        
+        if ( length == 0 ) 
+        {
+            file.release( curs.getBlockId(), true );
             return;
         }
 
@@ -313,7 +349,9 @@ final class PhysicalRowIdManager
         int offsetInBuffer = start;
         int leftToWrite = length;
         short dataOffset = (short) (rowid.getOffset() + RecordHeader.SIZE);
-        while ( leftToWrite > 0 ) {
+        
+        while ( leftToWrite > 0 ) 
+        {
             // copy current page's data to return buffer
             int toCopy = RecordFile.BLOCK_SIZE - dataOffset;
 
@@ -327,9 +365,10 @@ final class PhysicalRowIdManager
             leftToWrite -= toCopy;
             offsetInBuffer += toCopy;
 
-            file.release( curs.getCurrent(), true );
+            file.release( curs.getBlockId(), true );
 
-            if ( leftToWrite > 0 ) {
+            if ( leftToWrite > 0 ) 
+            {
                 block = file.get( curs.next() );
                 dataOffset = DataPage.O_DATA;
             }

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/Provider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/Provider.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/Provider.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/Provider.java Fri Sep  2 18:30:57 2011
@@ -51,14 +51,13 @@ package jdbm.recman;
 import java.io.IOException;
 import java.util.Properties;
 
-import org.apache.directory.server.i18n.I18n;
-
 import jdbm.RecordManager;
 import jdbm.RecordManagerOptions;
 import jdbm.RecordManagerProvider;
-
 import jdbm.helper.MRU;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Provider of the default RecordManager implementation.
  *
@@ -79,13 +78,9 @@ public final class Provider implements R
      */
     public RecordManager createRecordManager( String name, Properties options ) throws IOException
     {
-        RecordManager  recman;
-        String         value;
-        int            cacheSize;
-
-        recman = new BaseRecordManager( name );
+        RecordManager recman = new BaseRecordManager( name );
 
-        value = options.getProperty( RecordManagerOptions.DISABLE_TRANSACTIONS, "false" );
+        String value = options.getProperty( RecordManagerOptions.DISABLE_TRANSACTIONS, "false" );
         
         if ( value.equalsIgnoreCase( "TRUE" ) ) 
         {
@@ -93,7 +88,7 @@ public final class Provider implements R
         }
 
         value = options.getProperty( RecordManagerOptions.CACHE_SIZE, "1000" );
-        cacheSize = Integer.parseInt( value );
+        int cacheSize = Integer.parseInt( value );
 
         value = options.getProperty( RecordManagerOptions.CACHE_TYPE, RecordManagerOptions.NORMAL_CACHE );
         

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/RecordFile.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/RecordFile.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/RecordFile.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/RecordFile.java Fri Sep  2 18:30:57 2011
@@ -47,8 +47,11 @@
 package jdbm.recman;
 
 
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
 
 import org.apache.directory.server.i18n.I18n;
 
@@ -57,7 +60,7 @@ import org.apache.directory.server.i18n.
  *  This class represents a random access file as a set of fixed size
  *  records. Each record has a physical record number, and records are
  *  cached in order to improve access.
- *<p>
+ * <p>
  *  The set of dirty records on the in-use list constitutes a transaction.
  *  Later on, we will send these records to some recovery thingy.
  */
@@ -67,24 +70,34 @@ public final class RecordFile 
 
     // state transitions: free -> inUse -> dirty -> inTxn -> free
     // free is a cache, thus a FIFO. The rest are hashes.
+    /** The list of free pages */
     private final LinkedList<BlockIo> free = new LinkedList<BlockIo>();
+    
+    /** The map of pages being currently used */
     private final HashMap<Long,BlockIo> inUse = new HashMap<Long,BlockIo>();
+    
+    /** The map of dirty pages (page being modified) */
     private final HashMap<Long,BlockIo> dirty = new HashMap<Long,BlockIo>();
+    
+    /** The map of page in a transaction */
     private final HashMap<Long,BlockIo> inTxn = new HashMap<Long,BlockIo>();
 
-    // transactions disabled?
+    /** A flag set if transactions is disabled. Default to false */
     private boolean transactionsDisabled = false;
 
     /** The length of a single block. */
-    public final static int BLOCK_SIZE = 8192;//4096;
+    public final static int BLOCK_SIZE = 4096;
 
     /** The extension of a record file */
-    final static String extension = ".db";
+    final static String EXTENSION = ".db";
 
     /** A block of clean data to wipe clean pages. */
     final static byte[] cleanData = new byte[BLOCK_SIZE];
 
+    /** The underlying file */
     private RandomAccessFile file;
+    
+    /** The file name */
     private final String fileName;
 
     
@@ -97,29 +110,35 @@ public final class RecordFile 
      * @throws IOException whenever the creation of the underlying
      *         RandomAccessFile throws it.
      */
-    RecordFile ( String fileName ) throws IOException 
+    RecordFile( String fileName ) throws IOException 
     {
         this.fileName = fileName;
-        file = new RandomAccessFile(fileName + extension, "rw");
+        file = new RandomAccessFile( fileName + EXTENSION, "rw" );
     }
 
 
+    /**
+     * @return The TransactionManager if the transaction system is enabled.
+     * @throws IOException If we can't create a TransactionManager
+     */
     TransactionManager getTxnMgr() throws IOException
     {
         if ( transactionsDisabled )
         {
             throw new IllegalStateException( "Transactions are disabled." );
         }
+        
         if ( transactionManager == null )
         {
             transactionManager = new TransactionManager( this );
         }
+        
         return transactionManager;
     }
 
 
     /**
-     * Returns the file name.
+     * @return the file name.
      */
     String getFileName() 
     {
@@ -142,85 +161,89 @@ public final class RecordFile 
      * copy of the record, and thus can be written (and subsequently released 
      * with a dirty flag in order to write the block back).
      *
-     * @param blockid The record number to retrieve.
+     * @param blockId The record number to retrieve.
      */
-     BlockIo get( long blockid ) throws IOException 
+     BlockIo get( long blockId ) throws IOException 
      {
          // try in transaction list, dirty list, free list
+         BlockIo blockIo = inTxn.get( blockId );
          
-         BlockIo node = inTxn.get( blockid );
-         if ( node != null ) 
+         if ( blockIo != null ) 
          {
-             inTxn.remove( blockid );
-             inUse.put( blockid, node );
-             return node;
+             inTxn.remove( blockId );
+             inUse.put( blockId, blockIo );
+             
+             return blockIo;
          }
          
-         node = dirty.get( blockid );
-         if ( node != null ) 
+         blockIo = dirty.get( blockId );
+         
+         if ( blockIo != null ) 
          {
-             dirty.remove( blockid );
-             inUse.put( blockid, node );
-             return node;
+             dirty.remove( blockId );
+             inUse.put( blockId, blockIo );
+             
+             return blockIo;
          }
          
-         for ( Iterator<BlockIo> i = free.iterator(); i.hasNext(); ) 
+         for ( Iterator<BlockIo> iterator = free.iterator(); iterator.hasNext(); ) 
          {
-             BlockIo cur = i.next();
-             if ( cur.getBlockId() == blockid ) 
+             BlockIo cur = iterator.next();
+             
+             if ( cur.getBlockId() == blockId ) 
              {
-                 node = cur;
-                 i.remove();
-                 inUse.put( blockid, node );
-                 return node;
+                 blockIo = cur;
+                 iterator.remove();
+                 inUse.put( blockId, blockIo );
+                 
+                 return blockIo;
              }
          }
 
          // sanity check: can't be on in use list
-         if ( inUse.get( blockid ) != null ) 
+         if ( inUse.get( blockId ) != null ) 
          {
-             throw new Error( I18n.err( I18n.ERR_554, blockid ) );
+             throw new Error( I18n.err( I18n.ERR_554, blockId ) );
          }
 
          // get a new node and read it from the file
-         node = getNewNode( blockid );
-         long offset = blockid * BLOCK_SIZE;
-         if ( file.length() > 0 && offset <= file.length() ) 
+         blockIo = getNewBlockIo( blockId );
+         long offset = blockId * BLOCK_SIZE;
+         long fileLength = file.length();
+         
+         if ( ( fileLength > 0 ) && ( offset <= fileLength ) ) 
          {
-             read( file, offset, node.getData(), BLOCK_SIZE );
+             read( file, offset, blockIo.getData(), BLOCK_SIZE );
          } 
-         else 
-         {
-             System.arraycopy( cleanData, 0, node.getData(), 0, BLOCK_SIZE );
-         }
          
-         inUse.put( blockid, node );
-         node.setClean();
-         return node;
+         inUse.put( blockId, blockIo );
+         blockIo.setClean();
+         
+         return blockIo;
      }
 
 
     /**
      * Releases a block.
      *
-     * @param blockid The record number to release.
+     * @param blockId The record number to release.
      * @param isDirty If true, the block was modified since the get().
      */
-    void release( long blockid, boolean isDirty ) throws IOException 
+    void release( long blockId, boolean isDirty ) throws IOException 
     {
-        BlockIo node = inUse.get( blockid );
+        BlockIo blockIo = inUse.get( blockId );
         
-        if ( node == null )
+        if ( blockIo == null )
         {
-            throw new IOException( I18n.err( I18n.ERR_555, blockid ) );
+            throw new IOException( I18n.err( I18n.ERR_555, blockId ) );
         }
         
-        if ( ! node.isDirty() && isDirty )
+        if ( ! blockIo.isDirty() && isDirty )
         {
-            node.setDirty();
+            blockIo.setDirty();
         }
             
-        release( node );
+        release( blockIo );
     }
 
     
@@ -293,26 +316,23 @@ public final class RecordFile 
         }
 
         
-        for ( Iterator<BlockIo> i = dirty.values().iterator(); i.hasNext(); ) 
+        for ( BlockIo blockIo : dirty.values() ) 
         {
-            BlockIo node = ( BlockIo ) i.next();
-            i.remove();
-            
             // System.out.println("node " + node + " map size now " + dirty.size());
             if ( transactionsDisabled ) 
             {
-                long offset = node.getBlockId() * BLOCK_SIZE;
-                file.seek( offset );
-                file.write( node.getData() );
-                node.setClean();
-                free.add( node );
+                sync( blockIo );
+                blockIo.setClean();
+                free.add( blockIo );
             }
             else 
             {
-                getTxnMgr().add( node );
-                inTxn.put( node.getBlockId(), node );
+                getTxnMgr().add( blockIo );
+                inTxn.put( blockIo.getBlockId(), blockIo );
             }
         }
+        
+        dirty.clear();
 
         if ( ! transactionsDisabled ) 
         {
@@ -421,39 +441,45 @@ public final class RecordFile 
 
 
     /**
-     * Returns a new node. The node is retrieved (and removed) from the 
+     * Returns a new BlockIo. The BlockIo is retrieved (and removed) from the 
      * released list or created new.
      */
-    private BlockIo getNewNode( long blockid ) throws IOException 
+    private BlockIo getNewBlockIo( long blockId ) throws IOException 
     {
-        BlockIo retval = null;
+        BlockIo blockIo = null;
 
         if ( ! free.isEmpty() ) 
         {
-            retval = ( BlockIo ) free.removeFirst();
+            blockIo = ( BlockIo ) free.removeFirst();
+            blockIo.setBlockId( blockId );
         }
         
-        if ( retval == null )
+        if ( blockIo == null )
         {
-            retval = new BlockIo( 0, new byte[BLOCK_SIZE] );
+            blockIo = new BlockIo( blockId, new byte[BLOCK_SIZE] );
         }
         
-        retval.setBlockId(blockid);
-        retval.setView( null );
-        return retval;
+        blockIo.setView( null );
+        
+        return blockIo;
     }
     
 
     /**
-     * Synchronizes a node to disk. This is called by the transaction manager's
+     * Synchronizes a BlockIo to disk. This is called by the transaction manager's
      * synchronization code.
+     * 
+     * @param blockIo The blocIo to write on disk
+     * @exception IOException If we have a problem while trying to write the blockIo to disk
      */
-    void synch( BlockIo node ) throws IOException 
+    void sync( BlockIo blockIo ) throws IOException 
     {
-        byte[] data = node.getData();
+        byte[] data = blockIo.getData();
+        
         if ( data != null ) 
         {
-            long offset = node.getBlockId() * BLOCK_SIZE;
+            // Write the data to disk now.
+            long offset = blockIo.getBlockId() * BLOCK_SIZE;
             file.seek( offset );
             file.write( data );
         }
@@ -503,4 +529,76 @@ public final class RecordFile 
             pos += read;
         }
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "RecordFile<" ).append( fileName ).append( ", " );
+        
+        // The file size
+        sb.append( "size : " );
+        
+        try
+        {
+            sb.append( file.length() ).append( "bytes" );
+        }
+        catch ( IOException ioe )
+        {
+            sb.append( "unknown" );
+        }
+        
+        // Transactions
+        if ( transactionsDisabled )
+        {
+            sb.append( "(noTx)" );
+        }
+        else
+        {
+            sb.append( "(Tx)" );
+        }
+        
+        // Dump the free blocks
+        sb.append( "\n    Free blockIo : " ).append( free.size() );
+                
+        for ( BlockIo blockIo : free )
+        {
+            sb.append( "\n         " );
+            sb.append( blockIo );
+        }
+        
+        // Dump the inUse blocks
+        sb.append( "\n    InUse blockIo : " ).append( inUse.size() );
+        
+        for ( BlockIo blockIo : inUse.values() )
+        {
+            sb.append( "\n         " );
+            sb.append( blockIo );
+        }
+        
+        // Dump the dirty blocks
+        sb.append( "\n    Dirty blockIo : " ).append( dirty.size() );
+        
+        for ( BlockIo blockIo : dirty.values() )
+        {
+            sb.append( "\n         " );
+            sb.append( blockIo );
+        }
+        
+        // Dump the inTxn blocks
+        sb.append( "\n    InTxn blockIo : " ).append( inTxn.size() );
+        
+        for ( BlockIo blockIo : inTxn.values() )
+        {
+            sb.append( "\n         " );
+            sb.append( blockIo );
+        }
+
+        
+        return sb.toString();
+    }
 }

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TransactionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TransactionManager.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TransactionManager.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TransactionManager.java Fri Sep  2 18:30:57 2011
@@ -250,7 +250,7 @@ public final class TransactionManager {
         // write block vector elements to the data file.
         while ( blockIterator.hasNext() ) {
             BlockIo cur = (BlockIo)blockIterator.next();
-            owner.synch(cur);
+            owner.sync(cur);
             if (fromCore) {
                 cur.decrementTransactionCount();
                 if (!cur.isInTransaction()) {

Modified: directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TranslationPage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TranslationPage.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TranslationPage.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/jdbm/src/main/java/jdbm/recman/TranslationPage.java Fri Sep  2 18:30:57 2011
@@ -47,6 +47,7 @@
 package jdbm.recman;
 
 
+
 /**
  * Class describing a page that holds translations from physical rowids
  * to logical rowids. In fact, the page just holds physical rowids - the
@@ -55,36 +56,39 @@ package jdbm.recman;
  */
 final class TranslationPage extends PageHeader 
 {
-    // offsets
+    /** Offset of the PageHeader */
     static final short O_TRANS = PageHeader.SIZE; // short count
+    
+    /** Number of PhysicalRowId in this page */
     static final short ELEMS_PER_PAGE = ( RecordFile.BLOCK_SIZE - O_TRANS ) / PhysicalRowId.SIZE;
     
-    // slots we returned.
+    /** The table of PhysicalRowId */
     final PhysicalRowId[] slots = new PhysicalRowId[ELEMS_PER_PAGE];
 
     
     /**
      * Constructs a data page view from the indicated block.
      */
-    TranslationPage( BlockIo block ) 
+    TranslationPage( BlockIo blockIo ) 
     {
-        super( block );
+        super( blockIo );
     }
     
 
     /**
      * Factory method to create or return a data page for the indicated block.
      */
-    static TranslationPage getTranslationPageView( BlockIo block ) 
+    static TranslationPage getTranslationPageView( BlockIo blockIo ) 
     {
-        BlockView view = block.getView();
-        if ( view != null && view instanceof TranslationPage )
+        BlockView view = blockIo.getView();
+        
+        if ( ( view != null ) && view instanceof TranslationPage )
         {
             return ( TranslationPage ) view;
         }
         else
         {
-            return new TranslationPage( block );
+            return new TranslationPage( blockIo );
         }
     }
     
@@ -93,10 +97,40 @@ final class TranslationPage extends Page
     PhysicalRowId get( short offset ) 
     {
         int slot = ( offset - O_TRANS ) / PhysicalRowId.SIZE;
+        
         if ( slots[slot] == null )
         {
-            slots[slot] = new PhysicalRowId( block, offset );
+            slots[slot] = new PhysicalRowId( blockIo, offset );
         }
+        
         return slots[slot];
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() 
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "TranslationPage ( " );
+        
+        // The blockIO
+        sb.append( super.toString() ).append( ", " );
+        
+        // Dump the Physical row id
+        for ( int i = 0; i < ELEMS_PER_PAGE; i++ )
+        {
+            if ( slots[i] != null )
+            {
+                sb.append( ", [" ).append( i ).append( "]=<" ).
+                append( slots[i].getBlock() ).append( ", " ).
+                append( slots[i].getOffset() ).append( ">" );
+            }
+        }
+        
+        sb.append( ")" );
+        return sb.toString();
+    }
 }

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/server:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/server:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -2,5 +2,5 @@
 /directory/apacheds/branches/apacheds-config/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:980138-980936
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolCodecFactory.java:1067786-1067997

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java Fri Sep  2 18:30:57 2011
@@ -24,6 +24,7 @@ package org.apache.directory.server.kerb
 import java.util.Map;
 
 import org.apache.directory.server.protocol.shared.catalog.Catalog;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -49,7 +50,7 @@ class KerberosCatalog implements Catalog
 
     public String getBaseDn( String name )
     {
-        name = name.toLowerCase();
+        name = Strings.toLowerCase( name );
 
         if ( name.endsWith( "." ) )
         {

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java Fri Sep  2 18:30:57 2011
@@ -23,6 +23,9 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
+
 
 /**
  * A type-safe enumeration of Kerberos encryption types.
@@ -177,7 +180,7 @@ public enum EncryptionType
     {
         for ( EncryptionType type : EncryptionType.values() )
         {
-            encryptionTypesByName.put( type.getName().toLowerCase(), type );
+            encryptionTypesByName.put( Strings.toLowerCase( type.getName() ), type );
             encryptionTypesByValue.put( type.getValue(), type );
         }
     }
@@ -255,7 +258,7 @@ public enum EncryptionType
             return UNKNOWN;
         }
         
-        String lcType = type.toLowerCase();
+        String lcType = Strings.toLowerCase( type );
         
         if ( encryptionTypesByName.containsKey( lcType ) )
         {

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/PaDataType.java:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PaDataType.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/SamType.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -2,5 +2,5 @@
 /directory/apacheds/branches/apacheds-config/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/SamType.java:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/types/SamType.java:980138-980936
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/SamType.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/SamType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/SamType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/SamType.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/Checksum.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/EncryptionKey.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PaData.java:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ChecksumType.java:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/crypto/checksum/ChecksumType.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/flags:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/flags:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -6,5 +6,5 @@
 /directory/apacheds/branches/apacheds-subtree/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:965203-965686
 /directory/apacheds/branches/milestones/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java:1072812-1075328
 /directory/apacheds/branches/xdbm-refactoring/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KrbError.java:945827-946347
-/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/test/java/org/apache/directory/server:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-codec/src/test/java/org/apache/directory/server:1072812-1075328
-/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-codec/src/test/java/org/apache/directory/server:1067786-1067997

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java Fri Sep  2 18:30:57 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * Helper for determining whether various ciphers are supported by the JRE.  For now
@@ -28,7 +30,7 @@ package org.apache.directory.server.kerb
  */
 public class VendorHelper
 {
-    private static final String vendor = System.getProperty( "java.vendor" ).toLowerCase();
+    private static final String vendor = Strings.toLowerCase( System.getProperty( "java.vendor" ) );
 
 
     static String getTripleDesAlgorithm()

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java Fri Sep  2 18:30:57 2011
@@ -32,8 +32,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.encKrbCredPart.EncKrbCredPartContainer;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
@@ -41,6 +41,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
 import org.apache.directory.shared.kerberos.components.HostAddress;
 import org.apache.directory.shared.kerberos.components.KrbCredInfo;
+import org.apache.directory.shared.util.Strings;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -131,14 +132,14 @@ public class EncKrbCredPartDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = EncKrbCrePartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = EncKrbCrePartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             for ( int j = i + 1; j < size; j++ )
             {
                 fieldValHolder = optionalFieldValueList.get( j );
                 presentFieldList.add( fieldValHolder );
-                f = EncKrbCrePartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+                f = EncKrbCrePartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
                 f.set( expected, fieldValHolder.value );
             }
 
@@ -184,7 +185,7 @@ public class EncKrbCredPartDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = encKrbCredPartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = encKrbCredPartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
@@ -222,7 +223,7 @@ public class EncKrbCredPartDecoderTest
         Map<String, Field> fieldNameMap = getFieldMap( decoded );
         for ( FieldValueHolder fh : presentFieldList )
         {
-            Field actualField = fieldNameMap.get( fh.fieldName.toLowerCase() );
+            Field actualField = fieldNameMap.get( Strings.toLowerCase( fh.fieldName ) );
             Object decodedValue = actualField.get( decoded );
 
             //System.out.println( fh.fieldName + " expected: " + fh.value + " , actual: " + decodedValue );
@@ -246,7 +247,7 @@ public class EncKrbCredPartDecoderTest
         for ( Field f : fields )
         {
             f.setAccessible( true );
-            fieldNameMap.put( f.getName().toLowerCase(), f );
+            fieldNameMap.put( Strings.toLowerCase( f.getName() ), f );
         }
 
         return fieldNameMap;

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java Fri Sep  2 18:30:57 2011
@@ -45,6 +45,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.flags.TicketFlag;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
+import org.apache.directory.shared.util.Strings;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -158,14 +159,14 @@ public class KrbCredInfoDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             for ( int j = i + 1; j < size; j++ )
             {
                 fieldValHolder = optionalFieldValueList.get( j );
                 presentFieldList.add( fieldValHolder );
-                f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+                f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
                 f.set( expected, fieldValHolder.value );
             }
 
@@ -213,7 +214,7 @@ public class KrbCredInfoDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
@@ -254,7 +255,7 @@ public class KrbCredInfoDecoderTest
 
         for ( FieldValueHolder fh : presentFieldList )
         {
-            Field actualField = krbCredInfoFieldNameMap.get( fh.fieldName.toLowerCase() );
+            Field actualField = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fh.fieldName ) );
             Object decodedValue = actualField.get( decoded );
 
             //System.out.println( fh.fieldName + " expected: " + fh.value + " , actual: " + decodedValue );
@@ -278,7 +279,7 @@ public class KrbCredInfoDecoderTest
         for ( Field f : fields )
         {
             f.setAccessible( true );
-            fieldNameMap.put( f.getName().toLowerCase(), f );
+            fieldNameMap.put( Strings.toLowerCase( f.getName() ), f );
         }
 
         return fieldNameMap;

Propchange: directory/apacheds/branches/one-sub-level-index-removal/kerberos-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-test:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-test:1040956-1043765
 /directory/apacheds/branches/milestones/kerberos-test:1072812-1075328
-/directory/apacheds/trunk/kerberos-test:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/kerberos-test:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/kerberos-test:1067786-1067997

Modified: directory/apacheds/branches/one-sub-level-index-removal/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java Fri Sep  2 18:30:57 2011
@@ -44,6 +44,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.util.Strings;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -287,8 +288,8 @@ public class AbstractKerberosITest exten
         data += "}" + SystemUtils.LINE_SEPARATOR;
 
         data += "[domain_realm]" + SystemUtils.LINE_SEPARATOR;
-        data += "." + REALM.toLowerCase() + " = " + REALM + SystemUtils.LINE_SEPARATOR;
-        data += REALM.toLowerCase() + " = " + REALM + SystemUtils.LINE_SEPARATOR;
+        data += "." + Strings.toLowerCase( REALM ) + " = " + REALM + SystemUtils.LINE_SEPARATOR;
+        data += Strings.toLowerCase( REALM ) + " = " + REALM + SystemUtils.LINE_SEPARATOR;
 
         FileUtils.writeStringToFile( file, data );
 

Propchange: directory/apacheds/branches/one-sub-level-index-removal/ldap-client-test/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -0,0 +1,11 @@
+/directory/apacheds/branches/apacheds-codec-merge/ldap-client-test:982369-987590
+/directory/apacheds/branches/apacheds-config/ldap-client-test:1023442-1029077
+/directory/apacheds/branches/apacheds-jdbm/ldap-client-test:1160768-1164092
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/ldap-client-test:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/ldap-client-test:749790-764110
+/directory/apacheds/branches/apacheds-schema/ldap-client-test:806623-896441
+/directory/apacheds/branches/apacheds-subtree/ldap-client-test:965203-965686
+/directory/apacheds/branches/milestones/ldap-client-test:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/ldap-client-test:945827-946347
+/directory/apacheds/trunk/ldap-client-test:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
+/directory/studio/trunk/ldap-client-test:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/ldif-partition/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -1,7 +1,8 @@
 /directory/apacheds/branches/apacheds-codec-merge/ldif-partition:982369-987590
 /directory/apacheds/branches/apacheds-config/ldif-partition:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/ldif-partition:980138-980936
+/directory/apacheds/branches/apacheds-jdbm/ldif-partition:1160768-1164092
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/ldif-partition:1040956-1043765
 /directory/apacheds/branches/milestones/ldif-partition:1072812-1075328
-/directory/apacheds/trunk/ldif-partition:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/ldif-partition:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/ldif-partition:1067786-1067997

Modified: directory/apacheds/branches/one-sub-level-index-removal/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Fri Sep  2 18:30:57 2011
@@ -670,7 +670,7 @@ public class LdifPartition extends Abstr
             }
         }
 
-        return sb.toString().toLowerCase();
+        return Strings.toLowerCase( sb.toString() );
     }
 
 

Modified: directory/apacheds/branches/one-sub-level-index-removal/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/pom.xml?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/pom.xml (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/pom.xml Fri Sep  2 18:30:57 2011
@@ -210,7 +210,34 @@
               <exclude>**/*.log</exclude>
             </excludes>
           </configuration>
-         </plugin>
+        </plugin>
+        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+        <plugin>
+          <groupId>org.eclipse.m2e</groupId>
+          <artifactId>lifecycle-mapping</artifactId>
+          <version>1.0.0</version>
+          <configuration>
+            <lifecycleMappingMetadata>
+              <pluginExecutions>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <versionRange>[2.2,)</versionRange>
+                    <goals>
+                      <goal>copy</goal>
+                      <goal>copy-dependencies</goal>
+                      <goal>unpack</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore></ignore>
+                  </action>
+                </pluginExecution>
+              </pluginExecutions>
+            </lifecycleMappingMetadata>
+          </configuration>
+        </plugin>
       </plugins>
     </pluginManagement>
     

Propchange: directory/apacheds/branches/one-sub-level-index-removal/protocol-changepw/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-changepw:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw:1040956-1043765
 /directory/apacheds/branches/milestones/protocol-changepw:1072812-1075328
-/directory/apacheds/trunk/protocol-changepw:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/protocol-changepw:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/protocol-changepw:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/protocol-dhcp/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-dhcp:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-dhcp:1040956-1043765
 /directory/apacheds/branches/milestones/protocol-dhcp:1072812-1075328
-/directory/apacheds/trunk/protocol-dhcp:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/protocol-dhcp:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/protocol-dhcp:1067786-1067997

Propchange: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 18:30:57 2011
@@ -3,5 +3,5 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-dns:980138-980936
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-dns:1040956-1043765
 /directory/apacheds/branches/milestones/protocol-dns:1072812-1075328
-/directory/apacheds/trunk/protocol-dns:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1161268
+/directory/apacheds/trunk/protocol-dns:1066126-1067785,1068026-1072718,1072800-1075329,1158399-1164660
 /directory/studio/trunk/protocol-dns:1067786-1067997

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java Fri Sep  2 18:30:57 2011
@@ -23,6 +23,8 @@ package org.apache.directory.server.dns.
 
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * The answer, authority, and additional sections all share the same
@@ -152,7 +154,7 @@ public class ResourceRecordImpl implemen
      */
     public String get( String id )
     {
-        return ( String ) attributes.get( id.toLowerCase() );
+        return ( String ) attributes.get( Strings.toLowerCase( id ) );
     }
 
 

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java Fri Sep  2 18:30:57 2011
@@ -23,6 +23,8 @@ package org.apache.directory.server.dns.
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -90,6 +92,6 @@ public class ResourceRecordModifier
      */
     public void put( String id, String value )
     {
-        attributes.put( id.toLowerCase(), value );
+        attributes.put( Strings.toLowerCase( id ), value );
     }
 }

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java Fri Sep  2 18:30:57 2011
@@ -45,6 +45,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -63,7 +64,7 @@ public class CanonicalNameRecordEncoderT
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), cname );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), cname );
         return map;
     }
 

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java Fri Sep  2 18:30:57 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -44,8 +45,8 @@ public class MailExchangeRecordEncoderTe
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.MX_PREFERENCE.toLowerCase(), mxPreference );
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), mxHost );
+        map.put( Strings.toLowerCase( DnsAttribute.MX_PREFERENCE ), mxPreference );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), mxHost );
         return map;
     }
 

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java Fri Sep  2 18:30:57 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -43,7 +44,7 @@ public class NameServerRecordEncoderTest
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), nsName );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), nsName );
         return map;
     }
 

Modified: directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java?rev=1164667&r1=1164666&r2=1164667&view=diff
==============================================================================
--- directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java (original)
+++ directory/apacheds/branches/one-sub-level-index-removal/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java Fri Sep  2 18:30:57 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -43,7 +44,7 @@ public class PointerRecordEncoderTest ex
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), ptrName );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), ptrName );
         return map;
     }
 



Mime
View raw message