Importing a native group
Existing native LDAP groups
can be imported as Verify Identity Access groups.
Obtain the native LDAP group information as aRgyGroup instance,
then invoke the RgyGroup.importNativeGroup() method.
The following sample shows the sample code to import the native group as Verify Identity Access group:
// First fetch the Native Entity
String groupNativeId = "cn=testgroup,o=ibm,c=us”;
RgyGroup rgyGroup = null;
try {
rgyGroup = rgyRegistry.getNativeGroup(“Default”, groupNativeId);
}
catch (RgyException e) {
e.printStackTrace();
System.exit(1);
}
// Ensure the group was found
if (rgyGroup == null) {
System.out.println(“Group does not exist”);
System.exit(1);
}
// Only import, if not already a TAM group (isSecEntity=FALSE)
String isSecEntity = (String) rgyGroup.getOneAttributeValue
(RgyAttributes. IS_SEC_ENTITY_NAME);
if (isSecEntity.equalsIgnoreCase(RgyAttributes. BOOL_FALSE_VALUE)) {
String groupId = "testgroup";
RgyAttributes rgyAttributes = rgyRegistry.newRgyAttributes();
try {
rgyGroup.importNativeGroup(groupId, rgyAttributes);
}
catch (RgyException e) {
e.printStackTrace();
System.exit(1);
}
}