Hello,
I am using the Java JDK 1.6.x to query ldap. I am using the query below. However, I need to be able to pull out the operational attributes as well. Any thoughts on how I can obtain the list of operational attributes without having to specify them?
SearchControls searchCtls = new SearchControls(); searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE); NamingEnumeration results = ctx.search( config.getBaseDn(), searchFilter, searchCtls);
while (results != null && results.hasMore()) { SearchResult sr = (SearchResult)results.next(); Attributes searchAttrs = sr.getAttributes();
if (searchAttrs != null ) { NamingEnumeration values = searchAttrs.getAll(); while (values.hasMore()) { javax.naming.directory.Attribute atr = (javax.naming.directory.Attribute)values.next();
thanks for your help
On 3/19/11 6:23 AM, Suneet Shah wrote:
Hello,
I am using the Java JDK 1.6.x to query ldap. I am using the query below. However, I need to be able to pull out the operational attributes as well. Any thoughts on how I can obtain the list of operational attributes without having to specify them?
http://download.oracle.com/javase/jndi/tutorial/ldap/misc/attrs.html
Hello,
thanks for providing the link below. According to the link it says that I need to specify the list of operational attributes in order to be able to obtain the values for them. Is there a way to programatically determine the list of attributes that are available for an object so that dynamically build that list?
thanks for your help suneet
On Sat, Mar 19, 2011 at 3:58 AM, Emmanuel Lecharny elecharny@gmail.comwrote:
On 3/19/11 6:23 AM, Suneet Shah wrote:
Hello,
I am using the Java JDK 1.6.x to query ldap. I am using the query below. However, I need to be able to pull out the operational attributes as well. Any thoughts on how I can obtain the list of operational attributes without having to specify them?
http://download.oracle.com/javase/jndi/tutorial/ldap/misc/attrs.html
-- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
On 3/25/11 11:44 PM, Suneet Shah wrote:
Hello,
thanks for providing the link below. According to the link it says that I need to specify the list of operational attributes in order to be able to obtain the values for them. Is there a way to programatically determine the list of attributes that are available for an object so that dynamically build that list?
You can pass the '+' special attribute, in combinaison to the special '1.1' attribute, to get the list of available operational attributes, and only those (excluding the values). Then you can select the ones that you want the values for, and resend a request with the specific attributes.
Keep in mind that Operational attributes are not associated with an ObjectClass. They are also specific to a server, except a few ones that are mandatory whatever the Ldap server you will address.
Bottom line, you'd better know which Op Attr you want to manipulate, and you also have to understand that most of them are purely for the server internal use.
Thanks Emmanuel,
If combine it into the following I can get what appears to be complete list
String attrIds[] = {"1.1","+","*"};
SearchControls searchCtls = new SearchControls(); searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE); searchCtls.setReturningAttributes(attrIds);
Regards suneet
On Fri, Mar 25, 2011 at 7:00 PM, Emmanuel Lécharny elecharny@apache.orgwrote:
On 3/25/11 11:44 PM, Suneet Shah wrote:
Hello,
thanks for providing the link below. According to the link it says that I need to specify the list of operational attributes in order to be able to obtain the values for them. Is there a way to programatically determine the list of attributes that are available for an object so that dynamically build that list?
You can pass the '+' special attribute, in combinaison to the special '1.1' attribute, to get the list of available operational attributes, and only those (excluding the values). Then you can select the ones that you want the values for, and resend a request with the specific attributes.
Keep in mind that Operational attributes are not associated with an ObjectClass. They are also specific to a server, except a few ones that are mandatory whatever the Ldap server you will address.
Bottom line, you'd better know which Op Attr you want to manipulate, and you also have to understand that most of them are purely for the server internal use.
-- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
openldap-technical@openldap.org