edu.northwestern.at.wordhoard.swing.calculator.modelutils
Class UserGroupUtils

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.modelutils.UserGroupUtils

public class UserGroupUtils
extends java.lang.Object

Work set utilities.


Constructor Summary
protected UserGroupUtils()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static UserGroup createUserGroup(UserGroup userGroup)
          Create a new UserGroup.
static boolean deleteUserGroup(UserGroup userGroup)
          Delete a UserGroup.
static java.util.Collection getUserGroups()
          Get all usergroups.
static java.util.Collection getUserGroups(java.lang.String member)
          Get all usergroups associated with a specific user.
static boolean updateUserGroup(UserGroup userGroup)
          Update UserGroup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserGroupUtils

protected UserGroupUtils()
Don't allow instantiation but do allow overrides.

Method Detail

createUserGroup

public static UserGroup createUserGroup(UserGroup userGroup)
                                 throws BadOwnerException
Create a new UserGroup.

Parameters:
userGroup - The group.
Returns:
UserGroup object if created, else null.
Throws:
BadOwnerException - if the owner is null or empty.

updateUserGroup

public static boolean updateUserGroup(UserGroup userGroup)
                               throws BadOwnerException
Update UserGroup.

Returns:
UserGroup object
Throws:
BadOwnerException - if the owner is null or empty or not admin.

deleteUserGroup

public static boolean deleteUserGroup(UserGroup userGroup)
Delete a UserGroup.

Parameters:
userGroup - The UserGroup to delete.
Returns:
true if work set deleted, false otherwise.

The currently logged in user must be the owner to delete an UserGroup.


getUserGroups

public static java.util.Collection getUserGroups(java.lang.String member)
Get all usergroups associated with a specific user.

Parameters:
member - The tag of the user group member.
Returns:
All available user groups for the member.

getUserGroups

public static java.util.Collection getUserGroups()
Get all usergroups.

Returns:
All available user groups.