java - Getting Internal Attributes of LDAP Object -
i trying fetch ldap user internal attributes, couldn't find how fetch them
dircontext ctx = this.getdircontext(); list<employee> list = new arraylist<employee>(); namingenumeration<searchresult> results = null; try { searchcontrols controls = new searchcontrols(); controls.setsearchscope(searchcontrols.subtree_scope); results = ctx.search("", "(objectclass=person)", controls); while (results.hasmore()) { searchresult searchresult = results.next(); attributes attributes = searchresult.getattributes(); string fullname = this.getvalue(attributes.get("cn")); //so on... } // on
from ldap, want fetch each employee/person internal attributes too. default, it's not returning internal attributes [ex: createtimestamp]
you won't operational attributes unless ask them. @ present aren't asking attributes, equivalent constructing searchcontrols
, or calling searchcontrols.setreturningattributes(string[])
afterwards, using argument new string[]{"*"}:
this gives non-operational attributes.
to operational attributes well, use argument new string[]{"*","+"}
.
Comments
Post a Comment