Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base
Interface GroupManager

All Known Subinterfaces:
IntrospectiveGroupManager
All Known Implementing Classes:
DbGroupManager, GroupManagerAdapter, GroupManagerProxy, LdapGroupManager, LdapSearchGroupManager

public interface GroupManager

Manages groups.

In some cases, you may wish to plug in your own group system implementation. In that case, you should set the Jive property GroupManager.className with the name of your GroupManager class. Your class must have a public, no-argument constructor. The class must also create and return Group object implementations as necessary.

See Also:
Group

Method Summary
 Group createGroup(java.lang.String name)
          Factory method for creating a new Group.
 void deleteGroup(Group group)
          Deletes a group from the system.
 Group getGroup(long groupID)
          Gets a Group by ID.
 Group getGroup(java.lang.String name)
          Gets a Group by name.
 int getGroupCount()
          Returns the total number of groups in the system.
 LongList getGroupIDs(User user)
          Returns a list of group ids for all the groups that the user is a member of.
 java.util.Iterator getGroups()
          Returns an iterator for all groups in the system.
 java.util.Iterator getGroups(int startIndex, int numResults)
          Returns an iterator for all groups starting at startIndex with the given number of results.
 java.util.Iterator getUserGroups(User user)
          Returns an iterator for all groups that a user is a member of.
 

Method Detail

createGroup

Group createGroup(java.lang.String name)
                  throws GroupAlreadyExistsException
Factory method for creating a new Group. A unique name is the only required field.

Parameters:
name - the new and unique name for the group.
Returns:
a new group.
Throws:
GroupAlreadyExistsException - if the group name already exists in the system.

getGroup

Group getGroup(long groupID)
               throws GroupNotFoundException
Gets a Group by ID. throws GroupNotFoundException if the group does not exist.

Throws:
GroupNotFoundException

getGroup

Group getGroup(java.lang.String name)
               throws GroupNotFoundException
Gets a Group by name. throws GroupNotFoundException if the group does not exist.

Throws:
GroupNotFoundException

deleteGroup

void deleteGroup(Group group)
                 throws UnauthorizedException
Deletes a group from the system.

Parameters:
group - the group to delete.
Throws:
UnauthorizedException - if not a system administrator.

getGroupCount

int getGroupCount()
Returns the total number of groups in the system.

Returns:
the total number of groups.

getGroups

java.util.Iterator getGroups()
Returns an iterator for all groups in the system.

Returns:
an Iterator for all groups.

getGroups

java.util.Iterator getGroups(int startIndex,
                             int numResults)
Returns an iterator for all groups starting at startIndex with the given number of results. This is useful to support pagination in a GUI where you may only want to display a certain number of results per page. It is possible that the number of results returned will be less than that specified by numResults if numResults is greater than the number of records left in the system to display.

Parameters:
startIndex - the beginning index to start the results at.
numResults - the total number of results to return.
Returns:
an Iterator for all groups in the specified range.

getUserGroups

java.util.Iterator getUserGroups(User user)
Returns an iterator for all groups that a user is a member of.

Parameters:
user - the user to get a list of groups for.
Returns:
all groups that a user belongs to.

getGroupIDs

LongList getGroupIDs(User user)
Returns a list of group ids for all the groups that the user is a member of.

Parameters:
user - the user to get a list of groups for.
Returns:
all groups that a user belongs to.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.