2362N/A * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Basic enumeration for NameClassPair, Binding, and SearchResults. 0N/A * Record the next set of entries and/or referrals. 0N/A // These checks are to accommodate referrals and limit exceptions 0N/A // which will generate an enumeration and defer the exception 0N/A // to be thrown at the end of the enumeration. 0N/A // All other exceptions are thrown immediately. 0N/A // Exceptions shouldn't be thrown here anyhow because 0N/A // process_return_code() is called before the constructor 0N/A // is called, so these are just safety checks. 0N/A // %%% need to deal with referral 0N/A // otherwise continue 0N/A // Ensures that context won't get closed from underneath us 0N/A // can't throw exception 0N/A // can't throw exception 0N/A * Retrieve the next set of entries and/or referrals. 0N/A // mimimize the number of calls to processReturnCode() 0N/A // (expensive when batchSize is small and there are many results) 0N/A // convert referrals into a chain of LdapReferralException 0N/A // merge any newly received referrals with any current referrals 0N/A private boolean more =
true;
// assume we have something to start with 0N/A * Test if unprocessed entries or referrals exist. 0N/A * Retrieve the next entry. 0N/A * Test if unprocessed entries or referrals exist. 0N/A // when page size is supported, this 0N/A // might generate an exception while attempting 0N/A // to fetch the next batch to determine 0N/A // whether there are any more elements 0N/A // test if the current set of entries has been processed 0N/A // test if any unprocessed entries exist 0N/A // try to process another referral 0N/A * Retrieve the next entry. 0N/A // gets and outputs DN from the entry 0N/A // need to strip off all but lowest component of dn 0N/A // so that is relative to current context (currentDN) 0N/A // use the Java classname if present 0N/A * Append the supplied (chain of) referrals onto the 0N/A * end of the current (chain of) referrals. 0N/A // repeat the original operation at the new context 0N/A * Iterate through the URLs of a referral. If successful then perform 0N/A * a search operation and merge the received results with the current 0N/A // process the referrals sequentially 0N/A // record a previous exception 0N/A // Make sure we close referral context 0N/A * Merge the entries and/or referrals from the supplied enumeration 0N/A * with those of the current enumeration. 0N/A // Cleanup previous context first 0N/A // New enum will have already incremented enum count and recorded clnt 0N/A // Do this to prevent referral enumeration (ne) from decrementing 0N/A // enum count because we'll be doing that here from this 0N/A // Record rest of information from new enum