139 obj = DirectoryManager.getObjectInstance(
140 obj, rcn, (relative ? homeCtx : null),
141 homeCtx.envprops, attrs);
142 } catch (NamingException e) {
143 throw e;
144 } catch (Exception e) {
145 NamingException ne =
146 new NamingException(
147 "problem generating object using object factory");
148 ne.setRootCause(e);
149 throw ne;
150 }
151
152 // remove Java attributes from result, if necessary
153 // Even if CLASSNAME attr not there, there might be some
154 // residual attributes
155
156 String[] reqAttrs;
157 if ((reqAttrs = searchArgs.reqAttrs) != null) {
158 // create an attribute set for those requested
159 Attributes rattrs = new BasicAttributes(true); // caseignore
160 for (int i = 0; i < reqAttrs.length; i++) {
161 rattrs.put(reqAttrs[i], null);
162 }
163 for (int i = 0; i < Obj.JAVA_ATTRIBUTES.length; i++) {
164 // Remove Java-object attributes if not requested
165 if (rattrs.get(Obj.JAVA_ATTRIBUTES[i]) == null) {
166 attrs.remove(Obj.JAVA_ATTRIBUTES[i]);
167 }
168 }
169 }
170
171 }
172
173 /*
174 * name in search result is either the stringified composite name
175 * relative to the search context that can be passed directly to
176 * methods of the search context, or the fully qualified DN
177 * which can be used with the initial context.
178 */
179 SearchResult sr;
196 // a referral has been followed so do not create relative names
197 startName = null;
198 super.appendUnprocessedReferrals(ex);
199 }
200
201 @Override
202 protected LdapSearchEnumeration getReferredResults(
203 LdapReferralContext refCtx) throws NamingException {
204 // repeat the original operation at the new context
205 return (LdapSearchEnumeration)refCtx.search(
206 searchArgs.name, searchArgs.filter, searchArgs.cons);
207 }
208
209 @Override
210 protected void update(AbstractLdapNamingEnumeration<SearchResult> ne) {
211 super.update(ne);
212
213 // Update search-specific variables
214 LdapSearchEnumeration se = (LdapSearchEnumeration)ne;
215 startName = se.startName;
216 //VR - keep original args, don't overwite with current args
217 // searchArgs = se.searchArgs;
218 }
219
220 void setStartName(Name nm) {
221 startName = nm;
222 }
223 }
|
139 obj = DirectoryManager.getObjectInstance(
140 obj, rcn, (relative ? homeCtx : null),
141 homeCtx.envprops, attrs);
142 } catch (NamingException e) {
143 throw e;
144 } catch (Exception e) {
145 NamingException ne =
146 new NamingException(
147 "problem generating object using object factory");
148 ne.setRootCause(e);
149 throw ne;
150 }
151
152 // remove Java attributes from result, if necessary
153 // Even if CLASSNAME attr not there, there might be some
154 // residual attributes
155
156 String[] reqAttrs;
157 if ((reqAttrs = searchArgs.reqAttrs) != null) {
158 // create an attribute set for those requested
159 Attributes rattrs = new BasicAttributes(true); // ignorecase
160 for (int i = 0; i < reqAttrs.length; i++) {
161 rattrs.put(reqAttrs[i], null);
162 }
163 for (int i = 0; i < Obj.JAVA_ATTRIBUTES.length; i++) {
164 // Remove Java-object attributes if not requested
165 if (rattrs.get(Obj.JAVA_ATTRIBUTES[i]) == null) {
166 attrs.remove(Obj.JAVA_ATTRIBUTES[i]);
167 }
168 }
169 }
170
171 }
172
173 /*
174 * name in search result is either the stringified composite name
175 * relative to the search context that can be passed directly to
176 * methods of the search context, or the fully qualified DN
177 * which can be used with the initial context.
178 */
179 SearchResult sr;
196 // a referral has been followed so do not create relative names
197 startName = null;
198 super.appendUnprocessedReferrals(ex);
199 }
200
201 @Override
202 protected LdapSearchEnumeration getReferredResults(
203 LdapReferralContext refCtx) throws NamingException {
204 // repeat the original operation at the new context
205 return (LdapSearchEnumeration)refCtx.search(
206 searchArgs.name, searchArgs.filter, searchArgs.cons);
207 }
208
209 @Override
210 protected void update(AbstractLdapNamingEnumeration<SearchResult> ne) {
211 super.update(ne);
212
213 // Update search-specific variables
214 LdapSearchEnumeration se = (LdapSearchEnumeration)ne;
215 startName = se.startName;
216 //VR - keep original args, don't overwrite with current args
217 // searchArgs = se.searchArgs;
218 }
219
220 void setStartName(Name nm) {
221 startName = nm;
222 }
223 }
|