directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1087288 - in /directory: apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ shared/trunk/integ/src/test/java/org/apache/directory/...
Date Thu, 31 Mar 2011 13:05:29 GMT
Author: elecharny
Date: Thu Mar 31 13:05:28 2011
New Revision: 1087288

URL: http://svn.apache.org/viewvc?rev=1087288&view=rev
Log:
o Removed the setAttributeType() method, and renamed it to apply(AttributeType)

Modified:
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultModification.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
(original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
Thu Mar 31 13:05:28 2011
@@ -494,7 +494,7 @@ public class SchemaAwareEntryAttributeTe
         EntryAttribute attr2 = new DefaultEntryAttribute( atSN );
         assertNotSame( attr1.hashCode(), attr2.hashCode() );
 
-        attr2.setAttributeType( atDC );
+        attr2.apply( atDC );
         assertEquals( attr1.hashCode(), attr2.hashCode() );
 
         attr1.add( ( String ) null );
@@ -613,7 +613,7 @@ public class SchemaAwareEntryAttributeTe
 
         // test a SINGLE-VALUE attribute. CountryName is SINGLE-VALUE
         attr.clear();
-        attr.setAttributeType( atC );
+        attr.apply( atC );
         attr.add( "FR" );
         assertTrue( attr.isValid( atC.getEquality().getSyntax().getSyntaxChecker() ) );
         assertEquals( 0, attr.add( "US" ) );
@@ -1685,7 +1685,7 @@ public class SchemaAwareEntryAttributeTe
 
         try
         {
-            attr.setAttributeType( null );
+            attr.apply( null );
             fail();
         }
         catch ( IllegalArgumentException iae )
@@ -1693,7 +1693,7 @@ public class SchemaAwareEntryAttributeTe
             assertTrue( true );
         }
 
-        attr.setAttributeType( atSN );
+        attr.apply( atSN );
 
         assertTrue( attr.isInstanceOf( "Surname" ) );
         assertEquals( "2.5.4.4", attr.getId() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Thu Mar 31 13:05:28 2011
@@ -192,7 +192,7 @@ public class RelatedProtectedItemFilter 
                     {
                         attr = schemaManager.getAttributeTypeRegistry().lookup( entryAttribute.getId()
);
                         attrOid = attr.getOid();
-                        entryAttribute.setAttributeType( attr );
+                        entryAttribute.apply( attr );
                     }
                     
                     if ( oid.equals( attrOid ) && entryAttribute.contains( attrValue
) )

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
Thu Mar 31 13:05:28 2011
@@ -87,7 +87,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( cn );
 
         assertEquals( attribute1, attribute2 );
     }
@@ -110,7 +110,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( cn );
 
         assertEquals( attribute1, attribute2 );
         assertEquals( "CommonName", attribute2.getUpId() );
@@ -134,7 +134,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( cn );
 
         assertEquals( attribute1, attribute2 );
         assertEquals( "CN", attribute2.getUpId() );
@@ -158,7 +158,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( userCertificate );
 
         assertEquals( attribute1, attribute2 );
     }
@@ -181,7 +181,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( userCertificate );
 
         assertEquals( attribute1, attribute2 );
     }
@@ -204,7 +204,7 @@ public class SchemaAwareEntryAttributeSe
 
         EntryAttribute attribute2 = new DefaultEntryAttribute();
         attribute2.readExternal( in );
-        attribute2.apply( schemaManager );
+        attribute2.apply( userCertificate );
 
         assertEquals( attribute1, attribute2 );
         assertEquals( "UserCertificate", attribute2.getUpId() );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
Thu Mar 31 13:05:28 2011
@@ -1733,7 +1733,7 @@ public final class DefaultEntry implemen
                 if ( attribute.getAttributeType() == null )
                 {
                     AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry(
attribute.getId() );
-                    attribute.setAttributeType( attributeType );
+                    attribute.apply( attributeType );
                 }
 
                 EntryAttribute removed = this.attributes.put( attribute.getAttributeType().getOid(),
attribute );
@@ -2601,7 +2601,7 @@ public final class DefaultEntry implemen
                 try
                 {
                     AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry(
attribute.getId() );
-                    attribute.setAttributeType( attributeType );
+                    attribute.apply( attributeType );
 
                     attributes.put( attributeType.getOid(), attribute );
                 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntryAttribute.java
Thu Mar 31 13:05:28 2011
@@ -32,7 +32,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
-import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -161,7 +160,7 @@ public class DefaultEntryAttribute imple
         {
             try
             {
-                setAttributeType( attributeType );
+                apply( attributeType );
             }
             catch ( LdapInvalidAttributeValueException liave )
             {
@@ -197,7 +196,7 @@ public class DefaultEntryAttribute imple
 
         try
         { 
-            setAttributeType( attributeType );
+            apply( attributeType );
         }
         catch ( LdapInvalidAttributeValueException liave )
         {
@@ -274,7 +273,7 @@ public class DefaultEntryAttribute imple
             throw new IllegalArgumentException( message );
         }
 
-        setAttributeType( attributeType );
+        apply( attributeType );
         add( vals );
         setUpId( upId, attributeType );
     }
@@ -302,7 +301,7 @@ public class DefaultEntryAttribute imple
             throw new IllegalArgumentException( message );
         }
         
-        setAttributeType( attributeType );
+        apply( attributeType );
         setUpId( upId, attributeType );
         add( vals );
     }
@@ -386,7 +385,7 @@ public class DefaultEntryAttribute imple
             throw new IllegalArgumentException( I18n.err( I18n.ERR_04460_ATTRIBUTE_TYPE_NULL_NOT_ALLOWED
) );
         }
 
-        setAttributeType( attributeType );
+        apply( attributeType );
         add( vals );
         setUpId( upId, attributeType );
     }
@@ -1971,7 +1970,7 @@ public class DefaultEntryAttribute imple
      *
      * @param attributeType the attributeType associated with this entry attribute
      */
-    public void setAttributeType( AttributeType attributeType ) throws LdapInvalidAttributeValueException
+    public void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException
     {
         if ( attributeType == null )
         {
@@ -2305,23 +2304,4 @@ public class DefaultEntryAttribute imple
             }
         }
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void apply( SchemaManager schemaManager ) throws LdapInvalidAttributeValueException
-    {
-        AttributeType attributeType = null;
-        
-        if ( schemaManager != null )
-        {
-            if ( !Strings.isEmpty( id ) )
-            { 
-                attributeType = schemaManager.getAttributeType( id );
-            }
-            
-            this.setAttributeType( attributeType );
-        }
-    }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultModification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultModification.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultModification.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultModification.java
Thu Mar 31 13:05:28 2011
@@ -184,7 +184,7 @@ public class DefaultModification impleme
         
         if ( attribute != null )
         {
-            attribute.setAttributeType( attributeType );
+            attribute.apply( attributeType );
         }
     }
 

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java?rev=1087288&r1=1087287&r2=1087288&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntryAttribute.java
Thu Mar 31 13:05:28 2011
@@ -25,7 +25,6 @@ import java.util.Iterator;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
-import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.SyntaxChecker;
 
 
@@ -220,7 +219,7 @@ public interface EntryAttribute extends 
      *
      * @param attributeType the attributeType associated with this entry attribute
      */
-    void setAttributeType( AttributeType attributeType ) throws LdapInvalidAttributeValueException;
+    void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException;
 
     
     /**
@@ -444,10 +443,4 @@ public interface EntryAttribute extends 
      * @throws LdapException if there is a failure to check syntaxes of values
      */
     boolean isValid( SyntaxChecker checker) throws LdapException;
-    
-    
-    /**
-     * Apply the give SchemaManager to make this EntryAttribute Schema aware
-     */
-    void apply( SchemaManager schemaManager ) throws LdapInvalidAttributeValueException;
 }



Mime
View raw message