Deleting Groups
Prerequisites
You have imported the required interfaces and gotten the required factories.
More information: User Management Functions for Groups .
Context
This procedure describes how to delete a group programmatically. Use this procedure if you cannot use the existing user administration tools to perform group deletion and need to customize your tools to delete groups programmatically.
Procedure
Example
This example gets the group object, demo_group, then deletes it.
public static void deleteGroup(String groupUniqueName) {
try {
// Get the group.
IGroup group = groupFactory.getGroupByUniqueName(groupUniqueName);
// Delete the group.
groupFactory.deleteGroup(group.getUniqueID());
} catch (NoSuchGroupException nsgex) {
// TODO: Handle NoSuchGroupException.
} catch (UMException umex) {
// TODO: Handle UMException.
} catch (UMRuntimeException umrex) {
// TODO: Handle UMRuntimeException.
}
}