Adding a person entry

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

Before you begin

Depending on how your system administrator customized your system, you might not have access to this task. To obtain access to this task or to have someone complete it for you, contact your system administrator.

Ensure that you have initialized the context.

About this task

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 you want to add. This class is typically inetOrgPerson, but other objectclasses can be used by defining them through the Entity Configuration feature in the Identity Manager Server. Add the required objectclass as a new entity, with "Entity Type" = "Person".

To add a person, complete these steps:

Procedure

  1. Define the DN of the person you want to add.
  2. Create an Attributes object to contain the list of Attribute objects for the new user.
  3. Call createSubContext on the context.

Results

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);

What to do next

You can do these tasks:
  • Add another person entry
  • Modify the information of a person entry
  • Remove a person entry