directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r937777 - in /directory: apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core/src/main/java/org/apache/directory/...
Date Sun, 25 Apr 2010 11:11:47 GMT
Author: elecharny
Date: Sun Apr 25 11:11:47 2010
New Revision: 937777

URL: http://svn.apache.org/viewvc?rev=937777&view=rev
Log:
Removed the useless toClientAttribute() method, we can use clone() instead

Modified:
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
    directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
(original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
Sun Apr 25 11:11:47 2010
@@ -413,7 +413,7 @@ public class ClonedServerEntry implement
         // Convert each attribute 
         for ( EntryAttribute clonedEntry:this )
         {
-            EntryAttribute clientAttribute = clonedEntry.toClientAttribute();
+            EntryAttribute clientAttribute = clonedEntry.clone();
             clientEntry.add( clientAttribute );
         }
         
@@ -775,7 +775,7 @@ public class ClonedServerEntry implement
             // Convert each attribute 
             for ( EntryAttribute serverAttribute:this )
             {
-                EntryAttribute clientAttribute = serverAttribute.toClientAttribute();
+                EntryAttribute clientAttribute = serverAttribute.clone();
                 clientEntry.add( clientAttribute );
             }
             

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultEntryAttributeTest.java
Sun Apr 25 11:11:47 2010
@@ -2005,7 +2005,7 @@ public class DefaultEntryAttributeTest
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN, "test", "test2" );
         
-        EntryAttribute clientAttribute = attribute.toClientAttribute();
+        EntryAttribute clientAttribute = attribute.clone();
         
         assertTrue( clientAttribute instanceof EntryAttribute );
         

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Sun Apr 25 11:11:47 2010
@@ -127,7 +127,7 @@ public class ChangeLogInterceptor extend
         
         for ( AttributeType attributeType:list )
         {
-            forward.addAttribute( addEntry.get( attributeType).toClientAttribute() );
+            forward.addAttribute( addEntry.get( attributeType).clone() );
         }
         
         LdifEntry reverse = LdifRevertor.reverseAdd( opContext.getDn() );
@@ -175,7 +175,7 @@ public class ChangeLogInterceptor extend
             AttributeType at = schemaService.getSchemaManager().getAttributeTypeRegistry().lookup(
attribute.getId() );
             if ( !at.isCollective() )
             {
-                reverseEntry.add( attribute.toClientAttribute() );
+                reverseEntry.add( attribute.clone() );
             }
         }
 
@@ -275,7 +275,7 @@ public class ChangeLogInterceptor extend
         
         for ( EntryAttribute attribute:serverEntry )
         {
-            clientEntry.add( attribute.toClientAttribute() );
+            clientEntry.add( attribute.clone() );
         }
 
         LdifEntry reverse = LdifRevertor.reverseModify( 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
Sun Apr 25 11:11:47 2010
@@ -117,7 +117,7 @@ public class JournalInterceptor extends 
             
             for ( AttributeType attributeType:list )
             {
-                ldif.addAttribute( addEntry.get( attributeType).toClientAttribute() );
+                ldif.addAttribute( addEntry.get( attributeType).clone() );
             }
             
             log( opRevision, ldif );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttribute.java
Sun Apr 25 11:11:47 2010
@@ -2162,37 +2162,6 @@ public class DefaultEntryAttribute imple
         return normId.equalsIgnoreCase( attributeType.getOid() );
     }
 
-    
-    /**
-     * Convert the ServerAttribute to a ClientAttribute
-     *
-     * @return An instance of ClientAttribute
-     */
-    public EntryAttribute toClientAttribute()
-    {
-        // Create the new EntryAttribute
-        EntryAttribute clientAttribute = new DefaultEntryAttribute( upId );
-        
-        // Copy the values
-        for ( Value<?> value:this )
-        {
-            Value<?> clientValue = null;
-            
-            if ( value instanceof StringValue )
-            {
-                clientValue = new StringValue( value.getString() );
-            }
-            else
-            {
-                clientValue = new BinaryValue( value.getBytes() );
-            }
-            
-            clientAttribute.add( clientValue );
-        }
-        
-        return clientAttribute;
-    }
-
 
     //-------------------------------------------------------------------------
     // Overloaded Object classes
@@ -2313,6 +2282,7 @@ public class DefaultEntryAttribute imple
         try
         {
             DefaultEntryAttribute attribute = (DefaultEntryAttribute)super.clone();
+            attribute.setUpId( upId );
             
             attribute.values = new LinkedHashSet<Value<?>>( values.size() );
             

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultServerEntry.java
Sun Apr 25 11:11:47 2010
@@ -2240,7 +2240,7 @@ public final class DefaultServerEntry ex
         // Convert each attribute 
         for ( EntryAttribute serverAttribute:this )
         {
-            EntryAttribute clientAttribute = serverAttribute.toClientAttribute();
+            EntryAttribute clientAttribute = serverAttribute.clone();
             clientEntry.add( clientAttribute );
         }
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=937777&r1=937776&r2=937777&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
Sun Apr 25 11:11:47 2010
@@ -22,7 +22,6 @@ import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.util.Iterator;
-import java.util.List;
 
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
@@ -567,12 +566,4 @@ public interface EntryAttribute extends 
      * @throws LdapException if there is a failure to check syntaxes of values
      */
     boolean isValid( SyntaxChecker checker) throws LdapException;
-    
-    
-    /**
-     * Convert the ServerAttribute to a ClientAttribute
-     *
-     * @return An instance of ClientAttribute
-     */
-    EntryAttribute toClientAttribute();
 }



Mime
View raw message