directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r359063 - /directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java
Date Mon, 26 Dec 2005 11:11:45 GMT
Author: elecharny
Date: Mon Dec 26 03:11:39 2005
New Revision: 359063

URL: http://svn.apache.org/viewcvs?rev=359063&view=rev
Log:
Changed from LdapRDN to Rdn

Modified:
    directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java

Modified: directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java?rev=359063&r1=359062&r2=359063&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/apache2-provider/src/main/java/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java
Mon Dec 26 03:11:39 2005
@@ -20,11 +20,12 @@
 import java.nio.ByteBuffer;
 
 import org.apache.asn1.codec.EncoderException;
+import org.apache.asn1.codec.util.StringUtils;
 import org.apache.asn1new.ber.tlv.Length;
 import org.apache.asn1new.ber.tlv.Value;
 import org.apache.asn1new.ldap.codec.LdapConstants;
 import org.apache.ldap.common.name.LdapDN;
-import org.apache.ldap.common.name.LdapRDN;
+import org.apache.ldap.common.name.Rdn;
 
 /**
  * A ModifyDNRequest Message. Its syntax is :
@@ -44,7 +45,7 @@
     private LdapDN entry;
 
     /** The new RDN to be added to the RDN or to the new superior, if present */
-    private LdapRDN newRDN;
+    private Rdn newRDN;
 
     /** If the previous RDN is to be deleted, this flag will be set to true */
     private boolean deleteOldRDN;
@@ -122,7 +123,7 @@
      */
     public String getNewRDN()
     {
-        return ( ( newRDN == null ) ? "" : newRDN.getString() );
+        return ( ( newRDN == null ) ? "" : newRDN.toString() );
     }
 
     /**
@@ -130,7 +131,7 @@
      *
      * @param newRDN The newRDN to set.
      */
-    public void setNewRDN( LdapRDN newRDN )
+    public void setNewRDN( Rdn newRDN )
     {
         this.newRDN = newRDN;
     }
@@ -177,10 +178,10 @@
     */
     public int computeLength()
     {
-
+    	int newRdnlength = StringUtils.getBytesUtf8( newRDN.toString() ).length;
         modifyDNRequestLength =
             1 + Length.getNbBytes( entry.getNbBytes() ) + entry.getNbBytes() +
-            1 + Length.getNbBytes( newRDN.getNbBytes() ) + newRDN.getNbBytes() +
+            1 + Length.getNbBytes( newRdnlength ) + newRdnlength +
             1 + 1 + 1; // deleteOldRDN
 
         if ( newSuperior != null )
@@ -223,7 +224,7 @@
             Value.encode( buffer, entry.getBytes() );
             
             // The newRDN
-            Value.encode( buffer, newRDN.getBytes() );
+            Value.encode( buffer, newRDN.toString() );
             
             // The flag deleteOldRdn
             Value.encode( buffer, deleteOldRDN );



Mime
View raw message