< prev index next >

src/java.naming/share/classes/com/sun/jndi/ldap/LdapReferralException.java

Print this page




 200         try {
 201             getNextReferral();
 202         } catch (ReferralException e) {
 203             // mask the referral exception
 204         }
 205 
 206         return (hasMoreReferrals() || hasMoreReferralExceptions());
 207     }
 208 
 209 
 210     /**
 211      * Sets referral information.
 212      */
 213     void setReferralInfo(Vector<?> referrals, boolean continuationRef) {
 214         // %%% continuationRef is currently ignored
 215 
 216         if (debug)
 217             System.out.println("LdapReferralException.setReferralInfo");
 218 
 219         this.referrals = referrals;
 220         if (referrals != null) {
 221             referralCount = referrals.size();
 222         }
 223 
 224         if (debug) {

 225             for (int i = 0; i < referralCount; i++) {
 226                 System.out.println("  [" + i + "] " + referrals.elementAt(i));
 227             }


 228         }

 229     }
 230 
 231     /**
 232      * Gets the next referral. When the current set of referrals have
 233      * been exhausted then the next referral exception is thrown, if available.
 234      */
 235     String getNextReferral() throws ReferralException {
 236 
 237         if (debug)
 238             System.out.println("LdapReferralException.getNextReferral");
 239 
 240         if (hasMoreReferrals()) {
 241             return (String)referrals.elementAt(referralIndex++);
 242         } else if (hasMoreReferralExceptions()) {
 243             throw nextReferralEx;
 244         } else {
 245             return null;
 246         }
 247     }
 248 




 200         try {
 201             getNextReferral();
 202         } catch (ReferralException e) {
 203             // mask the referral exception
 204         }
 205 
 206         return (hasMoreReferrals() || hasMoreReferralExceptions());
 207     }
 208 
 209 
 210     /**
 211      * Sets referral information.
 212      */
 213     void setReferralInfo(Vector<?> referrals, boolean continuationRef) {
 214         // %%% continuationRef is currently ignored
 215 
 216         if (debug)
 217             System.out.println("LdapReferralException.setReferralInfo");
 218 
 219         this.referrals = referrals;
 220         referralCount = (referrals == null) ? 0 : referrals.size();


 221 
 222         if (debug) {
 223             if (referrals != null) {
 224                 for (int i = 0; i < referralCount; i++) {
 225                     System.out.println("  [" + i + "] " + referrals.elementAt(i));
 226                 }
 227             } else {
 228                 System.out.println("setReferralInfo : referrals == null");
 229             }
 230         }
 231     }
 232 
 233     /**
 234      * Gets the next referral. When the current set of referrals have
 235      * been exhausted then the next referral exception is thrown, if available.
 236      */
 237     String getNextReferral() throws ReferralException {
 238 
 239         if (debug)
 240             System.out.println("LdapReferralException.getNextReferral");
 241 
 242         if (hasMoreReferrals()) {
 243             return (String)referrals.elementAt(referralIndex++);
 244         } else if (hasMoreReferralExceptions()) {
 245             throw nextReferralEx;
 246         } else {
 247             return null;
 248         }
 249     }
 250 


< prev index next >