Modifying group attribute

The following example demonstrates how to modify the groups description attribute.

Before you modify a group, you must fetch the group.

Groups do not have many attributes that can be modified.

// Fetch the group
String groupId = “testgroup”;
RgyGroup rgyGroup = null;
try {
	rgyGroup = rgyRegistry.getGroup(“Default”, groupId);
}
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);
}
// Replace the current attribute
try {
	rgyGroup.attributeReplace(RgyAttributes.DESCRIPTION_NAME, 
“Replacement Description”);
}
catch (RgyException e) {
	e.printStackTrace();
	System.exit(1);
}
// Remove the description attribute
try {
	rgyGroup.attributeDelete(RgyAttributes.DESCRIPTION_NAME);
}
catch (RgyException e) {
	e.printStackTrace();
	System.exit(1);
}