I tried
<bean id="ldapConfig"
class="edu.vt.middleware.ldap.LdapConfig"
p:searchResultHandlers="edu.internet2.middleware.ldappc.util.QuotedDnResultHandler,edu.vt.middleware.ldap.handler.FqdnSearchResultHandler"
...
which fails "Cannot convert value of type [java.lang.String] to
required type [edu.vt.middleware.ldap.handler.SearchResultHandler]".
It looks like there's custom code to support search result handlers in shib :
https://spaces.internet2.edu/display/SHIB2/vtldap3Upgrade
Thanks,
TomZ
P.S. I hope this is the right place to ask, at least according to the
3.3 readme :-)
Is it possible to set SearchResultHandlers using Spring ?
I tried
<bean id="ldapConfig"
class="edu.vt.middleware.ldap.LdapConfig"
p:searchResultHandlers="edu.internet2.middleware.ldappc.util.QuotedDnResultHandler,edu.vt.middleware.ldap.handler.FqdnSearchResultHandler"
...
which fails "Cannot convert value of type [java.lang.String] to
required type [edu.vt.middleware.ldap.handler.SearchResultHandler]".
It looks like there's custom code to support search result handlers in shib :
https://spaces.internet2.edu/display/SHIB2/vtldap3Upgrade
P.S. I hope this is the right place to ask, at least according to the
3.3 readme :-)
I tried
<bean id="ldapFactory"
class="edu.vt.middleware.ldap.pool.DefaultLdapFactory"
p:connectOnCreate="false" >
<constructor-arg index="0" ref="ldapConfig"/>
</bean>
<bean id="ldapPool"
class="edu.vt.middleware.ldap.pool.SoftLimitLdapPool"
init-method="initialize"
p:blockWaitTime="1000">
<constructor-arg index="0">
<bean class="edu.vt.middleware.ldap.pool.LdapPoolConfig" />
</constructor-arg>
<constructor-arg index="1" ref="ldapFactory"/>
</bean>
<bean id="ldapConfig"
class="edu.vt.middleware.ldap.LdapConfig"
...
<property name="searchResultHandlers">
<list>
<bean id="rangeSRH"
class="edu.internet2.middleware.ldappc.util.RangeSearchResultHandler"
>
<constructor-arg index="0" ref="ldapPool"/>
</bean>
</list>
</property>
</bean>
which fails with
org.springframework.beans.factory.BeanCurrentlyInCreationException:
Error creating bean with name 'ldapFactory': Requested bean is
currently in
creation: Is there an unresolvable circular reference?
Do you have any suggestions ? Would it be reasonable for
SearchResultHandlers to have access to the underlying Ldap connection
object ?
Thanks again,
Tom
I think we might want to review the component dependency graph in
order to avoid problems in use cases like this that are perfectly
reasonable.
In terms of a workaround, it seems to me the root of the circular
reference is referring back to the pool in RangeSearchResultHandler:
<constructor-arg index="0" ref="ldapPool"/>
Could you create two pools to break the circular reference?
M
I can try - the second pool would need the same configuration as the first.
The RecursiveSearchResultHandler is similar, it needs access to the
underlying Ldap object to perform supplementary searches. Perhaps this
kind of SearchResultHandler could have access to the Ldap connection
object ? or maybe the LdapConfig object so a new connection could be
created as needed ?
Thanks,
Tom
FWIW, I like the StatefulSearchResultHandler interface with the
setLdap(Ldap l) method for the reasons you mention, that not all
implementations need the Ldap object and to bring awareness to
statefulness. I'm wondering how it will work for paged searches, i.e.,
the state of the Ldap connection during paging.
I'm not a big fan of instanceof, so I think I like reflection, option
3, but I'm unable to make a convincing case; perhaps instanceof is
faster, I don't know.
In any case, if I understand correctly, the search() methods in
AbstractLdap will need to call handler.setLdap(this) before calling
handler.process(). That seems nice.
Thanks!
Tom
Looks clean. Just curious why you choose the word "Extended".
Thanks for doing this, it will make it easier to configure Active
Directory support via spring/xml, and for that matter, a properties
file.
Do you have a guess when 3.3 will be released ? We're looking at an
end of April-ish timeline for our next release, although last time we
delayed quite a few months :-)
Tom
> Added http://code.google.com/p/vt-middleware/issues/detail?id=67Looks clean. Just curious why you choose the word "Extended".
>
> The implementation adds two new interfaces: ExtendedSearchResultHandler and
> ExtendedAttributeHandler
> I went with Extended over Stateful because I thought stateful could imply
> some wrong ideas.
> The Ldap class has been updated to auto-wire handlers of these types.
>
> Take a look at the latest snapshot and let me know what you think.
Do you have a guess when 3.3 will be released ? We're looking at an
end of April-ish timeline for our next release, although last time we
delayed quite a few months :-)