![]() ![]() ![]() ![]() |
Frequently Asked Questions |
Why do I get an empty string as a name in my SearchResult
getName()?
always returns a name relative to the target context of the search. So, if the target context satisfies the search filter then the name returned will be "" (the empty name), because that is the name relative to the target context. See the Searches
lesson for details.
Why do I get a URL string as a name in my SearchResult
The LDAP entry was retrieved by either following an alias or a referral, so its name is a URL. See the Searches?
lesson for details.
Is the Name
Both the string forms and Name of the Context and DirContext methods accept composite names. The string forms accept the string representation of a composite name, while the Name forms accept the CompositeName structure.argument to the Context
and DirContext
methods a CompoundName
or a CompositeName
?
The name I got back from NameParser
(This is related to the previous question.) The Context methods accept the composite names, and the result returned by NameParser is a compound name.doesn't work with the Context
methods. Why?
What's the relationship between the name I use for the Context.SECURITY_PRINCIPAL
You can think of the principal name as coming from a different namespace than the directory. See draft-ietf-ldapext-authmeth-03.txt and the Securityproperty and the directory?
lesson for details on LDAP authentication mechanisms. Sun's LDAP service provider accepts a string principal name, which it passes directly to the LDAP server. Some LDAP servers accept distingushished names, while others support the schemes proposed by draft-ietf-ldapext-authmeth-03.txt.
Why are there strange quotes and escapes in the names I read from the directory?
Sun's LDAP name parser is conservative with respect to quoting rules but nevertheless produces "correct" names. Also, remember that the names of entries returned by NamingEnumerationsare composite names that can be passed back to the Context and DirContext methods. So, if the name contains a character that conflicts with the composite name syntax (such as the forward character "/"), the LDAP provider will provide an encoding to ensure that the slash will be treated as part of the LDAP name rather than as a composite name separator.
How do I get an LDAP entry's full distinguished name?
In the JNDI, all names are relative to a context. If you want an entry's full distinguished name, you need to keep track of its ancestors' names starting from the initial context. If there was a distinguished name specified in the Context.PROVIDER_URLproperty, then that needs to be inserted as the start of the distinguished name. See the Searches
lesson for details.
![]() ![]() ![]() ![]() |
Frequently Asked Questions |