You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2010/02/28 17:40:20 UTC

svn commit: r917198 - in /directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server: core/partition/impl/btree/gui/ xdbm/tools/

Author: seelmann
Date: Sun Feb 28 16:40:20 2010
New Revision: 917198

URL: http://svn.apache.org/viewvc?rev=917198&view=rev
Log:
formatting

Modified:
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Sun Feb 28 16:40:20 2010
@@ -55,7 +55,7 @@
     private final Long id;
 
 
-    public EntryNode(Long id, EntryNode parent, BTreePartition partition, ServerEntry entry, Map<Long, EntryNode> map)
+    public EntryNode( Long id, EntryNode parent, BTreePartition partition, ServerEntry entry, Map<Long, EntryNode> map )
     {
         this( id, parent, partition, entry, map, null, null );
     }
@@ -81,8 +81,8 @@
         try
         {
             List<ForwardIndexEntry> recordForwards = new ArrayList<ForwardIndexEntry>();
-            IndexCursor<Long,ServerEntry> childList = db.list( id );
-            
+            IndexCursor<Long, ServerEntry> childList = db.list( id );
+
             while ( childList.next() )
             {
                 IndexEntry old = childList.get();
@@ -90,7 +90,7 @@
                 newRec.copy( old );
                 recordForwards.add( newRec );
             }
-            
+
             childList.close();
 
             Iterator list = recordForwards.iterator();
@@ -124,8 +124,8 @@
                 }
                 else
                 {
-                    ServerEntry newEntry = db.lookup( (Long)rec.getId() );
-                    EntryNode child = new EntryNode( (Long)rec.getId(), this, db, newEntry, map );
+                    ServerEntry newEntry = db.lookup( ( Long ) rec.getId() );
+                    EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map );
                     children.add( child );
                 }
             }

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Sun Feb 28 16:40:20 2010
@@ -62,7 +62,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class IndexDialog<K,O> extends JDialog
+public class IndexDialog<K, O> extends JDialog
 {
     private static final Logger LOG = LoggerFactory.getLogger( IndexDialog.class );
 
@@ -88,18 +88,18 @@
     private JLabel jLabel2 = new JLabel();
     private JButton scanBut = new JButton();
 
-    private Index<K,O> index = null;
+    private Index<K, O> index = null;
 
 
-    public IndexDialog( Frame parent, boolean modal, Index<K,O> index )
+    public IndexDialog( Frame parent, boolean modal, Index<K, O> index )
     {
         super( parent, modal );
         this.index = index;
         initGUI();
     }
-    
-    
-    public IndexDialog( Index<K,O> index )
+
+
+    public IndexDialog( Index<K, O> index )
     {
         super();
         this.index = index;
@@ -273,7 +273,7 @@
 
     public boolean doScan( K key, String scanType )
     {
-        if ( key == null && ! scanType.equals( DEFAULT_CURSOR ) )
+        if ( key == null && !scanType.equals( DEFAULT_CURSOR ) )
         {
             JOptionPane.showMessageDialog( null, "Cannot use a " + scanType + " scan type with a null key constraint.",
                 "Missing Key Constraint", JOptionPane.ERROR_MESSAGE );
@@ -297,7 +297,7 @@
                 list.beforeFirst();
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -313,7 +313,7 @@
                 list.before( entry );
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -329,7 +329,7 @@
                 list.after( entry );
                 while ( list.previous() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -339,22 +339,22 @@
             }
             else if ( scanType.equals( REGEX_CURSOR ) )
             {
-//                Pattern regex = StringTools.getRegex( key );
-//                int starIndex = key.indexOf( '*' );
-//
-//                if ( starIndex > 0 )
-//                {
-//                    String prefix = key.substring( 0, starIndex );
-//
-//                    if ( log.isDebugEnabled() )
-//                        log.debug( "Regex prefix = " + prefix );
-//
-//                    list = index.listIndices( regex, prefix );
-//                }
-//                else
-//                {
-//                    list = index.listIndices( regex );
-//                }
+                //                Pattern regex = StringTools.getRegex( key );
+                //                int starIndex = key.indexOf( '*' );
+                //
+                //                if ( starIndex > 0 )
+                //                {
+                //                    String prefix = key.substring( 0, starIndex );
+                //
+                //                    if ( log.isDebugEnabled() )
+                //                        log.debug( "Regex prefix = " + prefix );
+                //
+                //                    list = index.listIndices( regex, prefix );
+                //                }
+                //                else
+                //                {
+                //                    list = index.listIndices( regex );
+                //                }
                 throw new NotImplementedException();
             }
             else
@@ -362,7 +362,7 @@
                 list = index.forwardCursor();
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -401,8 +401,8 @@
 
         return true;
     }
-    
-    
+
+
     public static void show( Index index )
     {
         //noinspection unchecked

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Sun Feb 28 16:40:20 2010
@@ -116,10 +116,10 @@
     private Map<Long, EntryNode> nodes;
     private EntryNode root;
 
-    
     /** A handle on the global schemaManager */
     private SchemaManager schemaManager;
 
+
     /**
      * Creates new form JFrame
      * 
@@ -462,10 +462,10 @@
         {
             in = new FileReader( selected );
 
-            for ( LdifEntry entry:new LdifReader( in ) )
+            for ( LdifEntry entry : new LdifReader( in ) )
             {
                 String updn = entry.getDn().getName();
-                
+
                 LdapDN ndn = new LdapDN( StringTools.deepTrimToLower( updn ) );
 
                 ServerEntry attrs = new DefaultServerEntry( schemaManager, entry.getEntry() );
@@ -662,8 +662,8 @@
             limitMax = Integer.parseInt( limit );
         }
 
-        IndexCursor<Long,ServerEntry> cursor = partition
-                .getSearchEngine().cursor( new LdapDN( base ), AliasDerefMode.DEREF_ALWAYS, root, ctls );
+        IndexCursor<Long, ServerEntry> cursor = partition.getSearchEngine().cursor( new LdapDN( base ),
+            AliasDerefMode.DEREF_ALWAYS, root, ctls );
         String[] cols = new String[2];
         cols[0] = "id";
         cols[1] = "dn";
@@ -873,10 +873,10 @@
         entryTbl.setModel( model );
 
         // TODO use utility method to getIndices below
-//        model = new AttributesTableModel( partition.getIndices( id ), id, dn, false );
-//        idxTbl.setModel( model );
-//
-//        validate();
+        //        model = new AttributesTableModel( partition.getIndices( id ), id, dn, false );
+        //        idxTbl.setModel( model );
+        //
+        //        validate();
     }
 
 

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java Sun Feb 28 16:40:20 2010
@@ -63,7 +63,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 639279 $
  */
-public class IndexDialog<K,O> extends JDialog
+public class IndexDialog<K, O> extends JDialog
 {
     private static final Logger LOG = LoggerFactory.getLogger( IndexDialog.class );
 
@@ -89,18 +89,18 @@
     private JLabel jLabel2 = new JLabel();
     private JButton scanBut = new JButton();
 
-    private Index<K,O> index = null;
+    private Index<K, O> index = null;
 
 
-    public IndexDialog( Frame parent, boolean modal, Index<K,O> index )
+    public IndexDialog( Frame parent, boolean modal, Index<K, O> index )
     {
         super( parent, modal );
         this.index = index;
         initGUI();
     }
-    
-    
-    public IndexDialog( Index<K,O> index )
+
+
+    public IndexDialog( Index<K, O> index )
     {
         super();
         this.index = index;
@@ -275,7 +275,7 @@
 
     public boolean doScan( K key, String scanType )
     {
-        if ( key == null && ! scanType.equals( DEFAULT_CURSOR ) )
+        if ( key == null && !scanType.equals( DEFAULT_CURSOR ) )
         {
             JOptionPane.showMessageDialog( null, "Cannot use a " + scanType + " scan type with a null key constraint.",
                 "Missing Key Constraint", JOptionPane.ERROR_MESSAGE );
@@ -299,7 +299,7 @@
                 list.beforeFirst();
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -315,7 +315,7 @@
                 list.before( entry );
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -331,7 +331,7 @@
                 list.after( entry );
                 while ( list.previous() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -341,22 +341,22 @@
             }
             else if ( scanType.equals( REGEX_CURSOR ) )
             {
-//                Pattern regex = StringTools.getRegex( key );
-//                int starIndex = key.indexOf( '*' );
-//
-//                if ( starIndex > 0 )
-//                {
-//                    String prefix = key.substring( 0, starIndex );
-//
-//                    if ( log.isDebugEnabled() )
-//                        log.debug( "Regex prefix = " + prefix );
-//
-//                    list = index.listIndices( regex, prefix );
-//                }
-//                else
-//                {
-//                    list = index.listIndices( regex );
-//                }
+                //                Pattern regex = StringTools.getRegex( key );
+                //                int starIndex = key.indexOf( '*' );
+                //
+                //                if ( starIndex > 0 )
+                //                {
+                //                    String prefix = key.substring( 0, starIndex );
+                //
+                //                    if ( log.isDebugEnabled() )
+                //                        log.debug( "Regex prefix = " + prefix );
+                //
+                //                    list = index.listIndices( regex, prefix );
+                //                }
+                //                else
+                //                {
+                //                    list = index.listIndices( regex );
+                //                }
                 throw new NotImplementedException();
             }
             else
@@ -364,7 +364,7 @@
                 list = index.forwardCursor();
                 while ( list.next() )
                 {
-                    IndexEntry<K,O> rec = list.get();
+                    IndexEntry<K, O> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -403,12 +403,12 @@
 
         return true;
     }
-    
-    
+
+
     @SuppressWarnings("unchecked")
-    public static void show( Index<?,ServerEntry> index )
+    public static void show( Index<?, ServerEntry> index )
     {
-        IndexDialog<?,ServerEntry> dialog = new IndexDialog( index );
+        IndexDialog<?, ServerEntry> dialog = new IndexDialog( index );
         dialog.setVisible( true );
     }
 }

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java Sun Feb 28 16:40:20 2010
@@ -38,7 +38,7 @@
 {
     public static void printContents( Index<?, ServerEntry> idx ) throws Exception
     {
-        printContents( idx, System.out );    
+        printContents( idx, System.out );
     }
 
 

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java?rev=917198&r1=917197&r2=917198&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java Sun Feb 28 16:40:20 2010
@@ -52,6 +52,7 @@
     /** CSN factory instance */
     private static final CsnFactory CSN_FACTORY = new CsnFactory( 0 );
 
+
     /**
      * Initializes and loads a store with the example data shown in
      * <a href="http://cwiki.apache.org/confluence/display/DIRxSRVx11/Structure+and+Organization">
@@ -70,7 +71,7 @@
 
         LdapDN suffixDn = new LdapDN( "o=Good Times Co." );
         suffixDn.normalize( schemaManager.getNormalizerMapping() );
-        
+
         store.init( schemaManager );
 
         // Entry #1
@@ -81,7 +82,6 @@
         entry.add( "postOfficeBox", "1" );
         injectEntryInStore( store, entry );
 
-        
         // Entry #2
         LdapDN dn = new LdapDN( "ou=Sales,o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
@@ -101,7 +101,7 @@
         entry.add( "postalCode", "1" );
         entry.add( "postOfficeBox", "1" );
         injectEntryInStore( store, entry );
-        
+
         // Entry #4
         dn = new LdapDN( "ou=Engineering,o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
@@ -111,27 +111,27 @@
         entry.add( "postalCode", "2" );
         entry.add( "postOfficeBox", "2" );
         injectEntryInStore( store, entry );
-        
+
         // Entry #5
         dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Sales" );
-        entry.add( "cn", "JOhnny WAlkeR");
-        entry.add( "sn", "WAlkeR");
+        entry.add( "cn", "JOhnny WAlkeR" );
+        entry.add( "sn", "WAlkeR" );
         entry.add( "postalCode", "3" );
         entry.add( "postOfficeBox", "3" );
         injectEntryInStore( store, entry );
-        
+
         // Entry #6
         dn = new LdapDN( "cn=JIM BEAN,ou=Sales,o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Sales" );
-        entry.add( "cn",  "JIM BEAN");
-        entry.add( "surName", "BEAN");
+        entry.add( "cn", "JIM BEAN" );
+        entry.add( "surName", "BEAN" );
         entry.add( "postalCode", "4" );
         entry.add( "postOfficeBox", "4" );
         injectEntryInStore( store, entry );
@@ -145,15 +145,15 @@
         entry.add( "postalCode", "5" );
         entry.add( "postOfficeBox", "5" );
         injectEntryInStore( store, entry );
-        
+
         // Entry #8
         dn = new LdapDN( "cn=Jack Daniels,ou=Engineering,o=Good Times Co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Engineering" );
-        entry.add( "cn",  "Jack Daniels");
-        entry.add( "SN",  "Daniels");
+        entry.add( "cn", "Jack Daniels" );
+        entry.add( "SN", "Daniels" );
         entry.add( "postalCode", "6" );
         entry.add( "postOfficeBox", "6" );
         injectEntryInStore( store, entry );
@@ -166,7 +166,7 @@
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "alias", "extensibleObject" );
         entry.add( "ou", "Apache" );
-        entry.add( "commonName",  "Jim Bean");
+        entry.add( "commonName", "Jim Bean" );
         entry.add( "aliasedObjectName", "cn=Jim Bean,ou=Sales,o=Good Times Co." );
         injectEntryInStore( store, entry );
 
@@ -175,7 +175,7 @@
         dn.normalize( schemaManager.getNormalizerMapping() );
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "alias", "extensibleObject" );
-        entry.add( "commonName",  "Jim Bean");
+        entry.add( "commonName", "Jim Bean" );
         entry.add( "aliasedObjectName", "cn=Jim Bean,ou=Sales,o=Good Times Co." );
         injectEntryInStore( store, entry );
 
@@ -185,12 +185,12 @@
         entry = new DefaultServerEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "alias", "extensibleObject" );
         entry.add( "ou", "Engineering" );
-        entry.add( "2.5.4.3",  "Johnny Walker");
+        entry.add( "2.5.4.3", "Johnny Walker" );
         entry.add( "aliasedObjectName", "cn=Johnny Walker,ou=Sales,o=Good Times Co." );
         injectEntryInStore( store, entry );
     }
-    
-    
+
+
     /**
      * This is primarily a convenience method used to extract all the attributes
      * associated with an entry.
@@ -211,7 +211,7 @@
         entry.put( "_parent", Long.toString( store.getParentId( id ) ) );
 
         // Get all standard index attribute to value mappings
-        for ( Index index : ( Set<Index> )store.getUserIndices() )
+        for ( Index index : ( Set<Index> ) store.getUserIndices() )
         {
             Cursor<ForwardIndexEntry> list = index.reverseCursor();
             ForwardIndexEntry recordForward = new ForwardIndexEntry();
@@ -229,7 +229,7 @@
                 {
                     attr = new DefaultClientAttribute( attrId );
                 }
-                
+
                 attr.add( val );
                 entry.put( attr );
             }
@@ -242,7 +242,7 @@
         recordForward.setId( id );
         list.before( recordForward );
         StringBuffer val = new StringBuffer();
-        
+
         while ( list.next() )
         {
             IndexEntry rec = list.get();
@@ -252,12 +252,12 @@
 
             String valStr = val.toString();
             EntryAttribute attr = entry.get( valStr );
-            
+
             if ( attr == null )
             {
                 attr = new DefaultClientAttribute( valStr );
             }
-            
+
             attr.add( rec.getId().toString() );
             entry.put( attr );
             val.setLength( 0 );
@@ -272,7 +272,7 @@
 
         EntryAttribute childAttr = new DefaultClientAttribute( "_child" );
         entry.put( childAttr );
-        
+
         while ( children.next() )
         {
             IndexEntry rec = children.get();
@@ -297,7 +297,7 @@
     {
         entry.add( SchemaConstants.ENTRY_CSN_AT, CSN_FACTORY.newInstance().toString() );
         entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
-        
+
         store.add( entry );
     }
 }