Class UpdateGroup

java.lang.Object
org.forgerock.opendj.examples.UpdateGroup

public final class UpdateGroup extends Object
This command-line client demonstrates adding and removing a member from a (potentially large) static group. The client takes as arguments the host and port of the directory server, the group DN, the member DN, and whether to "add" or "del" the specified member from the group. The client uses the Permissive Modify control if it is available to avoid having to check whether the member belongs to the group or not. This client expects a group that is a groupOfNames such as:
 dn: cn=My Static Group,ou=Groups,dc=example,dc=com
 cn: My Static Group
 objectClass: groupOfNames
 objectClass: top
 ou: Groups
 member: uid=ahunter,ou=People,dc=example,dc=com
 member: uid=bjensen,ou=People,dc=example,dc=com
 member: uid=tmorris,ou=People,dc=example,dc=com
 
This client connects as cn=Directory Manager with password password. Not a best practice; in real code use application specific credentials to connect, and ensure that your application has access to use the Permissive Modify control if your directory server supports it.
  • Method Details

    • main

      public static void main(String[] args)
      Connect to the directory server to update the group.
      Parameters:
      args - The command line arguments: host, port, group-dn, member-dn, {add|del}