Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base
Class GroupManagerAdapter

java.lang.Object
  extended by com.jivesoftware.base.GroupManagerAdapter
All Implemented Interfaces:
GroupManager, IntrospectiveGroupManager
Direct Known Subclasses:
DbGroupManager

public abstract class GroupManagerAdapter
extends java.lang.Object
implements IntrospectiveGroupManager


Constructor Summary
GroupManagerAdapter()
           
 
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.
 boolean isCreateGroupSupported()
          Indicates whether the GroupManager supports creating groups via the createGroups() method.
 boolean isDeleteGroupSupported()
          Indicates whether the GroupManager supports deleting groups via the deleteGroups() method.
 boolean isGetUserGroupsSupported()
          Indicates whether the GroupManager supports getting a listing of all groups for a given user via the getUserGroups() method.
 boolean isGroupListSupported()
          Indicates whether the GroupManager supports getting a listing of all groups via the getGroups() method.
 boolean isReadOnly()
           
protected abstract  Group lookupGroup(long groupID)
           
protected abstract  Group lookupGroup(java.lang.String name)
           
protected abstract  long[] lookupGroupsForUser(User user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupManagerAdapter

public GroupManagerAdapter()
Method Detail

createGroup

public Group createGroup(java.lang.String name)
                  throws GroupAlreadyExistsException
Description copied from interface: GroupManager
Factory method for creating a new Group. A unique name is the only required field.

Specified by:
createGroup in interface GroupManager
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.

deleteGroup

public void deleteGroup(Group group)
                 throws UnauthorizedException
Description copied from interface: GroupManager
Deletes a group from the system.

Specified by:
deleteGroup in interface GroupManager
Parameters:
group - the group to delete.
Throws:
UnauthorizedException - if not a system administrator.

getGroupCount

public int getGroupCount()
Description copied from interface: GroupManager
Returns the total number of groups in the system.

Specified by:
getGroupCount in interface GroupManager
Returns:
the total number of groups.

getGroups

public java.util.Iterator getGroups()
Description copied from interface: GroupManager
Returns an iterator for all groups in the system.

Specified by:
getGroups in interface GroupManager
Returns:
an Iterator for all groups.

getGroups

public java.util.Iterator getGroups(int startIndex,
                                    int numResults)
Description copied from interface: GroupManager
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.

Specified by:
getGroups in interface GroupManager
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.

getGroup

public Group getGroup(long groupID)
               throws GroupNotFoundException
Description copied from interface: GroupManager
Gets a Group by ID. throws GroupNotFoundException if the group does not exist.

Specified by:
getGroup in interface GroupManager
Throws:
GroupNotFoundException

getGroup

public Group getGroup(java.lang.String name)
               throws GroupNotFoundException
Description copied from interface: GroupManager
Gets a Group by name. throws GroupNotFoundException if the group does not exist.

Specified by:
getGroup in interface GroupManager
Throws:
GroupNotFoundException

getUserGroups

public java.util.Iterator getUserGroups(User user)
Description copied from interface: GroupManager
Returns an iterator for all groups that a user is a member of.

Specified by:
getUserGroups in interface GroupManager
Parameters:
user - the user to get a list of groups for.
Returns:
all groups that a user belongs to.

getGroupIDs

public LongList getGroupIDs(User user)
Description copied from interface: GroupManager
Returns a list of group ids for all the groups that the user is a member of.

Specified by:
getGroupIDs in interface GroupManager
Parameters:
user - the user to get a list of groups for.
Returns:
all groups that a user belongs to.

lookupGroupsForUser

protected abstract long[] lookupGroupsForUser(User user)

lookupGroup

protected abstract Group lookupGroup(java.lang.String name)
                              throws GroupNotFoundException
Throws:
GroupNotFoundException

lookupGroup

protected abstract Group lookupGroup(long groupID)
                              throws GroupNotFoundException
Throws:
GroupNotFoundException

isCreateGroupSupported

public boolean isCreateGroupSupported()
Description copied from interface: IntrospectiveGroupManager
Indicates whether the GroupManager supports creating groups via the createGroups() method.

Specified by:
isCreateGroupSupported in interface IntrospectiveGroupManager
Returns:
true if creating a new group through the GroupManager is supported.

isDeleteGroupSupported

public boolean isDeleteGroupSupported()
Description copied from interface: IntrospectiveGroupManager
Indicates whether the GroupManager supports deleting groups via the deleteGroups() method.

Specified by:
isDeleteGroupSupported in interface IntrospectiveGroupManager
Returns:
true if deleting a group through the GroupManager is supported.

isGroupListSupported

public boolean isGroupListSupported()
Description copied from interface: IntrospectiveGroupManager
Indicates whether the GroupManager supports getting a listing of all groups via the getGroups() method.

Specified by:
isGroupListSupported in interface IntrospectiveGroupManager
Returns:
true if getGroups() is implemented.

isGetUserGroupsSupported

public boolean isGetUserGroupsSupported()
Description copied from interface: IntrospectiveGroupManager
Indicates whether the GroupManager supports getting a listing of all groups for a given user via the getUserGroups() method.

Specified by:
isGetUserGroupsSupported in interface IntrospectiveGroupManager
Returns:
true if getUserGroups(User user) is implemented.

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface IntrospectiveGroupManager

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.