public static String updateWorkgroup(String workgroupName, String displayName,
String description, int maxSize, int minSize, long requestTimeout, long offerTimeout)
{
final WorkgroupManager workgroupManager = WorkgroupManager.getInstance();
Workgroup workgroup;
try {
workgroup = workgroupManager.getWorkgroup(new JID(workgroupName));
}
catch (UserNotFoundException e) {
return getUpdateMessage(false, "The JID specified is invalid.");
}
workgroup.setDisplayName(displayName);
workgroup.setDescription(description);
if (maxSize < minSize) {
return getUpdateMessage(false, "Max size must be greater or equal to min size.");
}
workgroup.setMaxChats(maxSize);
workgroup.setMinChats(minSize);
workgroup.setRequestTimeout(requestTimeout);
workgroup.setOfferTimeout(offerTimeout);
return getUpdateMessage(true, "Workgroup has been updated");
}