Skip to Content
author's profile photo Former Member
Former Member

Retrieve Data source for a user in UME

Can anyone please let me know how I can find the data source of a user account in UME using the UME AP I?

Thanks.

datasource.jpg (38.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2012 at 05:52 PM

    I got the answer,

    String [] ds = user.getAttribute(IPrincipal.DEFAULT_NAMESPACE, IPrincipal.DATASOURCE);

    log("User data source -- "

    + ds[0]);

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 06, 2012 at 05:06 AM

    Ranjith

    What is the need to know the datasource ar runtime?? Its already known while configuration..

    Anyways, you can get it from the IUser Object ...This object has a Constant Field - Datasource

    The code could be -

    Iuser userObj = UMFactory.getUserFactory().GetUser() <thru logon id or something>

    read the datasource contant from the object..

    Else, get the datasource from the Unique ID of the User....The unique ID contains a format

    <DatasourceName.UserID> if I remember correctly.

    Give it a try and see if it works..

    Sandip

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sandip,

      UME is configured to pull data from 2 data sources (LDAP, EXTERNAL_LDAP). My objective is to get all users from the data source EXTERNAL_LDAP.

      user.getUniqueName() -- is returning just the userid.

      user.getUniqueID() -- is returning "USER.EXTERNAL_LDAP.<userid>"

      So, I thought of getting all the users using

      ISearchResult result = userFactory.getUniqueIDs();

      and then looping result to get only those users that start with "USER.EXTERNAL_LDAP". But somehow this code is not working fine in all environments. I get the results in sandbox and dev but when I try to run the code in QA, I get only 400 users at a time.

      Can you please help me with this ?

      I also tried this code to just retrive users from EXTERNAL_LDAP.

      IUserFactory userFactory = UMFactory.getUserFactory();

      ISearchResult result = userFactory.getUniqueIDs();

      log(result.size());

      IUserSearchFilter sf = userFactory.getUserSearchFilter();

      sf.setUniqueName("*USER.EXTERNAL_LDAP.*", ISearchAttribute.LIKE_OPERATOR, false);

      ISearchResult sr = userFactory.searchUsers(sf);

      log(sr.size());

      result -- returns all the users from LDAP & EXTERNAL_LDAP.

      sr - returns 0

      As I mentioned earlier, as user.getUniqueName() is not giving me the result in the format, "USER.EXTERNAL_LDAP.<userid>", I am not able to use this code to filter the users based on uniquename. Also, I dont see any search filter like sf.setUniquerID(...)

      Please help. !!

  • author's profile photo Former Member
    Former Member
    Posted on Apr 06, 2012 at 05:08 AM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.