120 cleanup();
121 return false;
122 }
123 }
124
125 /*
126 * Retrieve the next set of entries and/or referrals.
127 */
128 private void getNextBatch() throws NamingException {
129
130 res = homeCtx.getSearchReply(enumClnt, res);
131 if (res == null) {
132 limit = posn = 0;
133 return;
134 }
135
136 entries = res.entries;
137 limit = (entries == null) ? 0 : entries.size(); // handle empty set
138 posn = 0; // reset
139
140 // mimimize the number of calls to processReturnCode()
141 // (expensive when batchSize is small and there are many results)
142 if ((res.status != LdapClient.LDAP_SUCCESS) ||
143 ((res.status == LdapClient.LDAP_SUCCESS) &&
144 (res.referrals != null))) {
145
146 try {
147 // convert referrals into a chain of LdapReferralException
148 homeCtx.processReturnCode(res, listArg);
149
150 } catch (LimitExceededException | PartialResultException e) {
151 setNamingException(e);
152
153 }
154 }
155
156 // merge any newly received referrals with any current referrals
157 if (res.refEx != null) {
158 if (refEx == null) {
159 refEx = res.refEx;
160 } else {
|
120 cleanup();
121 return false;
122 }
123 }
124
125 /*
126 * Retrieve the next set of entries and/or referrals.
127 */
128 private void getNextBatch() throws NamingException {
129
130 res = homeCtx.getSearchReply(enumClnt, res);
131 if (res == null) {
132 limit = posn = 0;
133 return;
134 }
135
136 entries = res.entries;
137 limit = (entries == null) ? 0 : entries.size(); // handle empty set
138 posn = 0; // reset
139
140 // minimize the number of calls to processReturnCode()
141 // (expensive when batchSize is small and there are many results)
142 if ((res.status != LdapClient.LDAP_SUCCESS) ||
143 ((res.status == LdapClient.LDAP_SUCCESS) &&
144 (res.referrals != null))) {
145
146 try {
147 // convert referrals into a chain of LdapReferralException
148 homeCtx.processReturnCode(res, listArg);
149
150 } catch (LimitExceededException | PartialResultException e) {
151 setNamingException(e);
152
153 }
154 }
155
156 // merge any newly received referrals with any current referrals
157 if (res.refEx != null) {
158 if (refEx == null) {
159 refEx = res.refEx;
160 } else {
|