Announcement Announcement Module
Collapse
No announcement yet.
Attribute Names to be fetched available only at runtime. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attribute Names to be fetched available only at runtime.

    If the attributes to be fetched are only available at runtime, is it possible to use ContextMapper for such type of operation.I believe DirContextAdapter context object will contain all the attributes possible for a given DN, is that right?

    What I mean is, let's say I have an entity bean which represents any type of object in LDAP.It contains mapping/property for all the possible attributes which can be requested (which will be of type String or String array or X509Certificate[] because I forsee a request for it). Also, it will contain a property of type object because I might want to fetch a custom attribute.

    So how do I fetch an attribute whose name is available only at runtime?

  • #2
    If you want to get a listing of the returned attributes you'll need to call DirContextAdapter.getAttributes() and loop over the Attributes.

    What you would probably want to do however is check out the objectclass attribute (dirContextAdapter.getStringAttributes("objectclas s")). The objectclass attribute values define the Attributes that are valid for an entry, so based on that you should be able to figure out what attributes you are supposed to retrieve for a given entry.

    Comment


    • #3
      Btw if you use DirContextAdapter.getAttributes() you might as well use an AttributesMapper right away, because that will give you the Attributes right away.

      Comment

      Working...
      X