Add a person entry

The attributes for adding a person are the same as the attributes used in the file reconciliation method..

Ensure that we have initialized the context.

The attributes for adding a person are the same as the attributes used in the file reconciliation method. The DN for the new person entry must include at a minimum a unique attribute used to identify the person, such as the uid. The JavaScript placement rule defined for the DSML Identity Feed service is used to determine the organizational unit to which the person entry is added. If organization information is not provided, the person is added to the root of the organization. (The DN is specified through the createSubcontext / destroySubcontext / modifyAttributes methods in the following example).

The objectclass attribute must be defined and must match the LDAP object class that is mapped to the person type to add. This class is typically inetOrgPerson, but other objectclasses can be used by defining them through the Entity Configuration feature in ISIM Server. Add the required objectclass as a new entity, with "Entity Type" = "Person".

To add a person...

  1. Define the DN of the person to add.

  2. Create an Attributes object to contain the list of Attribute objects for the new user.
  3. Call createSubContext on the context.

After creating the DN and the attributes for the person, a call to createSubcontext is made with the JNDI context.


Example

BasicAttributes ba = new BasicAttributes(true);
ba.put(new BasicAttribute("objectclass","inetorgperson"));
ba.put(new BasicAttribute("uid", uid)); 
ba.put(new BasicAttribute("cn", "JoeSmith"));
ba.put(new BasicAttribute("mail", uid + "@acme.com"));  

damlContext.createSubcontext("uid="+ uid, ba);

We can do these tasks:

Parent topic: Event notifications of HR data