directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1080405 - in /directory/shared/branches/akarasulu/ldap: model/src/main/java/org/apache/directory/shared/ldap/model/schema/ model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/ model/src/main/java/org/apache/directory/...
Date Fri, 11 Mar 2011 00:27:52 GMT
Author: akarasulu
Date: Fri Mar 11 00:27:51 2011
New Revision: 1080405

URL: http://svn.apache.org/viewvc?rev=1080405&view=rev
Log:
extracted mutable and immutable interfaces for LoadableSchemaObject

Added:
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
      - copied, changed from r1080387, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
Removed:
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaDao.java
Modified:
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapComparator.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/Normalizer.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaObject.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaUtils.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SyntaxChecker.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapComparatorDescription.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/NormalizerDescription.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/SyntaxCheckerDescription.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
    directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DescriptionUtils.java
Fri Mar 11 00:27:51 2011
@@ -910,7 +910,7 @@ public final class DescriptionUtils
     /**
      * Generate the description for Comparators, Normalizers and SyntaxCheckers.
      */
-    private static String getLoadableDescription( LoadableSchemaObject schemaObject )
+    private static String getLoadableDescription( MutableLoadableSchemaObjectImpl schemaObject
)
     {
         StringBuilder buf = new StringBuilder( "( " );
         buf.append( schemaObject.getOid() );

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapComparator.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapComparator.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapComparator.java
Fri Mar 11 00:27:51 2011
@@ -30,7 +30,7 @@ import java.util.Comparator;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class LdapComparator<T> extends LoadableSchemaObject implements Comparator<T>,
Serializable
+public abstract class LdapComparator<T> extends MutableLoadableSchemaObjectImpl implements
Comparator<T>, Serializable
 {
     /** The serial version UID */
     private static final long serialVersionUID = 2L;

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
Fri Mar 11 00:27:51 2011
@@ -20,164 +20,27 @@
 package org.apache.directory.shared.ldap.model.schema;
 
 
-import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.schema.registries.Registries;
-import org.apache.directory.shared.util.Strings;
-
-
 /**
- * An abstract class used to manage the ADS specific SchemaObject, which can
- * contain some compiled Java class to implement the specific logic.
- * 
+ * An immutable interface for SchemaObjects that are class loaded.
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class LoadableSchemaObject extends AbstractMutableSchemaObject
+public interface LoadableSchemaObject extends SchemaObject
 {
-    private static final long serialVersionUID = 8370373510870284033L;
-
-    /** The Full Qualified Class Name */
-    private String fqcn;
-
-    /** The base64 encoded bytecode for this schema */
-    private String bytecode;
-
-
-    /**
-     * Constructor to use when the OID is known in advance.
-     * 
-     * @param objectType The SchemaObject type
-     * @param oid The SchemaObject OID
-     */
-    protected LoadableSchemaObject( SchemaObjectType objectType, String oid )
-    {
-        super( objectType, oid );
-
-        fqcn = "";
-        bytecode = null;
-    }
-
-
-    /**
-     * Constructor to use when the OID is not known until after instantiation.
-     * 
-     * @param objectType The SchemaObject type
-     */
-    protected LoadableSchemaObject( SchemaObjectType objectType )
-    {
-        super( objectType );
-
-        fqcn = "";
-        bytecode = null;
-    }
-
-
-    /**
-     * @return The associated bytecode of this SchemaObject instance
-     */
-    public String getBytecode()
-    {
-        return bytecode;
-    }
-
-
     /**
-     * Stores some bytecode representing the compiled Java class for this
-     * SchemaObject instance.
+     * Gets the base64 encoded bytecode associated with this 
+     * LoadableSchemaObject.
      * 
-     * @param bytecode The bytecode to store
+     * @return The based64 encoded bytecode of this LoadableSchemaObject 
+     * instance
      */
-    public void setBytecode( String bytecode )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName()
) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.bytecode = bytecode;
-        }
-    }
+    String getBytecode();
 
 
     /**
      * @return The chemaObject instance Fully Qualified Class Name
      */
-    public String getFqcn()
-    {
-        return fqcn;
-    }
-
-
-    /**
-     * Set the Fully Qualified Class Name for this SchemaObject instance
-     * class stored in the bytecode attribute
-     * @param fqcn The Fully Qualified Class Name
-     */
-    public void setFqcn( String fqcn )
-    {
-        if ( locked )
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName()
) );
-        }
-
-        if ( !isReadOnly )
-        {
-            this.fqcn = fqcn;
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void registerOid( MutableSchemaObject schemaObject, Registries registries ) throws
LdapException
-    {
-        // Do nothing : the current SchemaObject ha sthe same OID than the one it is realted
to
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public LoadableSchemaObject copy()
-    {
-        return null;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( !super.equals( o ) )
-        {
-            return false;
-        }
-
-        if ( !( o instanceof LoadableSchemaObject ) )
-        {
-            return false;
-        }
-
-        LoadableSchemaObject that = ( LoadableSchemaObject ) o;
-
-        // Check the byteCode
-        // TODO
-
-        // Check the FQCN
-        if ( fqcn == null )
-        {
-            return that.fqcn == null;
-        }
-        else
-        {
-            return fqcn.equals( that.fqcn );
-        }
-    }
+    String getFqcn();
 
 
     /**
@@ -186,18 +49,5 @@ public abstract class LoadableSchemaObje
      *
      * @return true if the FQCN is correctly set
      */
-    public boolean isValid()
-    {
-        String className = this.getClass().getName();
-
-        if ( Strings.isEmpty(fqcn) )
-        {
-            fqcn = className;
-            return true;
-        }
-        else
-        {
-            return className.equals( fqcn );
-        }
-    }
-}
+    boolean isValid();
+}
\ No newline at end of file

Added: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java?rev=1080405&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
(added)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
Fri Mar 11 00:27:51 2011
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.model.schema;
+
+
+/**
+ * A mutable version of the LoadableSchemaObject.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface MutableLoadableSchemaObject extends LoadableSchemaObject
+{
+    /**
+     * Stores some bytecode representing the compiled Java class for this
+     * SchemaObject instance.
+     * 
+     * @param bytecode The bytecode to store
+     */
+    void setBytecode( String bytecode );
+
+
+    /**
+     * Set the Fully Qualified Class Name for this SchemaObject instance
+     * class stored in the bytecode attribute
+     * @param fqcn The Fully Qualified Class Name
+     */
+    void setFqcn( String fqcn );
+}
\ No newline at end of file

Copied: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
(from r1080387, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java?p2=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java&p1=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java&r1=1080387&r2=1080405&rev=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
Fri Mar 11 00:27:51 2011
@@ -32,7 +32,7 @@ import org.apache.directory.shared.util.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class LoadableSchemaObject extends AbstractMutableSchemaObject
+public abstract class MutableLoadableSchemaObjectImpl extends AbstractMutableSchemaObject
implements LoadableSchemaObject, MutableLoadableSchemaObject
 {
     private static final long serialVersionUID = 8370373510870284033L;
 
@@ -49,7 +49,7 @@ public abstract class LoadableSchemaObje
      * @param objectType The SchemaObject type
      * @param oid The SchemaObject OID
      */
-    protected LoadableSchemaObject( SchemaObjectType objectType, String oid )
+    protected MutableLoadableSchemaObjectImpl( SchemaObjectType objectType, String oid )
     {
         super( objectType, oid );
 
@@ -63,7 +63,7 @@ public abstract class LoadableSchemaObje
      * 
      * @param objectType The SchemaObject type
      */
-    protected LoadableSchemaObject( SchemaObjectType objectType )
+    protected MutableLoadableSchemaObjectImpl( SchemaObjectType objectType )
     {
         super( objectType );
 
@@ -72,8 +72,8 @@ public abstract class LoadableSchemaObje
     }
 
 
-    /**
-     * @return The associated bytecode of this SchemaObject instance
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject#getBytecode()
      */
     public String getBytecode()
     {
@@ -81,11 +81,8 @@ public abstract class LoadableSchemaObje
     }
 
 
-    /**
-     * Stores some bytecode representing the compiled Java class for this
-     * SchemaObject instance.
-     * 
-     * @param bytecode The bytecode to store
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject#setBytecode(java.lang.String)
      */
     public void setBytecode( String bytecode )
     {
@@ -101,8 +98,8 @@ public abstract class LoadableSchemaObje
     }
 
 
-    /**
-     * @return The chemaObject instance Fully Qualified Class Name
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject#getFqcn()
      */
     public String getFqcn()
     {
@@ -110,10 +107,8 @@ public abstract class LoadableSchemaObje
     }
 
 
-    /**
-     * Set the Fully Qualified Class Name for this SchemaObject instance
-     * class stored in the bytecode attribute
-     * @param fqcn The Fully Qualified Class Name
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject#setFqcn(java.lang.String)
      */
     public void setFqcn( String fqcn )
     {
@@ -141,7 +136,7 @@ public abstract class LoadableSchemaObje
     /**
      * {@inheritDoc}
      */
-    public LoadableSchemaObject copy()
+    public MutableLoadableSchemaObjectImpl copy()
     {
         return null;
     }
@@ -158,12 +153,12 @@ public abstract class LoadableSchemaObje
             return false;
         }
 
-        if ( !( o instanceof LoadableSchemaObject ) )
+        if ( !( o instanceof MutableLoadableSchemaObjectImpl ) )
         {
             return false;
         }
 
-        LoadableSchemaObject that = ( LoadableSchemaObject ) o;
+        MutableLoadableSchemaObjectImpl that = ( MutableLoadableSchemaObjectImpl ) o;
 
         // Check the byteCode
         // TODO
@@ -180,11 +175,8 @@ public abstract class LoadableSchemaObje
     }
 
 
-    /**
-     * Test that the FQCN is equal to the instance's name. If the FQCN is
-     * empty, fill it with the instance's name
-     *
-     * @return true if the FQCN is correctly set
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject#isValid()
      */
     public boolean isValid()
     {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/Normalizer.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/Normalizer.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/Normalizer.java
Fri Mar 11 00:27:51 2011
@@ -31,7 +31,7 @@ import org.apache.directory.shared.ldap.
  */
 // super.hashCode is final
 @SuppressWarnings({ "PMD.OverrideBothEqualsAndHashcode", "serial" })
-public abstract class Normalizer extends LoadableSchemaObject
+public abstract class Normalizer extends MutableLoadableSchemaObjectImpl
 {
     /**
      * The Normalizer base constructor. We use it's MR OID to

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
Fri Mar 11 00:27:51 2011
@@ -75,8 +75,6 @@ import org.apache.directory.shared.ldap.
  * @see DescriptionUtils#getDescription(ObjectClass)
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class ObjectClass extends AbstractMutableSchemaObject
 {
     private static final long serialVersionUID = 1L;
@@ -908,6 +906,7 @@ public class ObjectClass extends Abstrac
 
     /**
      * Copy an ObjectClass
+     * @return 
      */
     public ObjectClass copy()
     {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaObject.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaObject.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaObject.java
Fri Mar 11 00:27:51 2011
@@ -37,7 +37,7 @@ public interface SchemaObject
      * @return an OID for this SchemaObject or its MatchingRule if this
      *         SchemaObject is a MatchingRuleUse object
      */
-    public abstract String getOid();
+    String getOid();
 
 
     /**
@@ -46,7 +46,7 @@ public interface SchemaObject
      * 
      * @return the names for this SchemaObject
      */
-    public abstract List<String> getNames();
+     List<String> getNames();
 
 
     /**
@@ -56,7 +56,7 @@ public interface SchemaObject
      * @return the first of the names for this SchemaObject or the oid
      * if one does not exist
      */
-    public abstract String getName();
+     String getName();
 
 
     /**
@@ -64,7 +64,7 @@ public interface SchemaObject
      * 
      * @return a short description about this SchemaObject
      */
-    public abstract String getDescription();
+     String getDescription();
 
 
     /**
@@ -72,7 +72,7 @@ public interface SchemaObject
      * 
      * @return the SchemaObject specification
      */
-    public abstract String getSpecification();
+     String getSpecification();
 
 
     /**
@@ -81,7 +81,7 @@ public interface SchemaObject
      * @return true if the SchemaObject is enabled, or if it depends on 
      * an enabled schema
      */
-    public abstract boolean isEnabled();
+     boolean isEnabled();
 
 
     /**
@@ -89,7 +89,7 @@ public interface SchemaObject
      *  
      * @return true if the SchemaObject is disabled
      */
-    public abstract boolean isDisabled();
+     boolean isDisabled();
 
 
     /**
@@ -97,7 +97,7 @@ public interface SchemaObject
      *  
      * @return true if the SchemaObject is not modifiable
      */
-    public abstract boolean isReadOnly();
+     boolean isReadOnly();
 
 
     /**
@@ -108,13 +108,13 @@ public interface SchemaObject
      * 
      * @return true if inactive, false if active
      */
-    public abstract boolean isObsolete();
+     boolean isObsolete();
 
 
     /**
      * @return The SchemaObject extensions, as a Map of [extension, values]
      */
-    public abstract Map<String, List<String>> getExtensions();
+     Map<String, List<String>> getExtensions();
 
 
     /**
@@ -122,7 +122,7 @@ public interface SchemaObject
      *
      * @return the name of the schema associated with this schemaObject
      */
-    public abstract String getSchemaName();
+     String getSchemaName();
 
 
     /**
@@ -141,7 +141,7 @@ public interface SchemaObject
      * 
      * @return the SchemaObject type
      */
-    public abstract SchemaObjectType getObjectType();
+     SchemaObjectType getObjectType();
 
 
     /**
@@ -149,5 +149,5 @@ public interface SchemaObject
      *
      * @return The copied SchemaObject
      */
-    <R extends SchemaObject> R copy();
+    SchemaObject copy();
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaUtils.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaUtils.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaUtils.java
Fri Mar 11 00:27:51 2011
@@ -973,7 +973,6 @@ public final class SchemaUtils
     /**
      * NOT FULLY IMPLEMENTED!
      */
-    @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public static StringBuffer render( DITStructureRule dsr )
     {
         StringBuffer buf = new StringBuffer();
@@ -1069,7 +1068,7 @@ public final class SchemaUtils
      * @param description The description to transform to a String
      * @return
      */
-    public static String render( LoadableSchemaObject description )
+    public static String render( MutableLoadableSchemaObjectImpl description )
     {
         StringBuffer buf = new StringBuffer();
         buf.append( "( " ).append( description.getOid() );

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SyntaxChecker.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SyntaxChecker.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SyntaxChecker.java
Fri Mar 11 00:27:51 2011
@@ -32,10 +32,11 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings({ "PMD.OverrideBothEqualsAndHashcode", "serial" })
-public abstract class SyntaxChecker extends LoadableSchemaObject
+public abstract class SyntaxChecker extends MutableLoadableSchemaObjectImpl
 {
+    private static final long serialVersionUID = -6028809434764891692L;
+
+
     /**
      * The SyntaxChecker base constructor
      * @param oid The associated OID

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapComparatorDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapComparatorDescription.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapComparatorDescription.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapComparatorDescription.java
Fri Mar 11 00:27:51 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.shared.ldap.model.schema.parsers;
 
 
-import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObjectImpl;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 
 
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapComparatorDescription extends LoadableSchemaObject
+public class LdapComparatorDescription extends MutableLoadableSchemaObjectImpl
 {
     private static final long serialVersionUID = 1L;
 

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/NormalizerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/NormalizerDescription.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/NormalizerDescription.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/NormalizerDescription.java
Fri Mar 11 00:27:51 2011
@@ -21,7 +21,7 @@
 package org.apache.directory.shared.ldap.model.schema.parsers;
 
 
-import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObjectImpl;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 
 
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NormalizerDescription extends LoadableSchemaObject
+public class NormalizerDescription extends MutableLoadableSchemaObjectImpl
 {
     private static final long serialVersionUID = 1L;
 

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/SyntaxCheckerDescription.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/SyntaxCheckerDescription.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/SyntaxCheckerDescription.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/SyntaxCheckerDescription.java
Fri Mar 11 00:27:51 2011
@@ -20,7 +20,7 @@
 package org.apache.directory.shared.ldap.model.schema.parsers;
 
 
-import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObjectImpl;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
 
 
@@ -29,7 +29,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyntaxCheckerDescription extends LoadableSchemaObject
+public class SyntaxCheckerDescription extends MutableLoadableSchemaObjectImpl
 {
     private static final long serialVersionUID = 1L;
 

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/DefaultSchemaObjectRegistry.java
Fri Mar 11 00:27:51 2011
@@ -29,7 +29,7 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapSchemaException;
 import org.apache.directory.shared.ldap.model.exception.LdapSchemaExceptionCodes;
-import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.MutableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.SchemaObject;
 import org.apache.directory.shared.ldap.model.schema.SchemaObjectType;
@@ -346,7 +346,7 @@ public abstract class DefaultSchemaObjec
             // Clone each SchemaObject
             T value = ( ( DefaultSchemaObjectRegistry<T> ) original ).byName.get( key
);
 
-            if ( value instanceof LoadableSchemaObject )
+            if ( value instanceof MutableLoadableSchemaObject )
             {
                 // Update the data structure. 
                 // Comparators, Normalizers and SyntaxCheckers aren't copied, 
@@ -466,7 +466,7 @@ public abstract class DefaultSchemaObjec
         for ( SchemaObject schemaObject : oidRegistry )
         {
             // Don't clear LoadableSchemaObject
-            if ( !( schemaObject instanceof LoadableSchemaObject ) )
+            if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
             {
                 if ( schemaObject instanceof MutableSchemaObject )
                 {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/registries/Registries.java
Fri Mar 11 00:27:51 2011
@@ -42,7 +42,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
-import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.model.schema.NameForm;
@@ -1544,7 +1544,7 @@ public class Registries implements Schem
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is not already registered
-        if ( schemaObject instanceof LoadableSchemaObject )
+        if ( schemaObject instanceof MutableLoadableSchemaObject )
         {
             // TODO : Check for existing Loadable SchemaObject
         }
@@ -1630,7 +1630,7 @@ public class Registries implements Schem
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is not already registered
-        if ( !( schemaObject instanceof LoadableSchemaObject ) && globalOidRegistry.contains(
schemaObject.getOid() ) )
+        if ( !( schemaObject instanceof MutableLoadableSchemaObject ) && globalOidRegistry.contains(
schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
             String msg = I18n.err( I18n.ERR_04301, schemaObject.getObjectType(), schemaObject.getOid()
);
@@ -1668,7 +1668,7 @@ public class Registries implements Schem
 
             // Update the global OidRegistry if the SchemaObject is not
             // an instance of LoadableSchemaObject
-            if ( !( schemaObject instanceof LoadableSchemaObject ) )
+            if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
             {
                 try
                 {
@@ -1699,7 +1699,7 @@ public class Registries implements Schem
         LOG.debug( "Unregistering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is already registered
-        if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.contains(
schemaObject.getOid() ) )
+        if ( !( schemaObject instanceof MutableLoadableSchemaObject ) && !globalOidRegistry.contains(
schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
             String msg = I18n.err( I18n.ERR_04302, schemaObject.getObjectType(), schemaObject.getOid()
);
@@ -1732,7 +1732,7 @@ public class Registries implements Schem
 
             // Update the global OidRegistry if the SchemaObject is not
             // an instance of LoadableSchemaObject
-            if ( !( schemaObject instanceof LoadableSchemaObject ) )
+            if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
             {
                 try
                 {
@@ -1764,7 +1764,7 @@ public class Registries implements Schem
         LOG.debug( "Unregistering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is present in the registries
-        if ( schemaObject instanceof LoadableSchemaObject )
+        if ( schemaObject instanceof MutableLoadableSchemaObject )
         {
             // TODO : check for an existing Loadable SchemaObject
         }
@@ -1856,7 +1856,7 @@ public class Registries implements Schem
 
                 // Update the global OidRegistry if the SchemaObject is not
                 // an instance of LoadableSchemaObject
-                if ( !( schemaObject instanceof LoadableSchemaObject ) )
+                if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
                 {
                     globalOidRegistry.unregister( schemaObject.getOid() );
                 }
@@ -2618,7 +2618,7 @@ public class Registries implements Schem
 
                 try
                 {
-                    if ( !( original instanceof LoadableSchemaObject ) )
+                    if ( !( original instanceof MutableLoadableSchemaObject ) )
                     {
                         MutableSchemaObject copy = clone.globalOidRegistry.getSchemaObject(
original.getOid() );
                         SchemaObjectWrapper newWrapper = new SchemaObjectWrapper( copy );

Modified: directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java?rev=1080405&r1=1080404&r2=1080405&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/akarasulu/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Fri Mar 11 00:27:51 2011
@@ -46,6 +46,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.LoadableSchemaObject;
+import org.apache.directory.shared.ldap.model.schema.MutableLoadableSchemaObject;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.Normalizer;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
@@ -1599,7 +1600,7 @@ public class DefaultSchemaManager implem
      */
     private boolean checkOidExist( SchemaObject schemaObject )
     {
-        if ( !( schemaObject instanceof LoadableSchemaObject ) )
+        if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
         {
             return registries.getGlobalOidRegistry().contains( schemaObject.getOid() );
         }
@@ -1628,7 +1629,7 @@ public class DefaultSchemaManager implem
      */
     private MutableSchemaObject getSchemaObject( MutableSchemaObject schemaObject ) throws
LdapException
     {
-        if ( schemaObject instanceof LoadableSchemaObject )
+        if ( schemaObject instanceof MutableLoadableSchemaObject )
         {
             return schemaObject;
         }
@@ -1666,7 +1667,7 @@ public class DefaultSchemaManager implem
     {
         MutableSchemaObject copy = null;
 
-        if ( !( schemaObject instanceof LoadableSchemaObject ) )
+        if ( !( schemaObject instanceof MutableLoadableSchemaObject ) )
         {
             copy = schemaObject.copy();
         }



Mime
View raw message