directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1090052 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-integ/src/test/java/org/apache/directo...
Date Thu, 07 Apr 2011 22:35:15 GMT
Author: elecharny
Date: Thu Apr  7 22:35:15 2011
New Revision: 1090052

URL: http://svn.apache.org/viewvc?rev=1090052&view=rev
Log:
o Added a constructor for Entry that takes a Dn as a String
o Fixed some Javadoc

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.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/Entry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
    directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/AttributeTypeHolder.java
    directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/ObjectClassHolder.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
Thu Apr  7 22:35:15 2011
@@ -266,7 +266,7 @@ public class ClonedServerEntry implement
     }
 
 
-    public boolean contains( Attribute... attributes ) throws LdapException
+    public boolean contains( Attribute... attributes )
     {
         return clonedEntry.contains( attributes );
     }

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
(original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
Thu Apr  7 22:35:15 2011
@@ -23,15 +23,15 @@ package org.apache.directory.server.core
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.name.Dn;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Unit tests class ClonedServerEntry.
@@ -56,9 +56,9 @@ public class ClonedServerEntryTest
     @BeforeClass
     public static void initNames() throws Exception
     {
-        Entry eA = new DefaultEntry(new Dn( "dc=example,dc=com" ));
-        Entry eB = new DefaultEntry(new Dn( "dc=example,dc=com" ));
-        Entry eC = new DefaultEntry(new Dn( "dc=test,dc=org" ));
+        Entry eA = new DefaultEntry( "dc=example,dc=com" );
+        Entry eB = new DefaultEntry( "dc=example,dc=com" );
+        Entry eC = new DefaultEntry( "dc=test,dc=org" );
 
         clonedServerEntryA = new ClonedServerEntry();
         clonedServerEntryACopy = new ClonedServerEntry();

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
Thu Apr  7 22:35:15 2011
@@ -170,8 +170,7 @@ public class PasswordPolicyTest extends 
 
         byte[] password = PasswordUtil.createStoragePassword( "12345", LdapSecurityConstants.HASH_METHOD_CRYPT
);
 
-        Dn userDn = new Dn( "cn=hashedpwd,ou=system" );
-        Entry userEntry = new DefaultEntry( userDn );
+        Entry userEntry = new DefaultEntry( "cn=hashedpwd,ou=system" );
         userEntry.add( SchemaConstants.OBJECT_CLASS, SchemaConstants.PERSON_OC );
         userEntry.add( SchemaConstants.CN_AT, "hashedpwd" );
         userEntry.add( SchemaConstants.SN_AT, "hashedpwd_sn" );
@@ -198,7 +197,7 @@ public class PasswordPolicyTest extends 
         respCtrl = getPwdRespCtrl( addResp );
         assertNull( respCtrl );
 
-        LdapConnection userConnection = getNetworkConnectionAs( getLdapServer(), userDn.getName(),
"12345" );
+        LdapConnection userConnection = getNetworkConnectionAs( getLdapServer(), "cn=hashedpwd,ou=system",
"12345" );
         assertNotNull( userConnection );
         assertTrue( userConnection.isAuthenticated() );
     }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
Thu Apr  7 22:35:15 2011
@@ -970,7 +970,7 @@ public class SearchAuthorizationIT exten
         createUser( "billyd", "billyd" );
 
         // create an entry subordinate to the user
-        Entry phoneBook = new DefaultEntry( new Dn( "ou=phoneBook,uid=billyd,ou=users,ou=system"
) );
+        Entry phoneBook = new DefaultEntry( "ou=phoneBook,uid=billyd,ou=users,ou=system"
);
         phoneBook.add( SchemaConstants.OU_AT, "phoneBook" );
         phoneBook.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
Thu Apr  7 22:35:15 2011
@@ -34,13 +34,12 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
-import org.apache.directory.shared.ldap.model.name.Dn;
 import org.junit.After;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -76,7 +75,7 @@ public class DefaultChangeLogIT extends 
         long revision = getService().getChangeLog().getCurrentRevision();
 
         // add new test entry
-        Entry entry = new DefaultEntry( new Dn( "ou=test0,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test0,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.add( SchemaConstants.OU_AT, "test0" );
         sysRoot.add( entry );
@@ -89,7 +88,7 @@ public class DefaultChangeLogIT extends 
         assertEquals( revision + 1, t0.getRevision() );
 
         // add another test entry
-        entry = new DefaultEntry( new Dn( "ou=test1,ou=system" ) );
+        entry = new DefaultEntry( "ou=test1,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test1" );
         sysRoot.add( entry );
@@ -109,7 +108,7 @@ public class DefaultChangeLogIT extends 
         assertEquals( revision + 2, t1.getRevision() );
 
         // add third test entry
-        entry = new DefaultEntry( new Dn( "ou=test2,ou=system" ) );
+        entry = new DefaultEntry( "ou=test2,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test2" );
         sysRoot.add( entry );
@@ -160,7 +159,7 @@ public class DefaultChangeLogIT extends 
         assertEquals( revision, getService().getChangeLog().getCurrentRevision() );
 
         // add new test entry
-        Entry entry = new DefaultEntry( new Dn( "ou=test,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test" );
         sysRoot.add( entry );
@@ -185,7 +184,7 @@ public class DefaultChangeLogIT extends 
     {
         LdapConnection sysRoot = getAdminConnection( getService() );
         Tag t0 = getService().getChangeLog().tag();
-        Entry entry = new DefaultEntry( new Dn( "ou=test,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test" );
         sysRoot.add( entry );
@@ -204,7 +203,7 @@ public class DefaultChangeLogIT extends 
         Tag t0 = getService().getChangeLog().tag();
 
         // add new test entry
-        Entry entry = new DefaultEntry( new Dn( "ou=test,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test" );
         sysRoot.add( entry );
@@ -226,7 +225,7 @@ public class DefaultChangeLogIT extends 
     public void testRevertDeleteOperations() throws Exception
     {
         LdapConnection sysRoot = getAdminConnection( getService() );
-        Entry entry = new DefaultEntry( new Dn( "ou=test,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test" );
         sysRoot.add( entry );
@@ -249,7 +248,7 @@ public class DefaultChangeLogIT extends 
     public void testRevertRenameOperations() throws Exception
     {
         LdapConnection sysRoot = getAdminConnection( getService() );
-        Entry entry = new DefaultEntry( new Dn( "ou=oldname,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=oldname,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "oldname" );
         sysRoot.add( entry );
@@ -275,7 +274,7 @@ public class DefaultChangeLogIT extends 
     public void testRevertModifyOperations() throws Exception
     {
         LdapConnection sysRoot = getAdminConnection( getService() );
-        Entry entry = new DefaultEntry( new Dn( "ou=test5,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=test5,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test5" );
         sysRoot.add( entry );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
Thu Apr  7 22:35:15 2011
@@ -35,9 +35,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
@@ -141,7 +141,7 @@ public class ExceptionServiceIT extends 
     {
         LdapConnection connection = getAdminConnection( getService() );
 
-        Entry entry = new DefaultEntry( new Dn( "ou=users,ou=groups,ou=system" ) );
+        Entry entry = new DefaultEntry( "ou=users,ou=groups,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "OrganizationalUnit" );
         entry.add( SchemaConstants.OU_AT, "users" );
 
@@ -149,7 +149,7 @@ public class ExceptionServiceIT extends 
         ModifyDnResponse resp = connection.rename( entry.getDn(), new Rdn( "ou=users" ) );
         assertEquals( ResultCodeEnum.ENTRY_ALREADY_EXISTS, resp.getLdapResult().getResultCode()
);
 
-        Entry userzEntry = new DefaultEntry( new Dn( "ou=userz,ou=groups,ou=system" ) );
+        Entry userzEntry = new DefaultEntry( "ou=userz,ou=groups,ou=system" );
         userzEntry.add( SchemaConstants.OBJECT_CLASS_AT, "OrganizationalUnit" );
         userzEntry.add( SchemaConstants.OU_AT, "userz" );
 
@@ -396,13 +396,13 @@ public class ExceptionServiceIT extends 
     {
         LdapConnection connection = getAdminConnection( getService() );
 
-        Entry entry = new DefaultEntry( new Dn( "cn=toanother,ou=system" ) );
+        Entry entry = new DefaultEntry( "cn=toanother,ou=system" );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "alias", SchemaConstants.EXTENSIBLE_OBJECT_OC
);
         entry.add( "aliasedObjectName", "ou=users,ou=system" );
 
         connection.add( entry );
 
-        Entry aliasChild = new DefaultEntry( new Dn( "ou=blah,cn=toanother,ou=system" ) );
+        Entry aliasChild = new DefaultEntry( "ou=blah,cn=toanother,ou=system" );
         aliasChild.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         aliasChild.add( SchemaConstants.OU_AT, "blah" );
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Thu Apr  7 22:35:15 2011
@@ -84,8 +84,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.csn.Csn;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
-import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.DefaultAttribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -291,7 +291,7 @@ public class AddIT extends AbstractLdapT
         LdapConnection con = getClientApiConnection( getLdapServer() );
 
         String dn = "cn=Kate Bush," + BASE;
-        Entry kate = new DefaultEntry( new Dn( dn ) );
+        Entry kate = new DefaultEntry( dn );
 
         kate.add( "objectclass", "top", "person" );
         kate.add( "sn", "Bush" );
@@ -331,7 +331,7 @@ public class AddIT extends AbstractLdapT
         LdapConnection con = getClientApiConnection( getLdapServer() );
 
         String dn = "cn=Kate Bush," + BASE;
-        Entry kate = new DefaultEntry( new Dn( dn ) );
+        Entry kate = new DefaultEntry( dn );
         kate.add( "objectclass", "top", "person" );
         kate.add( "sn", "Bush" );
         kate.add( "cn", "Kate Bush" );
@@ -371,7 +371,7 @@ public class AddIT extends AbstractLdapT
         LdapConnection con = getClientApiConnection( getLdapServer() );
 
         String dn = "cn=Kate Bush," + BASE;
-        Entry kate = new DefaultEntry( new Dn( dn ) );
+        Entry kate = new DefaultEntry( dn );
 
         kate.add( "objectclass", "top", "person" );
         kate.add( "sn", "Bush" );
@@ -1271,7 +1271,7 @@ public class AddIT extends AbstractLdapT
         LdapConnection con = getClientApiConnection( getLdapServer() );
 
         String dn = "cn=Kate Bush," + BASE;
-        Entry entry = new DefaultEntry( new Dn( dn ) );
+        Entry entry = new DefaultEntry( dn );
         entry.add( "objectclass", "top", "person" );
         entry.add( "sn", "Bush" );
         entry.add( "cn", "Kate Bush" );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Thu Apr  7 22:35:15 2011
@@ -706,7 +706,7 @@ public class SaslBindIT extends Abstract
     protected Entry getPrincipalAttributes( String dn, String sn, String cn, String uid,
String userPassword,
         String principal ) throws LdapException
     {
-        Entry entry = new DefaultEntry( new Dn( dn ) );
+        Entry entry = new DefaultEntry( dn );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "person", "inetOrgPerson", "krb5principal",
"krb5kdcentry" );
         entry.add( SchemaConstants.CN_AT, cn );
         entry.add( SchemaConstants.SN_AT, sn );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
Thu Apr  7 22:35:15 2011
@@ -1607,7 +1607,7 @@ public class SearchIT extends AbstractLd
             for ( int i = 0; i < 1000; i++ )
             {
                 String dn = "cn=user" + i + "," + BASE;
-                Entry kate = new DefaultEntry( new Dn( dn ) );
+                Entry kate = new DefaultEntry( dn );
 
                 kate.add( "objectclass", "top", "person" );
                 kate.add( "sn", "Bush" );

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=1090052&r1=1090051&r2=1090052&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 Apr  7 22:35:15 2011
@@ -121,8 +121,19 @@ public final class DefaultEntry implemen
 
 
     /**
-     * Creates a new instance of DefaultEntry, with a
-     * Dn.
+     * Creates a new instance of DefaultEntry, with a Dn.
+     *
+     * @param dn The String Dn for this serverEntry. Can be null.
+     * @throws LdapInvalidDnException If the Dn is invalid
+     */
+    public DefaultEntry( String dn ) throws LdapInvalidDnException
+    {
+        this.dn = new Dn( dn );
+    }
+
+
+    /**
+     * Creates a new instance of DefaultEntry, with a Dn.
      *
      * @param dn The Dn for this serverEntry. Can be null.
      */
@@ -141,6 +152,37 @@ public final class DefaultEntry implemen
      * </p>
      *
      * @param schemaManager The reference to the schemaManager
+     * @param dn The String Dn for this serverEntry. Can be null.
+     * @throws LdapInvalidDnException If the Dn is invalid
+     */
+    public DefaultEntry( SchemaManager schemaManager, String dn ) throws LdapInvalidDnException
+    {
+        this.schemaManager = schemaManager;
+
+        if ( Strings.isEmpty( dn ) )
+        {
+            this.dn = Dn.EMPTY_DN;
+        }
+        else
+        {
+            this.dn = new Dn( dn );
+            normalizeDN( this.dn );
+        }
+
+        // Initialize the ObjectClass object
+        initObjectClassAT();
+    }
+
+
+    /**
+     * <p>
+     * Creates a new instance of DefaultEntry, schema aware.
+     * </p>
+     * <p>
+     * No attributes will be created.
+     * </p>
+     *
+     * @param schemaManager The reference to the schemaManager
      * @param dn The Dn for this serverEntry. Can be null.
      */
     public DefaultEntry( SchemaManager schemaManager, Dn dn )
@@ -980,7 +1022,7 @@ public final class DefaultEntry implemen
     /**
      * {@inheritDoc}
      */
-    public boolean contains( Attribute... attributes ) throws LdapException
+    public boolean contains( Attribute... attributes )
     {
         if ( schemaManager == null )
         {

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java
Thu Apr  7 22:35:15 2011
@@ -103,15 +103,6 @@ public interface Entry extends Cloneable
 
     
     /**
-     * <p>
-     * Returns the attribute with the specified AttributeType. The return value
-     * is <code>null</code> if no match is found.  
-     * </p>
-     *
-     * @param attributeType The attributeType we are looking for.
-     * @return the attribute associated with the AttributeType.
-     */
-    /**
      * Returns the attribute associated with an AttributeType
      * 
      * @param attributeType the AttributeType we are looking for
@@ -139,18 +130,16 @@ public interface Entry extends Cloneable
     /**
      * Set this entry's Dn.
      *
-     * @param dn The Dn associated with this entry
+     * @param dn The String Dn associated with this entry
      * @throws LdapInvalidDnException if the provided Dn is invalid
      */
     void setDn( String dn ) throws LdapInvalidDnException;
 
 
     /**
-     * Returns an enumeration containing the zero or more attributes in the
-     * collection. The behavior of the enumeration is not specified if the
-     * attribute collection is changed.
+     * Returns an iterator on the attributes for this entry.
      *
-     * @return an enumeration of all contained attributes
+     * @return an iterator on top of all contained attributes
      */
     Iterator<Attribute> iterator();
 
@@ -265,7 +254,7 @@ public interface Entry extends Cloneable
      *
      * @param upId The user provided ID for the added AttributeType
      * @param attributeType The attribute Type.
-     * @param values The list of binary values to add. It can be empty.
+     * @param values The list of String values to add. It can be empty.
      * @throws LdapException If the attribute does not exist
      */
     void add( String upId, AttributeType attributeType, String... values ) throws LdapException;
@@ -337,8 +326,7 @@ public interface Entry extends Cloneable
      *</p>
      *
      * @param attributes the attributes to be put
-     * @return the old attributes with the same OID, if exist; otherwise
-     *         <code>null</code>
+     * @return the old attributes with the same OID, if exist; otherwise <code>null</code>
      * @exception LdapException if the operation fails
      */
     List<Attribute> put( Attribute... attributes ) throws LdapException;
@@ -653,7 +641,7 @@ public interface Entry extends Cloneable
      * </p> 
      *
      * @param upId The attribute ID  
-     * @param values the attributes to be removed
+     * @param values the attribute's values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
      */
@@ -677,7 +665,7 @@ public interface Entry extends Cloneable
      * </p> 
      *
      * @param upId The attribute ID  
-     * @param values the attributes to be removed
+     * @param values the attribute's values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if no values have been removed or if the attribute does not exist. 
      */
@@ -701,7 +689,7 @@ public interface Entry extends Cloneable
      * </p> 
      *
      * @param upId The attribute ID  
-     * @param values the attributes to be removed
+     * @param values the attribute's values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
      * if not all the values have been removed or if the attribute does not exist. 
      * @throws LdapException if the attribute does not exists
@@ -734,7 +722,7 @@ public interface Entry extends Cloneable
      * Checks if an entry contains an attribute with some given binary values.
      *
      * @param attributeType The Attribute we are looking for.
-     * @param values The searched values.
+     * @param values The searched binary values.
      * @return <code>true</code> if all the values are found within the attribute,
      * <code>false</code> otherwise, or if the attributes does not exist.
      */
@@ -745,7 +733,7 @@ public interface Entry extends Cloneable
      * Checks if an entry contains an attribute with some given String values.
      *
      * @param attributeType The Attribute we are looking for.
-     * @param values The searched values.
+     * @param values The searched String values.
      * @return <code>true</code> if all the values are found within the attribute,
      * <code>false</code> otherwise, or if the attributes does not exist.
      */
@@ -784,9 +772,8 @@ public interface Entry extends Cloneable
      * @param attributes The Attributes to look for
      * @return <code>true</code> if all the attributes are found within 
      * the entry, <code>false</code> if at least one of them is not present.
-     * @throws LdapException If the attribute does not exist
      */
-    boolean contains( Attribute... attributes ) throws LdapException;
+    boolean contains( Attribute... attributes );
 
 
     /**

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
Thu Apr  7 22:35:15 2011
@@ -180,7 +180,7 @@ public class ImmutableEntry implements E
     /**
      * {@inheritDoc}
      */
-    public boolean contains( Attribute... attributes ) throws LdapException
+    public boolean contains( Attribute... attributes )
     {
         return entry.contains( attributes );
     }

Modified: directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/AttributeTypeHolder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/AttributeTypeHolder.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/AttributeTypeHolder.java
(original)
+++ directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/AttributeTypeHolder.java
Thu Apr  7 22:35:15 2011
@@ -25,7 +25,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
-import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.UsageEnum;
 
@@ -406,7 +405,7 @@ public class AttributeTypeHolder extends
             + Rdn.escapeValue(schemaName) + ", ou=schema";
 
         // First dump the Dn only
-        Entry entry = new DefaultEntry( new Dn( dn ) );
+        Entry entry = new DefaultEntry( dn );
         sb.append( LdifUtils.convertEntryToLdif(entry) );
 
         return sb.toString();

Modified: directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/ObjectClassHolder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/ObjectClassHolder.java?rev=1090052&r1=1090051&r2=1090052&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/ObjectClassHolder.java
(original)
+++ directory/shared/trunk/ldap/schema/converter/src/main/java/org/apache/directory/shared/converter/schema/ObjectClassHolder.java
Thu Apr  7 22:35:15 2011
@@ -20,18 +20,17 @@
 package org.apache.directory.shared.converter.schema;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
-import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.ObjectClassTypeEnum;
 
-import java.util.ArrayList;
-import java.util.List;
-
 
 /**
  * A bean used to encapsulate the literal String values of an ObjectClass
@@ -221,7 +220,7 @@ public class ObjectClassHolder extends S
             + Rdn.escapeValue(schemaName) + ", ou=schema";
 
         // First dump the Dn only
-        Entry entry = new DefaultEntry( new Dn( dn ) );
+        Entry entry = new DefaultEntry( dn );
         sb.append( LdifUtils.convertEntryToLdif(entry) );
 
         return sb.toString();



Mime
View raw message