directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r835669 - in /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema: ./ registries/
Date Fri, 13 Nov 2009 00:33:52 GMT
Author: elecharny
Date: Fri Nov 13 00:33:51 2009
New Revision: 835669

URL: http://svn.apache.org/viewvc?rev=835669&view=rev
Log:
Added toString() methods

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapComparator.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
Fri Nov 13 00:33:51 2009
@@ -821,7 +821,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
Fri Nov 13 00:33:51 2009
@@ -561,7 +561,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
Fri Nov 13 00:33:51 2009
@@ -200,7 +200,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DescriptionUtils.java
Fri Nov 13 00:33:51 2009
@@ -51,7 +51,7 @@
     /**
      * Generates the description using the AttributeTypeDescription as defined
      * by the syntax: 1.3.6.1.4.1.1466.115.121.1.3. Only the right hand side of
-     * the description starting at the openning parenthesis is generated: that
+     * the description starting at the opening parenthesis is generated: that
      * is 'AttributeTypeDescription = ' is not generated.
      * 
      * <pre>
@@ -172,11 +172,36 @@
         return buf.toString();
     }
 
+    
+    /**
+     * Generates the ComparatorDescription for a LdapComparator. Only the right 
+     * hand side of the description starting at the opening parenthesis is 
+     * generated: that is 'ComparatorDescription = ' is not generated.
+     * 
+     * <pre>
+     * ComparatorDescription = &quot;(&quot;
+     *     numericoid                          
+     *     [&quot;DESC&quot; qdstring ]
+     *     &quot;FQCN&quot; whsp fqcn
+     *     [&quot;BYTECODE&quot; whsp base64  ]
+     *     extensions 
+     *     &quot;)&quot;
+     * </pre>
+     * 
+     * @param comparator
+     *            the Comparator to generate the description for
+     * @return the ComparatorDescription string
+     */
+    public static String getDescription( LdapComparator<?> comparator )
+    {
+        return getLoadableDescription( comparator );
+    }
+    
 
     /**
      * Generates the DITContentRuleDescription for a DITContentRule as defined
      * by the syntax: 1.3.6.1.4.1.1466.115.121.1.16. Only the right hand side of
-     * the description starting at the openning parenthesis is generated: that
+     * the description starting at the opening parenthesis is generated: that
      * is 'DITContentRuleDescription = ' is not generated.
      * 
      * <pre>
@@ -264,13 +289,103 @@
         return buf.toString();
     }
 
+    
+    /**
+     * Generates the DITStructureRuleDescription for a DITStructureRule as
+     * defined by the syntax: 1.3.6.1.4.1.1466.115.121.1.17. Only the right hand
+     * side of the description starting at the opening parenthesis is
+     * generated: that is 'DITStructureRuleDescription = ' is not generated.
+     * 
+     * <pre>
+     *   DITStructureRuleDescription = &quot;(&quot; whsp
+     *       ruleid                     ; rule identifier
+     *       [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
+     *       [ SP "DESC" SP qdstring ]  ; description
+     *       [ SP "OBSOLETE" ]          ; not active
+     *       SP "FORM" SP oid           ; NameForm
+     *       [ SP "SUP" ruleids ]       ; superior rules
+     *       extensions WSP             ; extensions
+     *       &quot;)&quot;
+     * </pre>
+     * 
+     * @param dITStructureRule
+     *            the DITStructureRule to generate the description for
+     * @return the description in the DITStructureRuleDescription syntax
+     */
+    public static String getDescription( DITStructureRule dITStructureRule )
+    {
+        StringBuilder buf = new StringBuilder( "( " );
+        buf.append( dITStructureRule.getOid() );
+        buf.append( '\n' );
+
+        if ( dITStructureRule.getNames() != null )
+        {
+            buf.append( " NAME " );
+            getQDescrs( buf, dITStructureRule.getNames() );
+        }
 
+        if ( dITStructureRule.getDescription() != null )
+        {
+            buf.append( " DESC " );
+            buf.append( dITStructureRule.getDescription() );
+            buf.append( '\n' );
+        }
+
+        if ( dITStructureRule.isObsolete() )
+        {
+            buf.append( " OBSOLETE\n" );
+        }
+
+        buf.append( " FORM " );
+        buf.append( dITStructureRule.getForm() );
+        buf.append( '\n' );
+
+        // TODO : Shouldn't we get the ruleId OID ? 
+        List<Integer> sups = dITStructureRule.getSuperRules();
+        
+        if ( ( sups != null ) && ( sups.size() > 0 ) )
+        {
+            buf.append( " SUP\n" );
+            
+            if ( sups.size() == 1 )
+            {
+                buf.append( sups.get( 0 ) );
+            }
+            else
+            {
+                boolean isFirst = true;
+                buf.append( "( " );
+                
+                for ( int sup : sups )
+                {
+                    if ( isFirst )
+                    {
+                        isFirst = false;
+                    }
+                    else
+                    {
+                        buf.append( " " );
+                    }
+                    
+                    buf.append( sup );
+                }
+                
+                buf.append( " )" );
+            }
+
+            buf.append( '\n' );
+        }
+
+        buf.append( " )\n" );
+
+        return buf.toString();
+    }
 
 
     /**
      * Generates the MatchingRuleDescription for a MatchingRule as defined by
      * the syntax: 1.3.6.1.4.1.1466.115.121.1.30. Only the right hand side of
-     * the description starting at the openning parenthesis is generated: that
+     * the description starting at the opening parenthesis is generated: that
      * is 'MatchingRuleDescription = ' is not generated.
      * 
      * <pre>
@@ -328,7 +443,7 @@
     /**
      * Generates the MatchingRuleUseDescription for a MatchingRuleUse as defined
      * by the syntax: 1.3.6.1.4.1.1466.115.121.1.31. Only the right hand side of
-     * the description starting at the openning parenthesis is generated: that
+     * the description starting at the opening parenthesis is generated: that
      * is 'MatchingRuleUseDescription = ' is not generated.
      * 
      * <pre>
@@ -422,7 +537,7 @@
     /**
      * Generates the NameFormDescription for a NameForm as defined by the
      * syntax: 1.3.6.1.4.1.1466.115.121.1.35. Only the right hand side of the
-     * description starting at the openning parenthesis is generated: that is
+     * description starting at the opening parenthesis is generated: that is
      * 'NameFormDescription = ' is not generated.
      * 
      * <pre>
@@ -491,11 +606,36 @@
         return buf.toString();
     }
 
+    
+    /**
+     * Generates the NormalizerDescription for a Normalizer. Only the right 
+     * hand side of the description starting at the opening parenthesis is 
+     * generated: that is 'NormalizerDescription = ' is not generated.
+     * 
+     * <pre>
+     * NormalizerDescription = &quot;(&quot;
+     *     numericoid                          
+     *     [&quot;DESC&quot; qdstring ]
+     *     &quot;FQCN&quot; whsp fqcn
+     *     [&quot;BYTECODE&quot; whsp base64  ]
+     *     extensions 
+     *     &quot;)&quot;
+     * </pre>
+     * 
+     * @param normalizer
+     *            the Normalizer to generate the description for
+     * @return the NormalizerDescription string
+     */
+    public static String getDescription( Normalizer normalizer )
+    {
+        return getLoadableDescription( normalizer );
+    }
+
 
     /**
      * Generates the ObjectClassDescription for an ObjectClass as defined by the
      * syntax: 1.3.6.1.4.1.1466.115.121.1.37. Only the right hand side of the
-     * description starting at the openning parenthesis is generated: that is
+     * description starting at the opening parenthesis is generated: that is
      * 'ObjectClassDescription = ' is not generated.
      * 
      * <pre>
@@ -582,101 +722,9 @@
 
 
     /**
-     * Generates the DITStructureRuleDescription for a DITStructureRule as
-     * defined by the syntax: 1.3.6.1.4.1.1466.115.121.1.17. Only the right hand
-     * side of the description starting at the openning parenthesis is
-     * generated: that is 'DITStructureRuleDescription = ' is not generated.
-     * 
-     * <pre>
-     *   DITStructureRuleDescription = &quot;(&quot; whsp
-     *       ruleid                     ; rule identifier
-     *       [ SP "NAME" SP qdescrs ]   ; short names (descriptors)
-     *       [ SP "DESC" SP qdstring ]  ; description
-     *       [ SP "OBSOLETE" ]          ; not active
-     *       SP "FORM" SP oid           ; NameForm
-     *       [ SP "SUP" ruleids ]       ; superior rules
-     *       extensions WSP             ; extensions
-     *       &quot;)&quot;
-     * </pre>
-     * 
-     * @param dITStructureRule
-     *            the DITStructureRule to generate the description for
-     * @return the description in the DITStructureRuleDescription syntax
-     */
-    public static String getDescription( DITStructureRule dITStructureRule )
-    {
-        StringBuilder buf = new StringBuilder( "( " );
-        buf.append( dITStructureRule.getOid() );
-        buf.append( '\n' );
-
-        if ( dITStructureRule.getNames() != null )
-        {
-            buf.append( " NAME " );
-            getQDescrs( buf, dITStructureRule.getNames() );
-        }
-
-        if ( dITStructureRule.getDescription() != null )
-        {
-            buf.append( " DESC " );
-            buf.append( dITStructureRule.getDescription() );
-            buf.append( '\n' );
-        }
-
-        if ( dITStructureRule.isObsolete() )
-        {
-            buf.append( " OBSOLETE\n" );
-        }
-
-        buf.append( " FORM " );
-        buf.append( dITStructureRule.getForm() );
-        buf.append( '\n' );
-
-        // TODO : Shouldn't we get the ruleId OID ? 
-        List<Integer> sups = dITStructureRule.getSuperRules();
-        
-        if ( ( sups != null ) && ( sups.size() > 0 ) )
-        {
-            buf.append( " SUP\n" );
-            
-            if ( sups.size() == 1 )
-            {
-                buf.append( sups.get( 0 ) );
-            }
-            else
-            {
-                boolean isFirst = true;
-                buf.append( "( " );
-                
-                for ( int sup : sups )
-                {
-                    if ( isFirst )
-                    {
-                        isFirst = false;
-                    }
-                    else
-                    {
-                        buf.append( " " );
-                    }
-                    
-                    buf.append( sup );
-                }
-                
-                buf.append( " )" );
-            }
-
-            buf.append( '\n' );
-        }
-
-        buf.append( " )\n" );
-
-        return buf.toString();
-    }
-
-
-    /**
      * Generates the SyntaxDescription for a Syntax as defined by the syntax:
      * 1.3.6.1.4.1.1466.115.121.1.54. Only the right hand side of the
-     * description starting at the openning parenthesis is generated: that is
+     * description starting at the opening parenthesis is generated: that is
      * 'SyntaxDescription = ' is not generated.
      * 
      * <pre>
@@ -714,6 +762,31 @@
     }
 
     
+    /**
+     * Generates the SyntaxCheckerDescription for a SyntaxChecker. Only the right 
+     * hand side of the description starting at the opening parenthesis is 
+     * generated: that is 'SyntaxCheckerDescription = ' is not generated.
+     * 
+     * <pre>
+     * SyntaxCheckerDescription = &quot;(&quot;
+     *     numericoid                          
+     *     [&quot;DESC&quot; qdstring ]
+     *     &quot;FQCN&quot; whsp fqcn
+     *     [&quot;BYTECODE&quot; whsp base64  ]
+     *     extensions 
+     *     &quot;)&quot;
+     * </pre>
+     * 
+     * @param syntaxChecker
+     *            the SyntaxChecker to generate the description for
+     * @return the SyntaxCheckerDescription string
+     */
+    public static String getDescription( SyntaxChecker syntaxChecker )
+    {
+        return getLoadableDescription( syntaxChecker );
+    }
+
+
     private static void getExtensions( StringBuilder sb, Map<String, List<String>>
extensions )
     {
         for ( String key:extensions.keySet() )
@@ -824,4 +897,55 @@
         
         sb.append(  '\n' );
     }
+    
+    
+    /**
+     * Generate the description for Comparators, Normalizers and SyntaxCheckers.
+     */
+    private static String getLoadableDescription( LoadableSchemaObject schemaObject )
+    {
+        StringBuilder buf = new StringBuilder( "( " );
+        buf.append( schemaObject.getOid() );
+        buf.append( '\n' );
+
+        if ( schemaObject.getDescription() != null )
+        {
+            buf.append( " DESC " );
+            buf.append( schemaObject.getDescription() );
+            buf.append( '\n' );
+        }
+
+        if ( schemaObject.getFqcn() != null )
+        {
+            buf.append( " FQCN " );
+            buf.append( schemaObject.getFqcn() );
+            buf.append( '\n' );
+        }
+
+        if ( schemaObject.getBytecode() != null )
+        {
+            buf.append( " BYTECODE " );
+            
+            // We will dump only the 16 first bytes
+            if ( schemaObject.getBytecode().length() > 16 )
+            {
+                buf.append( schemaObject.getBytecode().substring( 0, 16 ) );
+            }
+            else
+            {
+                buf.append( schemaObject.getBytecode() );
+            }
+            
+            buf.append( '\n' );
+        }
+
+        if ( schemaObject.getExtensions() != null )
+        {
+            getExtensions( buf, schemaObject.getExtensions() );
+        }
+
+        buf.append( " ) " );
+
+        return buf.toString();
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapComparator.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapComparator.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapComparator.java
Fri Nov 13 00:33:51 2009
@@ -63,4 +63,13 @@
         
         return clone;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return objectType + " " + DescriptionUtils.getDescription( this );
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
Fri Nov 13 00:33:51 2009
@@ -172,7 +172,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
Fri Nov 13 00:33:51 2009
@@ -265,7 +265,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
Fri Nov 13 00:33:51 2009
@@ -227,7 +227,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
Fri Nov 13 00:33:51 2009
@@ -423,7 +423,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
     
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
Fri Nov 13 00:33:51 2009
@@ -98,4 +98,13 @@
         
         return clone;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return objectType + " " + DescriptionUtils.getDescription( this );
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
Fri Nov 13 00:33:51 2009
@@ -503,7 +503,7 @@
      */
     public String toString()
     {
-        return DescriptionUtils.getDescription( this );
+        return objectType + " " + DescriptionUtils.getDescription( this );
     }
 
     

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
Fri Nov 13 00:33:51 2009
@@ -93,4 +93,13 @@
         
         return clone;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return objectType + " " + DescriptionUtils.getDescription( this );
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
Fri Nov 13 00:33:51 2009
@@ -317,32 +317,6 @@
 
     
     /**
-     * @see Object#toString()
-     */
-    public String toString()
-    {
-        StringBuilder sb = new StringBuilder();
-        boolean isFirst = true;
-        
-        for ( String name:byName.keySet() )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append(  ", " );
-            }
-            
-            sb.append( name );
-        }
-        
-        return sb.toString();
-    }
-    
-    
-    /**
      * {@inheritDoc}
      */
     public DefaultAttributeTypeRegistry clone() throws CloneNotSupportedException

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java
Fri Nov 13 00:33:51 2009
@@ -163,30 +163,4 @@
     {
         return byName.values().size();
     }
-
-
-    /**
-     * @see Object#toString()
-     */
-    public String toString()
-    {
-        StringBuilder sb = new StringBuilder();
-        boolean isFirst = true;
-        
-        for ( String name:byName.keySet() )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append(  ", " );
-            }
-            
-            sb.append( name );
-        }
-        
-        return sb.toString();
-    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
Fri Nov 13 00:33:51 2009
@@ -362,5 +362,17 @@
     {
         return 0;
     }
-
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( type ).append( ':' );
+        sb.append( StringTools.setToString( byName.keySet() ) );
+        return sb.toString();
+    }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=835669&r1=835668&r2=835669&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Fri Nov 13 00:33:51 2009
@@ -62,8 +62,8 @@
     private static final Logger LOG = LoggerFactory.getLogger( Registries.class );
 
     /**
-     * A String name to Schema object map for those schemas loaded into this
-     * registry.
+     * A String name to Schema object map for the schemas loaded into this
+     * registry. The loaded schemas may be disabled.
      */
     protected Map<String, Schema> loadedSchemas = new HashMap<String, Schema>();
 
@@ -949,25 +949,6 @@
     }
     
 	
-    /**
-     * Add the given LdapComparator into the Registries
-     *
-     * @param comparator The LdapComparator to register
-     * @throws NamingException If the registering failed
-     */
-    public void register( LdapComparator<?> comparator ) throws NamingException
-    {
-        LOG.debug( "Registering Comparator: {}:{}", comparator.getOid(), comparator.getName()
);
-
-        comparatorRegistry.register( comparator );
-        
-        if ( LOG.isDebugEnabled() )
-        {
-            LOG.debug( "registered " + comparator.getName() + " for OID {}", comparator.getOid()
);
-        }
-    }
-    
-        
 	public void register( SchemaObject schemaObject ) throws NamingException
 	{
 	    LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
@@ -1044,6 +1025,8 @@
 	    {
 	        // Create the association
 	        content.add( schemaWrapper );
+	        
+            LOG.debug( "registered {} for OID {}", schemaObject.getName(), schemaObject.getOid()
);
 	    }
 	}
 
@@ -1118,6 +1101,7 @@
         {
             // remove the schemaObject
             content.remove( schemaWrapper );
+            LOG.debug( "Unregistered {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
         }
         else
         {



Mime
View raw message