directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r693464 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
Date Tue, 09 Sep 2008 14:05:54 GMT
Author: pamarcelot
Date: Tue Sep  9 07:05:53 2008
New Revision: 693464

URL: http://svn.apache.org/viewvc?rev=693464&view=rev
Log:
Added a setEntry(...) method.

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java?rev=693464&r1=693463&r2=693464&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequest.java
Tue Sep  9 07:05:53 2008
@@ -25,7 +25,6 @@
 import java.util.LinkedList;
 import java.util.List;
 
-
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -141,6 +140,19 @@
         return entry;
     }
 
+
+    /**
+     * Sets the entry.
+     *
+     * @param entry
+     *      the entry
+     */
+    public void setEntry( Entry entry )
+    {
+        this.entry = entry;
+    }
+
+
     /**
      * Create a new attributeValue
      * 
@@ -154,7 +166,7 @@
             currentAttribute = entry.get( type );
             return;
         }
-        
+
         // fix this to use AttributeImpl(type.getString().toLowerCase())
         currentAttribute = new DefaultClientAttribute( type );
         entry.put( currentAttribute );
@@ -170,11 +182,11 @@
     {
         if ( value instanceof String )
         {
-            currentAttribute.add( (String)value );
+            currentAttribute.add( ( String ) value );
         }
         else
         {
-            currentAttribute.add( (byte[])value );
+            currentAttribute.add( ( byte[] ) value );
         }
     }
 
@@ -243,8 +255,7 @@
     public int computeLength()
     {
         // The entry
-        addRequestLength = 1 + TLV.getNbBytes( LdapDN.getNbBytes( entry.getDn() ) ) + 
-            LdapDN.getNbBytes( entry.getDn() );
+        addRequestLength = 1 + TLV.getNbBytes( LdapDN.getNbBytes( entry.getDn() ) ) + LdapDN.getNbBytes(
entry.getDn() );
 
         // The attributes sequence
         attributesLength = 0;
@@ -255,7 +266,7 @@
             valuesLength = new LinkedList<Integer>();
 
             // Compute the attributes length
-            for ( EntryAttribute attribute:entry )
+            for ( EntryAttribute attribute : entry )
             {
                 int localAttributeLength = 0;
                 int localValuesLength = 0;
@@ -269,7 +280,7 @@
                 {
                     localValuesLength = 0;
 
-                    for ( org.apache.directory.shared.ldap.entry.Value<?> value:attribute
)
+                    for ( org.apache.directory.shared.ldap.entry.Value<?> value : attribute
)
                     {
                         if ( value instanceof ClientStringValue )
                         {
@@ -289,7 +300,7 @@
                 // add the attribute length to the attributes length
                 attributesLength += 1 + TLV.getNbBytes( localAttributeLength ) + localAttributeLength;
 
-                attributeLength.add(localAttributeLength );
+                attributeLength.add( localAttributeLength );
                 valuesLength.add( localValuesLength );
             }
         }
@@ -359,7 +370,7 @@
                 int attributeNumber = 0;
 
                 // Compute the attributes length
-                for ( EntryAttribute attribute:entry )
+                for ( EntryAttribute attribute : entry )
                 {
                     // The attributes list sequence
                     buffer.put( UniversalTag.SEQUENCE_TAG );
@@ -376,7 +387,7 @@
 
                     if ( attribute.size() != 0 )
                     {
-                        for ( org.apache.directory.shared.ldap.entry.Value<?> value:attribute
)
+                        for ( org.apache.directory.shared.ldap.entry.Value<?> value
: attribute )
                         {
                             if ( value instanceof ClientBinaryValue )
                             {
@@ -422,7 +433,7 @@
         sb.append( "    Add Request\n" );
         sb.append( "        Attributes\n" );
 
-        if ( entry == null ) 
+        if ( entry == null )
         {
             sb.append( "            No attributes\n" );
         }



Mime
View raw message