|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.messenger.group.DefaultGroupProvider
public class DefaultGroupProvider
Database implementation of the GroupManager interface.
Constructor Summary | |
---|---|
DefaultGroupProvider()
|
Method Summary | |
---|---|
void |
addMember(String groupName,
String username,
boolean administrator)
Adds a user to a group (optional operation). |
Group |
createGroup(String name)
Creates a group with the given name (optional operation). |
void |
deleteGroup(String groupName)
Deletes the group (optional operation). |
void |
deleteMember(String groupName,
String username)
Deletes a user from a group (optional operation). |
Group |
getGroup(String name)
Returns a group based on it's name. |
int |
getGroupCount()
Returns the number of groups in the system. |
Collection<Group> |
getGroups()
Returns the Collection of all groups in the system. |
Collection<Group> |
getGroups(int startIndex,
int numResults)
Returns the Collection of all groups in the system. |
Collection<Group> |
getGroups(User user)
Returns the Collection of Groups that a user belongs to. |
boolean |
isReadOnly()
Returns true if this GroupProvider is read-only. |
void |
setDescription(String name,
String description)
Updates the group's description. |
void |
setName(String oldName,
String newName)
Sets the name of a group to a new name. |
void |
updateMember(String groupName,
String username,
boolean administrator)
Updates the privileges of a user in a group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultGroupProvider()
Method Detail |
---|
public Group createGroup(String name) throws GroupAlreadyExistsException
GroupProvider
The provider is responsible for setting the creation date and modification date to the current date/time.
createGroup
in interface GroupProvider
name
- name of the group.
GroupAlreadyExistsException
- if a group with the same name already
exists.public Group getGroup(String name) throws GroupNotFoundException
GroupProvider
getGroup
in interface GroupProvider
name
- the name of the group.
GroupNotFoundException
- If no group with that ID could be foundpublic void setDescription(String name, String description) throws GroupNotFoundException
GroupProvider
setDescription
in interface GroupProvider
name
- the group name.description
- the group description.
GroupNotFoundException
- if no existing group could be found to update.public void setName(String oldName, String newName) throws UnsupportedOperationException, GroupAlreadyExistsException
GroupProvider
setName
in interface GroupProvider
oldName
- the current name of the group.newName
- the desired new name of the group.
UnsupportedOperationException
- if the provider does not
support the operation.
GroupAlreadyExistsException
- if a group with the same name already
exists.public void deleteGroup(String groupName)
GroupProvider
deleteGroup
in interface GroupProvider
groupName
- the name of the group to delete.public int getGroupCount()
GroupProvider
getGroupCount
in interface GroupProvider
public Collection<Group> getGroups()
GroupProvider
getGroups
in interface GroupProvider
public Collection<Group> getGroups(int startIndex, int numResults)
GroupProvider
getGroups
in interface GroupProvider
startIndex
- start index in results.numResults
- number of results to return.
public Collection<Group> getGroups(User user)
GroupProvider
getGroups
in interface GroupProvider
user
- the user.
public void addMember(String groupName, String username, boolean administrator)
GroupProvider
addMember
in interface GroupProvider
groupName
- the group to add the member tousername
- the username to addadministrator
- True if the member is an administrator of the grouppublic void updateMember(String groupName, String username, boolean administrator)
GroupProvider
updateMember
in interface GroupProvider
groupName
- the group where the change happenedusername
- the username to of the user with new privilegesadministrator
- True if the member is an administrator of the grouppublic void deleteMember(String groupName, String username)
GroupProvider
deleteMember
in interface GroupProvider
groupName
- the group name.username
- the username.public boolean isReadOnly()
GroupProvider
isReadOnly
in interface GroupProvider
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |