Announcement Announcement Module
Collapse
No announcement yet.
getNameInNameSpace() is not returning the full DN Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • getNameInNameSpace() is not returning the full DN

    I am trying to get the full DN using the method getNameinNameSpace but it is just returning the RDN

    Is there any other method to get the full DN (including the base.)

    Here is my code snippet:

    List list = ldapTemplate.listBindings(
    new LdapName("ou=permissions,ou=BDC,ou=apps,dc=mycompa ny,dc=com"),
    new ContextMapper() {
    public Object mapFromContext(Object ctx) {
    DirContextAdapter context = (DirContextAdapter)ctx;
    return (String)context.getNameInNamespace();
    }
    }
    );

    What I get back is a list of strings like this:
    ou=permissionA
    ou=permissionB

    what I would like to get back is the full DN
    e.g.
    ou=permissionA,ou=permissions,ou=BDC,ou=apps,dc=my company,dc=com
    ou=permissionB,ou=permissions,ou=BDC,ou=apps,dc=my company,dc=com

    Thanks

  • #2
    What version of Spring LDAP are you using? This issue was solved in the 1.1.2 release:
    http://opensource.atlassian.com/proj...browse/LDAP-21

    Comment


    • #3
      Thanks for your reply.

      I am using spring-ldap 1.1.2

      I don't know if this is still a bug but here is what is happening. If this method is called as part of listBindings I have this problem but if I call this method as part of ldapTemplate.search it is behaving as expected.

      I suspect because listBindings takes a base as the first argument it is causing this behavior.

      Comment


      • #4
        You're right, I now verified that getNameInNamespace() doesn't work with listBindings. At the moment I really can't see any way around it.

        It seems that when the listBindings method has been used the arguments to DirObjectFactory.getObjectInstance() gets messed up. I haven't verified that this is a bug in the LDAP Provider code, but it sure looks that way. Either way the arguments we get from the LDAP Provider to our DirObjectFactory implementation is different depending on whether search or listBindings was used.

        Feel free to post a jira issue on this; it might be possible to solve.

        Comment

        Working...
        X