directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r499644 [2/2] - in /directory/apacheds/trunk: bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ constants/src/main/java/org/apache/directory/server/constants/ core-unit/src/test/java/org/apache/directory/serv...
Date Thu, 25 Jan 2007 02:29:02 GMT
Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultMatchingRuleUseRegistry.java
Wed Jan 24 18:29:00 2007
@@ -44,8 +44,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultMatchingRuleUseRegistry.class
);
     /** maps a name to an MatchingRuleUse */
     private final Map<String,MatchingRuleUse> byName;
-    /** maps a MatchingRuleUse name to a schema name*/
-    private final Map<String,String> nameToSchema;
 
 
     // ------------------------------------------------------------------------
@@ -59,7 +57,6 @@
     public DefaultMatchingRuleUseRegistry()
     {
         this.byName = new HashMap<String,MatchingRuleUse>();
-        this.nameToSchema = new HashMap<String,String>();
     }
 
 
@@ -68,7 +65,7 @@
     // ------------------------------------------------------------------------
 
     
-    public void register( String schema, MatchingRuleUse matchingRuleUse ) throws NamingException
+    public void register( MatchingRuleUse matchingRuleUse ) throws NamingException
     {
         if ( byName.containsKey( matchingRuleUse.getName() ) )
         {
@@ -77,7 +74,6 @@
             throw e;
         }
 
-        nameToSchema.put( matchingRuleUse.getName(), schema );
         byName.put( matchingRuleUse.getName(), matchingRuleUse );
         if ( log.isDebugEnabled() )
         {
@@ -111,12 +107,13 @@
 
     public String getSchemaName( String id ) throws NamingException
     {
-        if ( nameToSchema.containsKey( id ) )
+        MatchingRuleUse mru = byName.get( id );
+        if ( mru != null )
         {
-            return ( String ) nameToSchema.get( id );
+            return mru.getSchema();
         }
 
-        throw new NamingException( "Name " + id + " not found in name to " + "schema name
map!" );
+        throw new NamingException( "Name " + id + " not found in name to " + "MatchingRuleUse
map!" );
     }
 
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNameFormRegistry.java
Wed Jan 24 18:29:00 2007
@@ -43,8 +43,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultNameFormRegistry.class
);
     /** maps an OID to an NameForm */
     private final Map<String,NameForm> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
 
@@ -59,7 +57,6 @@
     public DefaultNameFormRegistry(OidRegistry oidRegistry)
     {
         this.byOid = new HashMap<String,NameForm>();
-        this.oidToSchema = new HashMap<String,String>();
         this.oidRegistry = oidRegistry;
     }
 
@@ -68,7 +65,7 @@
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, NameForm nameForm ) throws NamingException
+    public void register( NameForm nameForm ) throws NamingException
     {
         if ( byOid.containsKey( nameForm.getOid() ) )
         {
@@ -77,7 +74,6 @@
             throw e;
         }
 
-        oidToSchema.put( nameForm.getOid(), schema );
         oidRegistry.register( nameForm.getName(), nameForm.getOid() );
         byOid.put( nameForm.getOid(), nameForm );
         if ( log.isDebugEnabled() )
@@ -127,12 +123,13 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        NameForm nf = byOid.get( id );
+        if ( nf != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return nf.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!"
);
+        throw new NamingException( "OID " + id + " not found in oid to " + "NameForm map!"
);
     }
 
 

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultObjectClassRegistry.java
Wed Jan 24 18:29:00 2007
@@ -43,8 +43,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultObjectClassRegistry.class
);
     /** maps an OID to an ObjectClass */
     private final Map<String,ObjectClass> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
 
@@ -59,7 +57,6 @@
     public DefaultObjectClassRegistry(OidRegistry oidRegistry)
     {
         this.byOid = new HashMap<String,ObjectClass>();
-        this.oidToSchema = new HashMap<String,String>();
         this.oidRegistry = oidRegistry;
     }
 
@@ -69,7 +66,7 @@
     // ------------------------------------------------------------------------
 
     
-    public void register( String schema, ObjectClass objectClass ) throws NamingException
+    public void register( ObjectClass objectClass ) throws NamingException
     {
         if ( byOid.containsKey( objectClass.getOid() ) )
         {
@@ -80,7 +77,6 @@
 
         oidRegistry.register( objectClass.getName(), objectClass.getOid() );
         byOid.put( objectClass.getOid(), objectClass );
-        oidToSchema.put( objectClass.getOid(), schema );
         if ( log.isDebugEnabled() )
         {
             log.debug( "registered objectClass: " + objectClass );
@@ -128,12 +124,13 @@
     public String getSchemaName( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        ObjectClass oc = byOid.get( id );
+        if ( oc != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return oc.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!"
);
+        throw new NamingException( "OID " + id + " not found in oid to " + "ObjectClass map!"
);
     }
 
 
@@ -151,6 +148,5 @@
         }
 
         byOid.remove( numericOid );
-        oidToSchema.remove( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultSyntaxRegistry.java
Wed Jan 24 18:29:00 2007
@@ -44,8 +44,6 @@
     private final static Logger log = LoggerFactory.getLogger( DefaultSyntaxRegistry.class
);
     /** a map of entries using an OID for the key and a Syntax for the value */
     private final Map<String,Syntax> byOid;
-    /** maps an OID to a schema name*/
-    private final Map<String,String> oidToSchema;
     /** the OID oidRegistry this oidRegistry uses to register new syntax OIDs */
     private final OidRegistry oidRegistry;
 
@@ -61,7 +59,6 @@
     {
         this.oidRegistry = registry;
         this.byOid = new HashMap<String,Syntax>();
-        this.oidToSchema = new HashMap<String,String>();
     }
 
 
@@ -89,7 +86,7 @@
     }
 
 
-    public void register( String schema, Syntax syntax ) throws NamingException
+    public void register( Syntax syntax ) throws NamingException
     {
         if ( byOid.containsKey( syntax.getOid() ) )
         {
@@ -108,7 +105,6 @@
         }
 
         byOid.put( syntax.getOid(), syntax );
-        oidToSchema.put( syntax.getOid(), schema );
         if ( log.isDebugEnabled() )
         {
             log.debug( "registered syntax: " + syntax );
@@ -142,12 +138,13 @@
         }
 
         id = oidRegistry.getOid( id );
-        if ( oidToSchema.containsKey( id ) )
+        Syntax syntax = byOid.get( id );
+        if ( syntax != null )
         {
-            return ( String ) oidToSchema.get( id );
+            return syntax.getSchema();
         }
 
-        throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!"
);
+        throw new NamingException( "OID " + id + " not found in oid to " + "Syntax map!"
);
     }
 
 
@@ -165,7 +162,6 @@
         }
 
         byOid.remove( numericOid );
-        oidToSchema.remove( numericOid );
         oidRegistry.unregister( numericOid );
     }
 }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
Wed Jan 24 18:29:00 2007
@@ -38,12 +38,11 @@
     /**
      * Registers a MatchingRule with this registry.
      * 
-     * @param schema the name of the schema the MatchingRule is associated with
      * @param matchingRule the MatchingRule to register
      * @throws NamingException if the matchingRule is already registered or the 
      * registration operation is not supported
      */
-    void register( String schema, MatchingRule matchingRule ) throws NamingException;
+    void register( MatchingRule matchingRule ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleUseRegistry.java
Wed Jan 24 18:29:00 2007
@@ -40,12 +40,11 @@
     /**
      * Registers a MatchingRuleUse with this registry.
      *
-     * @param schema the name of the schema the MatchingRuleUse is associated with
      * @param matchingRuleUse the matchingRuleUse to register
      * @throws NamingException if the MatchingRuleUse is already registered or
      * the registration operation is not supported
      */
-    void register( String schema, MatchingRuleUse matchingRuleUse ) throws NamingException;
+    void register( MatchingRuleUse matchingRuleUse ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NameFormRegistry.java
Wed Jan 24 18:29:00 2007
@@ -38,12 +38,11 @@
     /**
      * Registers a NameForm with this registry.
      * 
-     * @param schema the name of the schema the NameForm is associated with
      * @param nameForm the nameForm to register
      * @throws NamingException if the NameForm is already registered or the
      * registration operation is not supported
      */
-    void register( String schema, NameForm nameForm ) throws NamingException;
+    void register( NameForm nameForm ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
Wed Jan 24 18:29:00 2007
@@ -38,12 +38,11 @@
     /**
      * Registers an ObjectClass with this registry.
      *
-     * @param schema the name of the schema the ObjectClass is associated with
      * @param objectClass the objectClass to register
      * @throws NamingException if the ObjectClass is already registered or the
      * registration operation is not supported
      */
-    void register( String schema, ObjectClass objectClass ) throws NamingException;
+    void register( ObjectClass objectClass ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java?view=diff&rev=499644&r1=499643&r2=499644
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
(original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
Wed Jan 24 18:29:00 2007
@@ -49,12 +49,11 @@
     /**
      * Registers a Syntax with this registry.  
      * 
-     * @param schema the name of the schema the Syntax is associated with
      * @param syntax the Syntax to register
      * @throws NamingException if the syntax is already registered or the 
      * registration operation is not supported
      */
-    void register( String schema, Syntax syntax ) throws NamingException;
+    void register( Syntax syntax ) throws NamingException;
 
 
     /**



Mime
View raw message