directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1089780 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/
Date Thu, 07 Apr 2011 08:42:55 GMT
Author: elecharny
Date: Thu Apr  7 08:42:55 2011
New Revision: 1089780

URL: http://svn.apache.org/viewvc?rev=1089780&view=rev
Log:
Added an Entry.setDn( String ) method for completeness

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.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

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=1089780&r1=1089779&r2=1089780&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 08:42:55 2011
@@ -33,6 +33,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 
@@ -382,6 +383,12 @@ public class ClonedServerEntry implement
     }
 
 
+    public void setDn( String dn ) throws LdapInvalidDnException
+    {
+        clonedEntry.setDn( dn );
+    }
+
+
     public int size()
     {
         return clonedEntry.size();

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=1089780&r1=1089779&r2=1089780&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 08:42:55 2011
@@ -35,6 +35,7 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 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.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.ldif.LdapLdifException;
 import org.apache.directory.shared.ldap.model.ldif.LdifAttributesReader;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -2231,9 +2232,7 @@ public final class DefaultEntry implemen
 
 
     /**
-     * Set this entry's Dn.
-     *
-     * @param dn The Dn associated with this entry
+     * {@inheritDoc}
      */
     public void setDn( Dn dn )
     {
@@ -2245,6 +2244,15 @@ public final class DefaultEntry implemen
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void setDn( String dn ) throws LdapInvalidDnException
+    {
+        setDn( new Dn( dn ) );
+    }
+
+
+    /**
      * Remove all the attributes for this entry. The Dn is not reset
      */
     public void clear()

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=1089780&r1=1089779&r2=1089780&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 08:42:55 2011
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 
@@ -133,6 +134,15 @@ public interface Entry extends Cloneable
      * @param dn The Dn associated with this entry
      */
     void setDn( Dn dn );
+    
+    
+    /**
+     * Set this entry's Dn.
+     *
+     * @param dn The Dn associated with this entry
+     * @throws LdapInvalidDnException if the provided Dn is invalid
+     */
+    void setDn( String dn ) throws LdapInvalidDnException;
 
 
     /**

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=1089780&r1=1089779&r2=1089780&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 08:42:55 2011
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.util.exception.NotImplementedException;
@@ -552,9 +553,7 @@ public class ImmutableEntry implements E
 
 
     /**
-     * Set this entry's Dn.
-     *
-     * @param dn The Dn associated with this entry
+     * {@inheritDoc}
      */
     public void setDn( Dn dn )
     {
@@ -564,6 +563,16 @@ public class ImmutableEntry implements E
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void setDn( String dn ) throws LdapInvalidDnException
+    {
+        new Exception().printStackTrace();
+        throw new NotImplementedException( "Cannot rename the entry " + entry.getDn() + "
is immutable." );
+    }
+
+
+    /**
      * Remove all the attributes for this entry. The Dn is not reset
      */
     public void clear()



Mime
View raw message