Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Develop with virtual member manager > Integrate virtual member manager into the application > Program tasks


Get the properties of an entity

Use the get(DataObject) method to obtain the properties of entities, group membership, group members, ancestors, and descendents by specifying the corresponding control.


About this task

In this example, the request is for the uid, cn, sn, telephoneNumber, and createTimeStamp of Person Admin.

To obtain the properties of uid, cn, sn, telephoneNumber, and createTimeStamp of Person Admin, add the following sample code to the application code and replace the variables with the actual values to use for this request:

DataObject root = SDOHelper.createRootDataObject();
DataObject entity = SDOHelper.createEntityDataObject(root, null, DO_PERSON_ACCOUNT);
entity.createDataObject(DO_IDENTIFIER).set(PROP_UNIQUE_NAME,
                             "uid=SalesManager,cn=users,dc=yourco,dc=com");
DataObject propCtrl = SDOHelper.createControlDataObject(root, null, DO_PROPERTY_CONTROL);
propCtrl.getList(PROP_PROPERTIES).add("sn");
propCtrl.getList(PROP_PROPERTIES).add("uid");
propCtrl.getList(PROP_PROPERTIES).add("cn");
propCtrl.getList(PROP_PROPERTIES).add("telephoneNumber");
propCtrl.getList(PROP_PROPERTIES).add("createTimestamp");

root = service.get(root);


Sample input and output data graphs

For this particular example the input data graph is:

<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
               xmlns:sdo="commonj.sdo"
               xmlns:wim="//www.ibm.com/websphere/wim">
<wim:Root>
<wim:entities xsi:type="wim:PersonAccount">
<wim:identifier uniqueName="uid=SalesManager,cn=users,dc=yourco,dc=com"/>
</wim:entities>
<wim:controls xsi:type="wim:PropertyControl">
<wim:properties>sn
</wim:properties>
<wim:properties>uid
</wim:properties>
<wim:properties>cn
</wim:properties>
<wim:properties>telephoneNumber
</wim:properties>
<wim:properties>createTimestamp
</wim:properties>
</wim:controls>
</wim:Root>
</sdo:datagraph> 

The resulting output data graph is:

<sdo:datagraph xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
               xmlns:sdo="commonj.sdo"
               xmlns:wim="//www.ibm.com/websphere/wim">
<wim:Root>
<wim:entities xsi:type="wim:PersonAccount">
<wim:identifier externalName="uid=SalesManager,cn=users,dc=yourco,dc=com"
                      repositoryId="LDAP1"
                      uniqueId="5e846c20-a1b4-4bfc-bce2-1f841d762f9a"
                      uniqueName="uid=SalesManager,cn=users,dc=yourco,dc=com"/>
<wim:createTimestamp>2005-10-17T14:13:26.0Z
</wim:createTimestamp>
<wim:uid>SalesManager
</wim:uid>
<wim:cn>Sales Manager </wim:cn>
<wim:sn>SalesMgrSn
</wim:sn>
<wim:telephoneNumber>11111111
</wim:telephoneNumber>
<wim:telephoneNumber>22222222
</wim:telephoneNumber>
</wim:entities>
</wim:Root>
</sdo:datagraph> 

For end-to-end sample code, see the topic, Sample code for working with users, groups, group members, and group memberships.

Parent topic: Program tasks


Related


get method

+

Search Tips   |   Advanced Search