Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database
Class DbGroupManager

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

public class DbGroupManager
extends GroupManagerAdapter

Database implementation of the GroupManager interface.


Constructor Summary
DbGroupManager()
           
 
Method Summary
 Group createGroup(long id, java.lang.String name)
           
 Group createGroup(java.lang.String name)
          Factory method for creating a new Group.
 void deleteGroup(Group group)
          Deletes a group from the system.
 int getGroupCount()
          Returns the total number of groups in the system.
 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.
 boolean isCreateGroupSupported()
          Indicate that createGroup(String name) is supported by default.
 boolean isDeleteGroupSupported()
          Indicate that deleteGroup(Group group) is supported by default.
 boolean isGetUserGroupsSupported()
          Indicate that getUserGroups(User user) is supported by default.
 boolean isGroupListSupported()
          Indicate that getGroups() is supported by default.
protected  Group lookupGroup(long groupID)
           
protected  Group lookupGroup(java.lang.String name)
           
protected  long[] lookupGroupsForUser(User user)
           
 
Methods inherited from class com.jivesoftware.base.GroupManagerAdapter
getGroup, getGroup, getGroupIDs, getUserGroups, isReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbGroupManager

public DbGroupManager()
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
Overrides:
createGroup in class GroupManagerAdapter
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.

createGroup

public Group createGroup(long id,
                         java.lang.String name)
                  throws GroupAlreadyExistsException
Throws:
GroupAlreadyExistsException

lookupGroup

protected Group lookupGroup(java.lang.String name)
                     throws GroupNotFoundException
Specified by:
lookupGroup in class GroupManagerAdapter
Throws:
GroupNotFoundException

lookupGroup

protected Group lookupGroup(long groupID)
                     throws GroupNotFoundException
Specified by:
lookupGroup in class GroupManagerAdapter
Throws:
GroupNotFoundException

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
Overrides:
deleteGroup in class GroupManagerAdapter
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
Overrides:
getGroupCount in class GroupManagerAdapter
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
Overrides:
getGroups in class GroupManagerAdapter
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
Overrides:
getGroups in class GroupManagerAdapter
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.

isCreateGroupSupported

public boolean isCreateGroupSupported()
Indicate that createGroup(String name) is supported by default.

Specified by:
isCreateGroupSupported in interface IntrospectiveGroupManager
Overrides:
isCreateGroupSupported in class GroupManagerAdapter
Returns:
true

isDeleteGroupSupported

public boolean isDeleteGroupSupported()
Indicate that deleteGroup(Group group) is supported by default.

Specified by:
isDeleteGroupSupported in interface IntrospectiveGroupManager
Overrides:
isDeleteGroupSupported in class GroupManagerAdapter
Returns:
true

isGroupListSupported

public boolean isGroupListSupported()
Indicate that getGroups() is supported by default.

Specified by:
isGroupListSupported in interface IntrospectiveGroupManager
Overrides:
isGroupListSupported in class GroupManagerAdapter
Returns:
true

isGetUserGroupsSupported

public boolean isGetUserGroupsSupported()
Indicate that getUserGroups(User user) is supported by default.

Specified by:
isGetUserGroupsSupported in interface IntrospectiveGroupManager
Overrides:
isGetUserGroupsSupported in class GroupManagerAdapter
Returns:
true

lookupGroupsForUser

protected long[] lookupGroupsForUser(User user)
Specified by:
lookupGroupsForUser in class GroupManagerAdapter

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.