Jive API (3.0.13) Core Javadocs

com.jivesoftware.base
Interface GroupManager

All Superinterfaces:
JiveManager
All Known Subinterfaces:
IntrospectiveGroupManager

public interface GroupManager
extends JiveManager

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(String name)
          Factory method for creating a new Group.
 void deleteGroup(Group group)
          Deletes a group from the system.
 void deleteUserGroupAssociations(User user)
          Deletes all group membership and group administrative associations related to the given user from the system.
 Group getGroup(long groupID)
          Gets a Group by ID.
 Group getGroup(long groupID, boolean force)
          Loads a group by id, optionally forcing a direct lookup in the system of record if the force parameter is true.
 Group getGroup(String name)
          Gets a Group by name.
 int getGroupCount()
          Returns the total number of groups in the system.
 Iterable<Group> getGroups()
          Returns an iterator for all groups in the system.
 Iterable<Group> getGroups(int startIndex, int numResults)
          Returns an iterator for all groups starting at startIndex with the given number of results.
 Iterable<Group> getUserGroups(User user)
          Returns an iterator for all groups that a user is a member of.
 void update(Group group)
          Updates the given group.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

createGroup

Group createGroup(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.

Parameters:
groupID - the id of the group to return
Returns:
a group
Throws:
GroupNotFoundException - if the group does not exist.

getGroup

Group getGroup(String name)
               throws GroupNotFoundException
Gets a Group by name.

Parameters:
name - the name of the group to return
Returns:
a group
Throws:
GroupNotFoundException - if the group does not exist.

getGroup

Group getGroup(long groupID,
               boolean force)
               throws GroupNotFoundException
Loads a group by id, optionally forcing a direct lookup in the system of record if the force parameter is true.

Parameters:
groupID - ID of the group to lookup
force - if true forces a hard lookup bypassing cache
Returns:
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.

deleteUserGroupAssociations

void deleteUserGroupAssociations(User user)
                                 throws UnauthorizedException
Deletes all group membership and group administrative associations related to the given user from the system.

Parameters:
user - the user will no longer be a member of any Group, or administrator of any Group.
Throws:
UnauthorizedException - if not a system administrator or user administrator.

getGroupCount

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

Returns:
the total number of groups.

getGroups

Iterable<Group> getGroups()
Returns an iterator for all groups in the system.

Returns:
an Iterator for all groups.

getGroups

Iterable<Group> 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

Iterable<Group> 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.

update

void update(Group group)
            throws GroupNotFoundException,
                   GroupAlreadyExistsException
Updates the given group.

Parameters:
group - the group to be updated
Throws:
GroupNotFoundException - if the group could not be loaded to be updated.
GroupAlreadyExistsException - if the group already exists.

Jive Product Page

Copyright © 1999-2007 Jive Software.