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 2004/10/15 10:03:00 UTC

svn commit: rev 54832 - incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema

Author: akarasulu
Date: Fri Oct 15 01:02:58 2004
New Revision: 54832

Modified:
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ComparatorRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultAttributeTypeRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultComparatorRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITContentRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITStructureRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleUseRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNameFormRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNormalizerRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultObjectClassRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxCheckerRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NormalizerRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ObjectClassRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxCheckerRegistry.java
   incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxRegistry.java
Log:
added additional schema name lookups for schema objects

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/AttributeTypeRegistry.java	Fri Oct 15 01:02:58 2004
@@ -51,6 +51,15 @@
     AttributeType lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if an AttributeType exists.
      * 
      * @param id the object identifier or name of the AttributeType

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ComparatorRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ComparatorRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ComparatorRegistry.java	Fri Oct 15 01:02:58 2004
@@ -31,6 +31,15 @@
 public interface ComparatorRegistry
 {
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param oid the object identifier
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist 
+     */
+    String getSchemaName( String oid ) throws NamingException;
+
+    /**
      * Registers a Comparator with this registry.
      * 
      * @param schema the name of the schema the comparator is associated with

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITContentRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -50,6 +50,15 @@
     DITContentRule lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if a DITContentRule exists.
      * 
      * @param id the object identifier or name of the DITContentRule

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DITStructureRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -51,6 +51,15 @@
     DITStructureRule lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if an dITStructureRule exists.
      * 
      * @param id the object identifier, or the name

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultAttributeTypeRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultAttributeTypeRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultAttributeTypeRegistry.java	Fri Oct 15 01:02:58 2004
@@ -131,4 +131,17 @@
 
         return false;
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultComparatorRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultComparatorRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultComparatorRegistry.java	Fri Oct 15 01:02:58 2004
@@ -108,4 +108,21 @@
     {
         return comparators.containsKey( oid );
     }
+
+
+    public String getSchemaName( String oid ) throws NamingException
+    {
+        if ( ! Character.isDigit( oid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "OID " + oid + " is not a numeric OID" );
+        }
+        
+        if ( oidToSchema.containsKey( oid ) )
+        {
+            return ( String ) oidToSchema.get( oid );
+        }
+
+        throw new NamingException( "OID " + oid + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITContentRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITContentRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITContentRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -126,4 +126,17 @@
 
         return false;
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITStructureRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITStructureRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultDITStructureRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -126,4 +126,17 @@
 
         return false;
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -128,6 +128,19 @@
     }
 
 
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
+
+
     // ------------------------------------------------------------------------
     // package friendly monitor methods
     // ------------------------------------------------------------------------

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleUseRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleUseRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultMatchingRuleUseRegistry.java	Fri Oct 15 01:02:58 2004
@@ -109,4 +109,16 @@
     {
         return byName.containsKey( name );
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        if ( nameToSchema.containsKey( id ) )
+        {
+            return ( String ) nameToSchema.get( id );
+        }
+
+        throw new NamingException( "Name " + id + " not found in name to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNameFormRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNameFormRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNameFormRegistry.java	Fri Oct 15 01:02:58 2004
@@ -126,4 +126,17 @@
 
         return false;
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNormalizerRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNormalizerRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultNormalizerRegistry.java	Fri Oct 15 01:02:58 2004
@@ -109,4 +109,21 @@
     {
         return byOid.containsKey( oid );
     }
+
+
+    public String getSchemaName( String oid ) throws NamingException
+    {
+        if ( Character.isDigit( oid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "Looks like the arg is not a numeric OID" );
+        }
+
+        if ( oidToSchema.containsKey( oid ) )
+        {
+            return ( String ) oidToSchema.get( oid );
+        }
+
+        throw new NamingException( "OID " + oid + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultObjectClassRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultObjectClassRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultObjectClassRegistry.java	Fri Oct 15 01:02:58 2004
@@ -126,4 +126,17 @@
 
         return false;
     }
+
+
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxCheckerRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxCheckerRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxCheckerRegistry.java	Fri Oct 15 01:02:58 2004
@@ -109,4 +109,21 @@
     {
         return byOid.containsKey( oid );
     }
+
+
+    public String getSchemaName( String oid ) throws NamingException
+    {
+        if ( Character.isDigit( oid.charAt( 0 ) ) )
+        {
+            throw new NamingException( "Looks like the arg is not a numeric OID" );
+        }
+
+        if ( oidToSchema.containsKey( oid ) )
+        {
+            return ( String ) oidToSchema.get( oid );
+        }
+
+        throw new NamingException( "OID " + oid + " not found in oid to " +
+            "schema name map!" );
+    }
 }

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/DefaultSyntaxRegistry.java	Fri Oct 15 01:02:58 2004
@@ -127,6 +127,19 @@
     }
 
 
+    public String getSchemaName( String id ) throws NamingException
+    {
+        id = oidRegistry.getOid( id );
+        if ( oidToSchema.containsKey( id ) )
+        {
+            return ( String ) oidToSchema.get( id );
+        }
+
+        throw new NamingException( "OID " + id + " not found in oid to " +
+            "schema name map!" );
+    }
+
+
     // ------------------------------------------------------------------------
     // package friendly monitor methods
     // ------------------------------------------------------------------------

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleRegistry.java	Fri Oct 15 01:02:58 2004
@@ -51,6 +51,15 @@
     MatchingRule lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if a MatchingRule exists.  Backing store failures simply 
      * return false.
      * 

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/MatchingRuleUseRegistry.java	Fri Oct 15 01:02:58 2004
@@ -50,6 +50,15 @@
     MatchingRuleUse lookup( String name ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param name the name String
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String name ) throws NamingException;
+
+    /**
      * Checks to see if an matchingRuleUse exists.
      * 
      * @param name the name of the matchingRuleUse

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NameFormRegistry.java	Fri Oct 15 01:02:58 2004
@@ -50,6 +50,15 @@
     NameForm lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if an nameForm exists.
      * 
      * @param id the object identifier or name

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NormalizerRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NormalizerRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/NormalizerRegistry.java	Fri Oct 15 01:02:58 2004
@@ -51,6 +51,15 @@
     Normalizer lookup( String oid ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param oid the object identifier
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String oid ) throws NamingException;
+
+    /**
      * Checks to see if a Normalizer exists.  Backing store failures simply 
      * return false.
      * 

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ObjectClassRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ObjectClassRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/ObjectClassRegistry.java	Fri Oct 15 01:02:58 2004
@@ -50,6 +50,15 @@
     ObjectClass lookup( String id ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if an objectClass exists.
      *
      * @param id the object identifier or name

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxCheckerRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxCheckerRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxCheckerRegistry.java	Fri Oct 15 01:02:58 2004
@@ -52,6 +52,15 @@
     SyntaxChecker lookup( String oid ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param oid the object identifier
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String oid ) throws NamingException;
+
+    /**
      * Checks to see if a SyntaxChecker exists.  Backing store failures simply 
      * return false.
      * 

Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxRegistry.java	(original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/SyntaxRegistry.java	Fri Oct 15 01:02:58 2004
@@ -51,6 +51,15 @@
     void register( String schema, Syntax syntax ) throws NamingException;
 
     /**
+     * Gets the name of the schema this schema object is associated with.
+     *
+     * @param id the object identifier or the name
+     * @return the schema name
+     * @throws NamingException if the schema object does not exist
+     */
+    String getSchemaName( String id ) throws NamingException;
+
+    /**
      * Checks to see if a Syntax exists.  Backing store failures simply return
      * false.
      *