You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/03/08 22:29:33 UTC

svn commit: r384335 [2/2] - in /directory/trunks/apacheds/core/src: main/java/org/apache/directory/server/core/ main/java/org/apache/directory/server/core/schema/ main/java/org/apache/directory/server/core/schema/bootstrap/ main/java/org/apache/directo...

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -23,9 +23,13 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.MatchingRuleRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapMatchingRuleRegistry;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.util.JoinIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,14 +40,14 @@
  */
 public class GlobalMatchingRuleRegistry implements MatchingRuleRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalMatchingRuleRegistry.class );
     /** maps an OID to an MatchingRule */
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
-    /** monitor notified via callback events */
-    private MatchingRuleRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapMatchingRuleRegistry bootstrap;
 
@@ -60,8 +64,6 @@
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
         this.oidRegistry = oidRegistry;
-        this.monitor = new MatchingRuleRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -70,35 +72,27 @@
     }
 
 
-    /**
-     * Sets the monitor that is to be notified via callback events.
-     *
-     * @param monitor the new monitor to notify of notable events
-     */
-    public void setMonitor( MatchingRuleRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, MatchingRule dITContentRule ) throws NamingException
+    
+    public void register( String schema, MatchingRule matchingRule ) throws NamingException
     {
-        if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasMatchingRule( dITContentRule.getOid() ) )
+        if ( byOid.containsKey( matchingRule.getOid() ) || bootstrap.hasMatchingRule( matchingRule.getOid() ) )
         {
-            NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+            NamingException e = new NamingException( "matchingRule w/ OID " + matchingRule.getOid()
                 + " has already been registered!" );
-            monitor.registerFailed( dITContentRule, e );
             throw e;
         }
 
-        oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
-        byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
-        monitor.registered( dITContentRule );
+        oidRegistry.register( matchingRule.getName(), matchingRule.getOid() );
+        byOid.put( matchingRule.getOid(), matchingRule );
+        oidToSchema.put( matchingRule.getOid(), schema );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered matchingRule: " + matchingRule );
+        }
     }
 
 
@@ -108,20 +102,25 @@
 
         if ( byOid.containsKey( id ) )
         {
-            MatchingRule dITContentRule = ( MatchingRule ) byOid.get( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            MatchingRule matchingRule = ( MatchingRule ) byOid.get( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up matchingRuleUse: " + matchingRule );
+            }
+            return matchingRule;
         }
 
         if ( bootstrap.hasMatchingRule( id ) )
         {
-            MatchingRule dITContentRule = bootstrap.lookup( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            MatchingRule matchingRule = bootstrap.lookup( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up matchingRuleUse: " + matchingRule );
+            }
+            return matchingRule;
         }
 
         NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
-        monitor.lookupFailed( id, e );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleUseRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleUseRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalMatchingRuleUseRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -23,9 +23,13 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.MatchingRuleUseRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapMatchingRuleUseRegistry;
 import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.util.JoinIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,14 +40,14 @@
  */
 public class GlobalMatchingRuleUseRegistry implements MatchingRuleUseRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalMatchingRuleUseRegistry.class );
     /** maps an OID to an MatchingRuleUse */
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
-    /** monitor notified via callback events */
-    private MatchingRuleUseRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapMatchingRuleUseRegistry bootstrap;
 
@@ -60,8 +64,6 @@
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
         this.oidRegistry = oidRegistry;
-        this.monitor = new MatchingRuleUseRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -70,35 +72,27 @@
     }
 
 
-    /**
-     * Sets the monitor that is to be notified via callback events.
-     *
-     * @param monitor the new monitor to notify of notable events
-     */
-    public void setMonitor( MatchingRuleUseRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, MatchingRuleUse dITContentRule ) throws NamingException
+    
+    public void register( String schema, MatchingRuleUse ruleUse ) throws NamingException
     {
-        if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasMatchingRuleUse( dITContentRule.getOid() ) )
+        if ( byOid.containsKey( ruleUse.getOid() ) || bootstrap.hasMatchingRuleUse( ruleUse.getOid() ) )
         {
-            NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+            NamingException e = new NamingException( "matchingRuleUse w/ OID " + ruleUse.getOid()
                 + " has already been registered!" );
-            monitor.registerFailed( dITContentRule, e );
             throw e;
         }
 
-        oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
-        byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
-        monitor.registered( dITContentRule );
+        oidRegistry.register( ruleUse.getName(), ruleUse.getOid() );
+        byOid.put( ruleUse.getOid(), ruleUse );
+        oidToSchema.put( ruleUse.getOid(), schema );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered matchingRuleUse: " + ruleUse );
+        }
     }
 
 
@@ -108,20 +102,25 @@
 
         if ( byOid.containsKey( id ) )
         {
-            MatchingRuleUse dITContentRule = ( MatchingRuleUse ) byOid.get( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            MatchingRuleUse ruleUse = ( MatchingRuleUse ) byOid.get( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up matchingRuleUse: " + ruleUse );
+            }
+            return ruleUse;
         }
 
         if ( bootstrap.hasMatchingRuleUse( id ) )
         {
-            MatchingRuleUse dITContentRule = bootstrap.lookup( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            MatchingRuleUse ruleUse = bootstrap.lookup( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up matchingRuleUse: " + ruleUse );
+            }
+            return ruleUse;
         }
 
-        NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
-        monitor.lookupFailed( id, e );
+        NamingException e = new NamingException( "matchingRuleUse w/ OID " + id + " not registered!" );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalMatchingRuleUseRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNameFormRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNameFormRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNameFormRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -23,9 +23,13 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.NameFormRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapNameFormRegistry;
 import org.apache.directory.shared.ldap.schema.NameForm;
 import org.apache.directory.shared.ldap.util.JoinIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,14 +40,14 @@
  */
 public class GlobalNameFormRegistry implements NameFormRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalNameFormRegistry.class );
     /** maps an OID to an NameForm */
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
-    /** monitor notified via callback events */
-    private NameFormRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapNameFormRegistry bootstrap;
 
@@ -60,8 +64,6 @@
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
         this.oidRegistry = oidRegistry;
-        this.monitor = new NameFormRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -70,35 +72,27 @@
     }
 
 
-    /**
-     * Sets the monitor that is to be notified via callback events.
-     *
-     * @param monitor the new monitor to notify of notable events
-     */
-    public void setMonitor( NameFormRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, NameForm dITContentRule ) throws NamingException
+    
+    public void register( String schema, NameForm nameForm ) throws NamingException
     {
-        if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasNameForm( dITContentRule.getOid() ) )
+        if ( byOid.containsKey( nameForm.getOid() ) || bootstrap.hasNameForm( nameForm.getOid() ) )
         {
-            NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+            NamingException e = new NamingException( "nameForm w/ OID " + nameForm.getOid()
                 + " has already been registered!" );
-            monitor.registerFailed( dITContentRule, e );
             throw e;
         }
 
-        oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
-        byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
-        monitor.registered( dITContentRule );
+        oidRegistry.register( nameForm.getName(), nameForm.getOid() );
+        byOid.put( nameForm.getOid(), nameForm );
+        oidToSchema.put( nameForm.getOid(), schema );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered nameForm: " + nameForm );
+        }
     }
 
 
@@ -108,20 +102,25 @@
 
         if ( byOid.containsKey( id ) )
         {
-            NameForm dITContentRule = ( NameForm ) byOid.get( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            NameForm nf = ( NameForm ) byOid.get( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up nameForm: " + nf );
+            }
+            return nf;
         }
 
         if ( bootstrap.hasNameForm( id ) )
         {
-            NameForm dITContentRule = bootstrap.lookup( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            NameForm nf = bootstrap.lookup( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up nameForm: " + nf );
+            }
+            return nf;
         }
 
-        NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
-        monitor.lookupFailed( id, e );
+        NamingException e = new NamingException( "nameForm w/ OID " + id + " not registered!" );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNameFormRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNormalizerRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNormalizerRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalNormalizerRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -22,8 +22,11 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.NormalizerRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapNormalizerRegistry;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,12 +37,12 @@
  */
 public class GlobalNormalizerRegistry implements NormalizerRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalNormalizerRegistry.class );
     /** the normalizers in this registry */
     private final Map normalizers;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
-    /** the monitor for delivering callback events */
-    private NormalizerRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapNormalizerRegistry bootstrap;
 
@@ -56,8 +59,6 @@
     {
         this.oidToSchema = new HashMap();
         this.normalizers = new HashMap();
-        this.monitor = new NormalizerRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -66,17 +67,6 @@
     }
 
 
-    /**
-     * Sets the monitor used by this registry.
-     *
-     * @param monitor the monitor to set for registry event callbacks
-     */
-    public void setMonitor( NormalizerRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
@@ -86,37 +76,44 @@
         if ( normalizers.containsKey( oid ) || bootstrap.hasNormalizer( oid ) )
         {
             NamingException e = new NamingException( "Normalizer with OID " + oid + " already registered!" );
-            monitor.registerFailed( oid, normalizer, e );
             throw e;
         }
 
         oidToSchema.put( oid, schema );
         normalizers.put( oid, normalizer );
-        monitor.registered( oid, normalizer );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered normalizer for OID: " + oid );
+        }
     }
 
 
     public Normalizer lookup( String oid ) throws NamingException
     {
-        Normalizer c;
+        Normalizer n;
         NamingException e;
 
         if ( normalizers.containsKey( oid ) )
         {
-            c = ( Normalizer ) normalizers.get( oid );
-            monitor.lookedUp( oid, c );
-            return c;
+            n = ( Normalizer ) normalizers.get( oid );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up normalizer for OID: " + oid );
+            }
+            return n;
         }
 
         if ( bootstrap.hasNormalizer( oid ) )
         {
-            c = bootstrap.lookup( oid );
-            monitor.lookedUp( oid, c );
-            return c;
+            n = bootstrap.lookup( oid );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up normalizer for OID: " + oid );
+            }
+            return n;
         }
 
         e = new NamingException( "Normalizer not found for OID: " + oid );
-        monitor.lookupFailed( oid, e );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalNormalizerRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalObjectClassRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalObjectClassRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalObjectClassRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -23,9 +23,13 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.ObjectClassRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.util.JoinIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,14 +40,14 @@
  */
 public class GlobalObjectClassRegistry implements ObjectClassRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalObjectClassRegistry.class );
     /** maps an OID to an ObjectClass */
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
-    /** monitor notified via callback events */
-    private ObjectClassRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapObjectClassRegistry bootstrap;
 
@@ -60,8 +64,6 @@
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
         this.oidRegistry = oidRegistry;
-        this.monitor = new ObjectClassRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -70,58 +72,54 @@
     }
 
 
-    /**
-     * Sets the monitor that is to be notified via callback events.
-     *
-     * @param monitor the new monitor to notify of notable events
-     */
-    public void setMonitor( ObjectClassRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, ObjectClass dITContentRule ) throws NamingException
+    
+    public void register( String schema, ObjectClass objectClass ) throws NamingException
     {
-        if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasObjectClass( dITContentRule.getOid() ) )
+        if ( byOid.containsKey( objectClass.getOid() ) || bootstrap.hasObjectClass( objectClass.getOid() ) )
         {
-            NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+            NamingException e = new NamingException( "dITContentRule w/ OID " + objectClass.getOid()
                 + " has already been registered!" );
-            monitor.registerFailed( dITContentRule, e );
             throw e;
         }
 
-        oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
-        byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
-        monitor.registered( dITContentRule );
+        oidRegistry.register( objectClass.getName(), objectClass.getOid() );
+        byOid.put( objectClass.getOid(), objectClass );
+        oidToSchema.put( objectClass.getOid(), schema );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered objectClass: " + objectClass );
+        }
     }
 
 
     public ObjectClass lookup( String id ) throws NamingException
     {
         id = oidRegistry.getOid( id );
-
         if ( byOid.containsKey( id ) )
         {
-            ObjectClass dITContentRule = ( ObjectClass ) byOid.get( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            ObjectClass oc = ( ObjectClass ) byOid.get( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up objectClass: " + oc );
+            }
+            return oc;
         }
 
         if ( bootstrap.hasObjectClass( id ) )
         {
-            ObjectClass dITContentRule = bootstrap.lookup( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            ObjectClass oc = bootstrap.lookup( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up objectClass: " + oc );
+            }
+            return oc;
         }
 
         NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
-        monitor.lookupFailed( id, e );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalObjectClassRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.ArrayList;
@@ -26,7 +26,10 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapOidRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,15 +41,12 @@
  */
 public class GlobalOidRegistry implements OidRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalOidRegistry.class );
     /** Maps OID to a name or a list of names if more than one name exists */
     private Hashtable byOid = new Hashtable();
-
     /** Maps several names to an OID */
     private Hashtable byName = new Hashtable();
-
-    /** Default OidRegistryMonitor */
-    private OidRegistryMonitor monitor = new OidRegistryMonitorAdapter();
-
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapOidRegistry bootstrap;
 
@@ -58,7 +58,7 @@
     /**
      * Creates a default OidRegistry by initializing the map and the montior.
      */
-    public GlobalOidRegistry(BootstrapOidRegistry bootstrap)
+    public GlobalOidRegistry( BootstrapOidRegistry bootstrap )
     {
         this.bootstrap = bootstrap;
 
@@ -69,32 +69,11 @@
     }
 
 
-    /**
-     * Gets the monitor.
-     *
-     * @return the monitor
-     */
-    OidRegistryMonitor getMonitor()
-    {
-        return monitor;
-    }
-
-
-    /**
-     * Sets the monitor.
-     *
-     * @param monitor monitor to set.
-     */
-    void setMonitor( OidRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
+    
     /**
      * @see OidRegistry#getOid(String)
      */
@@ -111,7 +90,6 @@
          */
         if ( Character.isDigit( name.charAt( 0 ) ) )
         {
-            monitor.getOidWithOid( name );
             return name;
         }
 
@@ -120,14 +98,20 @@
         if ( byName.containsKey( name ) )
         {
             String oid = ( String ) byName.get( name );
-            monitor.oidResolved( name, oid );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "resolved name '" + name + "' to OID '" + oid + "'" );
+            }
             return oid;
         }
 
         if ( bootstrap.hasOid( name ) )
         {
             String oid = bootstrap.getOid( name );
-            monitor.oidResolved( name, oid );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "resolved name '" + name + "' to OID '" + oid + "'" );
+            }
             return oid;
         }
 
@@ -144,7 +128,10 @@
             if ( byName.containsKey( lowerCase ) )
             {
                 String oid = ( String ) byName.get( lowerCase );
-                monitor.oidResolved( name, lowerCase, oid );
+                if ( log.isDebugEnabled() )
+                {
+                    log.debug( "resolved name '" + name + "' to OID '" + oid + "'" );
+                }
 
                 // We expect to see this version of the key again so we add it
                 byName.put( name, oid );
@@ -160,7 +147,10 @@
             if ( bootstrap.hasOid( lowerCase ) )
             {
                 String oid = bootstrap.getOid( name );
-                monitor.oidResolved( name, oid );
+                if ( log.isDebugEnabled() )
+                {
+                    log.debug( "resolved name '" + name + "' to OID '" + oid + "'" );
+                }
 
                 // We expect to see this version of the key again so we add it
                 byName.put( name, oid );
@@ -170,7 +160,6 @@
 
         String msg = "OID for name '" + name + "' was not " + "found within the OID registry";
         NamingException fault = new NamingException( msg );
-        monitor.oidResolutionFailed( name, fault );
         throw fault;
     }
 
@@ -205,7 +194,10 @@
             if ( byName.containsKey( lowerCase ) )
             {
                 String oid = ( String ) byName.get( lowerCase );
-                monitor.oidResolved( name, lowerCase, oid );
+                if ( log.isDebugEnabled() )
+                {
+                    log.debug( "resolved name '" + name + "' to OID '" + oid + "'" );
+                }
 
                 // We expect to see this version of the key again so we add it
                 byName.put( name, oid );
@@ -233,29 +225,27 @@
     public String getPrimaryName( String oid ) throws NamingException
     {
         Object value = byOid.get( oid );
-
         if ( null == value )
         {
             String msg = "OID '" + oid + "' was not found within the OID registry";
-
             NamingException fault = new NamingException( msg );
-
-            monitor.oidDoesNotExist( oid, fault );
-
             throw fault;
         }
 
         if ( value instanceof String )
         {
-            monitor.nameResolved( oid, ( String ) value );
-
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "returning primary name '" + value + "' for OID '" + oid + "'" );
+            }
             return ( String ) value;
         }
 
         String name = ( String ) ( ( List ) value ).get( 0 );
-
-        monitor.nameResolved( oid, name );
-
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "returning primary name '" + name + "' for OID '" + oid + "'" );
+        }
         return name;
     }
 
@@ -266,7 +256,6 @@
     public List getNameSet( String oid ) throws NamingException
     {
         Object value = this.byOid.get( oid );
-
         if ( null == value )
         {
             value = this.bootstrap.getNameSet( oid );
@@ -275,25 +264,24 @@
         if ( null == value )
         {
             String msg = "OID '" + oid + "' was not found within the OID registry";
-
             NamingException fault = new NamingException( msg );
-
-            monitor.oidDoesNotExist( oid, fault );
-
             throw fault;
         }
 
         if ( value instanceof String )
         {
             List list = Collections.singletonList( value );
-
-            monitor.namesResolved( oid, list );
-
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "returning names '" + list + "' for OID '" + oid + "'" );
+            }
             return list;
         }
 
-        monitor.namesResolved( oid, ( List ) value );
-
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "returning names '" + value + "' for OID '" + oid + "'" );
+        }
         return ( List ) value;
     }
 
@@ -322,7 +310,6 @@
          * the lower cased name is different from the given name name.  
          */
         String lowerCase = name.toLowerCase();
-
         if ( !lowerCase.equals( name ) )
         {
             byName.put( lowerCase, oid );
@@ -330,7 +317,6 @@
 
         // Put both the name and the oid as names
         byName.put( name, oid );
-
         byName.put( oid, oid );
 
         /*
@@ -352,13 +338,10 @@
         else
         {
             ArrayList list = null;
-
             value = byOid.get( oid );
-
             if ( value instanceof String )
             {
                 String existingName = ( String ) value;
-
                 // if the existing name is already there we don't readd it
                 if ( existingName.equalsIgnoreCase( name ) )
                 {
@@ -366,16 +349,13 @@
                 }
 
                 list = new ArrayList();
-
                 list.add( value );
                 list.add( name );
-
                 value = list;
             }
             else if ( value instanceof ArrayList )
             {
                 list = ( ArrayList ) value;
-
                 for ( int ii = 0; ii < list.size(); ii++ )
                 {
                     // One form or another of the name already exists in list
@@ -384,14 +364,15 @@
                         return;
                     }
                 }
-
                 list.add( name );
             }
         }
 
         byOid.put( oid, value );
-
-        monitor.registered( name, oid );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered name '" + name + "' for OID '" + oid + "'" );
+        }
     }
 
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalOidRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.ArrayList;
@@ -23,6 +23,19 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.core.schema.ComparatorRegistry;
+import org.apache.directory.server.core.schema.DITContentRuleRegistry;
+import org.apache.directory.server.core.schema.DITStructureRuleRegistry;
+import org.apache.directory.server.core.schema.MatchingRuleRegistry;
+import org.apache.directory.server.core.schema.MatchingRuleUseRegistry;
+import org.apache.directory.server.core.schema.NameFormRegistry;
+import org.apache.directory.server.core.schema.NormalizerRegistry;
+import org.apache.directory.server.core.schema.ObjectClassRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.core.schema.Registries;
+import org.apache.directory.server.core.schema.SyntaxCheckerRegistry;
+import org.apache.directory.server.core.schema.SyntaxRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapComparatorRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapDitContentRuleRegistry;

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalRegistries.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -22,8 +22,11 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.SyntaxCheckerRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapSyntaxCheckerRegistry;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,12 +37,12 @@
  */
 public class GlobalSyntaxCheckerRegistry implements SyntaxCheckerRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalSyntaxCheckerRegistry.class );
     /** the syntaxCheckers in this registry */
     private final Map syntaxCheckers;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
-    /** the monitor for delivering callback events */
-    private SyntaxCheckerRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapSyntaxCheckerRegistry bootstrap;
 
@@ -48,6 +51,7 @@
     // C O N S T R U C T O R S
     // ------------------------------------------------------------------------
 
+    
     /**
      * Creates a default SyntaxCheckerRegistry by initializing the map and the
      * montior.
@@ -56,8 +60,6 @@
     {
         this.oidToSchema = new HashMap();
         this.syntaxCheckers = new HashMap();
-        this.monitor = new SyntaxCheckerRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -65,34 +67,30 @@
         }
     }
 
-
-    /**
-     * Sets the monitor used by this registry.
-     *
-     * @param monitor the monitor to set for registry event callbacks
-     */
-    public void setMonitor( SyntaxCheckerRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
+    
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
+    
+    /*
+     * TODO: why supply the oid here if SyntaxCheckers contain the oid value of their 
+     * syntax as a property?
+     */
     public void register( String schema, String oid, SyntaxChecker syntaxChecker ) throws NamingException
     {
         if ( syntaxCheckers.containsKey( oid ) || bootstrap.hasSyntaxChecker( oid ) )
         {
             NamingException e = new NamingException( "SyntaxChecker with OID " + oid + " already registered!" );
-            monitor.registerFailed( oid, syntaxChecker, e );
             throw e;
         }
 
         oidToSchema.put( oid, schema );
         syntaxCheckers.put( oid, syntaxChecker );
-        monitor.registered( oid, syntaxChecker );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered syntax checker for syntax: " + oid );
+        }
     }
 
 
@@ -104,19 +102,24 @@
         if ( syntaxCheckers.containsKey( oid ) )
         {
             c = ( SyntaxChecker ) syntaxCheckers.get( oid );
-            monitor.lookedUp( oid, c );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "lookup succeeded for syntax checker of syntax: " + oid );
+            }
             return c;
         }
 
         if ( bootstrap.hasSyntaxChecker( oid ) )
         {
             c = bootstrap.lookup( oid );
-            monitor.lookedUp( oid, c );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "lookup succeeded for syntax checker of syntax: " + oid );
+            }
             return c;
         }
 
         e = new NamingException( "SyntaxChecker not found for OID: " + oid );
-        monitor.lookupFailed( oid, e );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxCheckerRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Copied: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java (from r384102, directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java)
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java?p2=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java&p1=directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java&r1=384102&r2=384335&rev=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java Wed Mar  8 13:29:28 2006
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.directory.server.core.schema;
+package org.apache.directory.server.core.schema.global;
 
 
 import java.util.HashMap;
@@ -23,9 +23,13 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.core.schema.OidRegistry;
+import org.apache.directory.server.core.schema.SyntaxRegistry;
 import org.apache.directory.server.core.schema.bootstrap.BootstrapSyntaxRegistry;
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.util.JoinIterator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -36,14 +40,14 @@
  */
 public class GlobalSyntaxRegistry implements SyntaxRegistry
 {
+    /** static class logger */
+    private final static Logger log = LoggerFactory.getLogger( GlobalSyntaxRegistry.class );
     /** maps an OID to an Syntax */
     private final Map byOid;
     /** maps an OID to a schema name*/
     private final Map oidToSchema;
     /** the registry used to resolve names to OIDs */
     private final OidRegistry oidRegistry;
-    /** monitor notified via callback events */
-    private SyntaxRegistryMonitor monitor;
     /** the underlying bootstrap registry to delegate on misses to */
     private BootstrapSyntaxRegistry bootstrap;
 
@@ -60,8 +64,6 @@
         this.byOid = new HashMap();
         this.oidToSchema = new HashMap();
         this.oidRegistry = oidRegistry;
-        this.monitor = new SyntaxRegistryMonitorAdapter();
-
         this.bootstrap = bootstrap;
         if ( this.bootstrap == null )
         {
@@ -70,35 +72,27 @@
     }
 
 
-    /**
-     * Sets the monitor that is to be notified via callback events.
-     *
-     * @param monitor the new monitor to notify of notable events
-     */
-    public void setMonitor( SyntaxRegistryMonitor monitor )
-    {
-        this.monitor = monitor;
-    }
-
-
     // ------------------------------------------------------------------------
     // Service Methods
     // ------------------------------------------------------------------------
 
-    public void register( String schema, Syntax dITContentRule ) throws NamingException
+    public void register( String schema, Syntax syntax ) throws NamingException
     {
-        if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasSyntax( dITContentRule.getOid() ) )
+        if ( byOid.containsKey( syntax.getOid() ) || bootstrap.hasSyntax( syntax.getOid() ) )
         {
-            NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+            NamingException e = new NamingException( "Sytax w/ OID " + syntax.getOid() 
                 + " has already been registered!" );
-            monitor.registerFailed( dITContentRule, e );
             throw e;
         }
 
-        oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
-        byOid.put( dITContentRule.getOid(), dITContentRule );
-        oidToSchema.put( dITContentRule.getOid(), schema );
-        monitor.registered( dITContentRule );
+        oidRegistry.register( syntax.getName(), syntax.getOid() );
+        byOid.put( syntax.getOid(), syntax );
+        oidToSchema.put( syntax.getOid(), schema );
+        
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "registered syntax: " + syntax );
+        }
     }
 
 
@@ -108,20 +102,25 @@
 
         if ( byOid.containsKey( id ) )
         {
-            Syntax dITContentRule = ( Syntax ) byOid.get( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            Syntax syntax = ( Syntax ) byOid.get( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up syntax: " + syntax );
+            }
+            return syntax;
         }
 
         if ( bootstrap.hasSyntax( id ) )
         {
-            Syntax dITContentRule = bootstrap.lookup( id );
-            monitor.lookedUp( dITContentRule );
-            return dITContentRule;
+            Syntax syntax = bootstrap.lookup( id );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "looked up syntax: " + syntax );
+            }
+            return syntax;
         }
 
         NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
-        monitor.lookupFailed( id, e );
         throw e;
     }
 

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/global/GlobalSyntaxRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Mar  8 13:29:28 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?rev=384335&r1=384334&r2=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Wed Mar  8 13:29:28 2006
@@ -23,10 +23,10 @@
 import javax.naming.Name;
 import javax.naming.NamingException;
 
-import org.apache.directory.server.core.schema.GlobalRegistries;
 import org.apache.directory.server.core.schema.ObjectClassRegistry;
 import org.apache.directory.server.core.schema.SchemaChecker;
 import org.apache.directory.server.core.schema.bootstrap.*;
+import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapName;

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?rev=384335&r1=384334&r2=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Wed Mar  8 13:29:28 2006
@@ -22,9 +22,9 @@
 import javax.naming.NamingException;
 import javax.naming.directory.BasicAttribute;
 
-import org.apache.directory.server.core.schema.GlobalRegistries;
 import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.*;
+import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
 import org.apache.directory.shared.ldap.filter.BranchNode;

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?rev=384335&r1=384334&r2=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Wed Mar  8 13:29:28 2006
@@ -22,9 +22,9 @@
 import javax.naming.NamingException;
 import javax.naming.directory.BasicAttribute;
 
-import org.apache.directory.server.core.schema.GlobalRegistries;
 import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.*;
+import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;

Modified: directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=384335&r1=384334&r2=384335&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java (original)
+++ directory/trunks/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java Wed Mar  8 13:29:28 2006
@@ -19,9 +19,9 @@
 
 import junit.framework.TestCase;
 
-import org.apache.directory.server.core.schema.GlobalRegistries;
 import org.apache.directory.server.core.schema.OidRegistry;
 import org.apache.directory.server.core.schema.bootstrap.*;
+import org.apache.directory.server.core.schema.global.GlobalRegistries;
 import org.apache.directory.server.core.subtree.SubtreeEvaluator;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;