You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/04/28 11:50:56 UTC

svn commit: r938840 - /directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java

Author: elecharny
Date: Wed Apr 28 09:50:55 2010
New Revision: 938840

URL: http://svn.apache.org/viewvc?rev=938840&view=rev
Log:
Removed the useless EmptyEntry inner class

Modified:
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.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=938840&r1=938839&r2=938840&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 Wed Apr 28 09:50:55 2010
@@ -23,16 +23,15 @@ package org.apache.directory.server.core
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -407,7 +406,7 @@ public class ClonedServerEntry implement
     public Entry toClientEntry() throws LdapException
     {
         // Copy the DN
-        Entry clientEntry = new DefaultClientEntry( clonedEntry.getDn() );
+        Entry clientEntry = new DefaultEntry( clonedEntry.getDn() );
         
         // Convert each attribute 
         for ( EntryAttribute clonedEntry:this )
@@ -482,312 +481,8 @@ public class ClonedServerEntry implement
     {
         return clonedEntry.toString();
     }
-    
-    
-    class EmptyEntry implements Entry
-    {
-        DN dn;
-        
-        EmptyEntry( DN dn )
-        {
-            this.dn = dn;
-        }
-        
-        public void add( AttributeType attributeType, byte[]... values ) throws LdapException
-        {
-        }
-
-        public void add( AttributeType attributeType, String... values ) throws LdapException
-        {
-        }
-
-        public void add( AttributeType attributeType, Value<?>... values ) throws LdapException
-        {
-        }
-
-        public void add( String upId, AttributeType attributeType, byte[]... values ) throws LdapException
-        {
-        }
-
-        public void add( String upId, AttributeType attributeType, String... values ) throws LdapException
-        {
-        }
-
-        public void add( String upId, AttributeType attributeType, Value<?>... values ) throws LdapException
-        {
-        }
-
-        public boolean contains( AttributeType attributeType, byte[]... values )
-        {
-            return false;
-        }
-
-        public boolean contains( AttributeType attributeType, String... values )
-        {
-            return false;
-        }
-
-        public boolean contains( AttributeType attributeType, Value<?>... values )
-        {
-            return false;
-        }
-
-        public boolean containsAttribute( AttributeType attributeType )
-        {
-            return false;
-        }
-
-        public EntryAttribute get( AttributeType attributeType )
-        {
-            return null;
-        }
-
-        public Set<AttributeType> getAttributeTypes()
-        {
-            return null;
-        }
-
-        public boolean hasObjectClass( EntryAttribute objectClass )
-        {
-            return false;
-        }
-
-        public boolean isValid()
-        {
-            return false;
-        }
-
-        public boolean isValid( String objectClass )
-        {
-            return false;
-        }
-
-        public boolean isValid( EntryAttribute objectClass )
-        {
-            return false;
-        }
-
-        public EntryAttribute put( AttributeType attributeType, byte[]... values ) throws LdapException
-        {
-            return null;
-        }
-
-        public EntryAttribute put( AttributeType attributeType, String... values ) throws LdapException
-        {
-            return null;
-        }
-
-        public EntryAttribute put( AttributeType attributeType, Value<?>... values ) throws LdapException
-        {
-            return null;
-        }
-
-        public EntryAttribute put( String upId, AttributeType attributeType, byte[]... values ) throws LdapException
-        {
-            return null;
-        }
-
-        public EntryAttribute put( String upId, AttributeType attributeType, String... values ) throws LdapException
-        {
-            return null;
-        }
-
-        public EntryAttribute put( String upId, AttributeType attributeType, Value<?>... values )
-            throws LdapException
-        {
-            return null;
-        }
-
-        public boolean remove( AttributeType attributeType, byte[]... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public boolean remove( AttributeType attributeType, String... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public boolean remove( AttributeType attributeType, Value<?>... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public List<EntryAttribute> remove( EntryAttribute... attributes ) throws LdapException
-        {
-            return Collections.emptyList();
-        }
-
-        public List<EntryAttribute> removeAttributes( AttributeType... attributes )
-        {
-            return Collections.emptyList();
-        }
-
-        public List<EntryAttribute> set( AttributeType... attributeTypes )
-        {
-            return Collections.emptyList();
-        }
-
-        public void add( EntryAttribute... attributes ) throws LdapException
-        {
-        }
-
-        public void add( String upId, String... values ) throws LdapException
-        {
-        }
-
-        public void add( String upId, byte[]... values ) throws LdapException
-        {
-        }
-
-        public void add( String upId, Value<?>... values ) throws LdapException
-        {
-        }
-
-        public void clear()
-        {
-        }
-
-        public boolean contains( EntryAttribute... attributes ) throws LdapException
-        {
-            return false;
-        }
-
-        public boolean contains( String upId, byte[]... values )
-        {
-            return false;
-        }
-
-        public boolean contains( String upId, String... values )
-        {
-            return false;
-        }
-
-        public boolean contains( String upId, Value<?>... values )
-        {
-            return false;
-        }
-
-        public boolean containsAttribute( String... attributes )
-        {
-            return false;
-        }
-
-        public EntryAttribute get( String alias )
-        {
-            return null;
-        }
-
-        public DN getDn()
-        {
-            return null;
-        }
-
-        public boolean hasObjectClass( String objectClass )
-        {
-            return false;
-        }
-
-        @SuppressWarnings("unchecked")
-        public Iterator<EntryAttribute> iterator()
-        {
-            return ( ( List <EntryAttribute> ) Collections.EMPTY_LIST ).iterator();
-        }
-
-        public List<EntryAttribute> put( EntryAttribute... attributes ) throws LdapException
-        {
-            return Collections.emptyList();
-        }
-
-        public EntryAttribute put( String upId, byte[]... values )
-        {
-            return null;
-        }
 
-        public EntryAttribute put( String upId, String... values )
-        {
-            return null;
-        }
-
-        public EntryAttribute put( String upId, Value<?>... values )
-        {
-            return null;
-        }
-
-        public boolean remove( String upId, byte[]... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public boolean remove( String upId, String... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public boolean remove( String upId, Value<?>... values ) throws LdapException
-        {
-            return false;
-        }
-
-        public List<EntryAttribute> removeAttributes( String... attributes )
-        {
-            return Collections.emptyList();
-        }
-
-        public List<EntryAttribute> set( String... upIds )
-        {
-            return Collections.emptyList();
-        }
-
-        public void setDn( DN dn )
-        {
-            this.dn = dn;
-        }
-
-        public int size()
-        {
-            return 0;
-        }
     
-        
-        public Entry clone()
-        {
-            return new EmptyEntry( dn );
-        }
-
-        
-        public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
-        {
-        }
-        
-        
-        public void writeExternal( ObjectOutput out ) throws IOException
-        {
-        }
-        
-        
-        public Entry toClientEntry() throws LdapException
-        {
-            // Copy the DN
-            Entry clientEntry = new DefaultClientEntry( dn );
-            
-            // Convert each attribute 
-            for ( EntryAttribute serverAttribute:this )
-            {
-                EntryAttribute clientAttribute = serverAttribute.clone();
-                clientEntry.add( clientAttribute );
-            }
-            
-            return clientEntry;
-        }
-
-        public boolean contains( String upId ) throws LdapException
-        {
-            return false;
-        }
-    }
-
-
     public boolean contains( String upId ) throws LdapException
     {
         return clonedEntry.contains( upId );