directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r161396 - directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java
Date Fri, 15 Apr 2005 05:37:11 GMT
Author: elecharny
Date: Thu Apr 14 22:37:11 2005
New Revision: 161396

URL: http://svn.apache.org/viewcvs?view=rev&rev=161396
Log:
Added some comments.

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java?view=diff&r1=161395&r2=161396
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java
Thu Apr 14 22:37:11 2005
@@ -86,23 +86,28 @@
     private MutableString errorMessage;
 
     /** The referrals, if any. This is an optional element */
-    private MutableString[] referral;
+    private MutableString[] referrals;
+    
+    /** The number of referral */
+    private int nbReferral;
 
     //~ Constructors -------------------------------------------------------------------------------
 
     /**
      * Creates a new BindResponsePOJO object.
+     * We will create a limited number of Referral objects.
      */
     public LdapResultPOJO()
     {
         super( );
+        
+        nbReferral = 0;
+        referrals = new MutableString[10];
     }
 
     //~ Methods ------------------------------------------------------------------------------------
 
     /**
-     * DOCUMENT ME!
-     *
      * @return Returns the errorMessage.
      */
     public String getErrorMessage()
@@ -111,8 +116,6 @@
     }
 
     /**
-     * DOCUMENT ME!
-     *
      * @param errorMessage The errorMessage to set.
      */
     public void setErrorMessage( MutableString errorMessage )
@@ -121,8 +124,6 @@
     }
 
     /**
-     * DOCUMENT ME!
-     *
      * @return Returns the matchedDN.
      */
     public String getMatchedDN()
@@ -131,8 +132,7 @@
     }
 
     /**
-     * DOCUMENT ME!
-     *
+     * Set the Matched DN
      * @param matchedDN The matchedDN to set.
      */
     public void setMatchedDN( MutableString matchedDN )
@@ -141,28 +141,34 @@
     }
 
     /**
-     * DOCUMENT ME!
-     *
      * @return Returns the referral.
      */
-    public MutableString[] getReferral()
+    public MutableString[] getReferrals()
     {
-        return referral;
+        return referrals;
     }
 
     /**
-     * DOCUMENT ME!
+     * Set some referrals
      *
      * @param referral The referral to set.
      */
-    public void setReferral( MutableString[] referral )
+    public void setReferral( MutableString[] referrals )
     {
-        this.referral = referral;
+        this.referrals = referrals;
     }
 
     /**
-     * DOCUMENT ME!
+     * Add a referrals
      *
+     * @param referral The referral to add.
+     */
+    public void addReferral( MutableString referral )
+    {
+        this.referrals[nbReferral++] = referral;
+    }
+
+    /**
      * @return Returns the resultCode.
      */
     public int getResultCode()
@@ -171,7 +177,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the result code
      *
      * @param resultCode The resultCode to set.
      */
@@ -197,19 +203,21 @@
             errorMessage.free();
         }
 
-        if ( referral != null )
+        if ( referrals != null )
         {
 
-            for ( int i = 0; i < referral.length; i++ )
+            for ( int i = 0; i < referrals.length; i++ )
             {
 
-                if ( referral[i] != null )
+                if ( referrals[i] != null )
                 {
-                    referral[i].free();
+                    referrals[i].free();
                 }
             }
 
-            referral = null;
+            referrals = null;
         }
+        
+        nbReferral = 0;
     }
 }



Mime
View raw message