Create a group

The following sample demonstrates how to create an ISAM group called testgroup with LDAP DN cn=testgroup,o=ibm,c=us. Example:

String groupId = "testgroup";
String groupCn = “testgroup”;
String groupNativeId = "cn=testgroup,o=ibm,c=us”;
RgyAttributes rgyAttributes = rgyRegistry.newRgyAttributes();
rgyAttributes.putAttribute(RgyAttributes.COMMON_NAME_NAME, groupCn);
rgyAttributes.putAttribute(RgyAttributes.DESCRIPTION_NAME, 
"This is a test Group");
RgyGroup rgyGroup = null;
try {
rgyGroup = rgyRegistry.createGroup(“Default”, groupId, groupNativeId, 
rgyAttributes);
}catch (RgyException e) {
e.printStackTrace();
System.exit(1);
}
This example obtains a RgyAttributes instance to create the group and set the group attributes, assuming the ISAM domain is default and that it contains a suffix o=ibm,c=us in LDAP.

Parent topic: Groups