public class DefaultGroupProvider extends AbstractGroupProvider
| Constructor and Description |
|---|
DefaultGroupProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(String groupName,
org.xmpp.packet.JID user,
boolean administrator)
Adds an entity 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,
org.xmpp.packet.JID user)
Deletes an entity 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<String> |
getGroupNames()
Returns the Collection of all group names in the system.
|
Collection<String> |
getGroupNames(int startIndex,
int numResults)
Returns the Collection of all groups in the system.
|
Collection<String> |
getGroupNames(org.xmpp.packet.JID user)
Returns the Collection of group names that an entity belongs to.
|
boolean |
isReadOnly()
Always true for a read-only provider
|
boolean |
isSearchSupported()
Returns true if the provider supports group search capability.
|
boolean |
isSharingSupported()
Returns true if this GroupProvider allows group sharing.
|
Collection<String> |
search(String query)
Returns a collection of group search results.
|
Collection<String> |
search(String query,
int startIndex,
int numResults)
Returns a collection of group search results.
|
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,
org.xmpp.packet.JID user,
boolean administrator)
Updates the privileges of an entity in a group.
|
getPublicSharedGroupNames, getSharedGroupNames, getSharedGroupNames, getVisibleGroupNames, loadProperties, searchpublic Group createGroup(String name)
GroupProviderThe provider is responsible for setting the creation date and modification date to the current date/time.
createGroup in interface GroupProvidercreateGroup in class AbstractGroupProvidername - name of the group.public Group getGroup(String name) throws GroupNotFoundException
GroupProvidername - the name of the group.GroupNotFoundException - If no group with that ID could be foundpublic void setDescription(String name, String description) throws GroupNotFoundException
GroupProvidersetDescription in interface GroupProvidersetDescription in class AbstractGroupProvidername - 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 GroupAlreadyExistsException
GroupProvidersetName in interface GroupProvidersetName in class AbstractGroupProvideroldName - the current name of the group.newName - the desired new name of the group.GroupAlreadyExistsException - if a group with the same name already
exists.public void deleteGroup(String groupName)
GroupProviderdeleteGroup in interface GroupProviderdeleteGroup in class AbstractGroupProvidergroupName - the name of the group to delete.public int getGroupCount()
GroupProviderpublic Collection<String> getGroupNames()
GroupProviderpublic Collection<String> getGroupNames(int startIndex, int numResults)
GroupProviderstartIndex - start index in results.numResults - number of results to return.public Collection<String> getGroupNames(org.xmpp.packet.JID user)
GroupProvideruser - the JID of the entity.public void addMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
GroupProvideraddMember in interface GroupProvideraddMember in class AbstractGroupProvidergroupName - the group to add the member touser - the JID of the entity to addadministrator - True if the member is an administrator of the grouppublic void updateMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
GroupProviderupdateMember in interface GroupProviderupdateMember in class AbstractGroupProvidergroupName - the group where the change happeneduser - the JID of the entity with new privilegesadministrator - True if the member is an administrator of the grouppublic void deleteMember(String groupName, org.xmpp.packet.JID user)
GroupProviderdeleteMember in interface GroupProviderdeleteMember in class AbstractGroupProvidergroupName - the group name.user - the JID of the entity to delete.public boolean isReadOnly()
AbstractGroupProviderisReadOnly in interface GroupProviderisReadOnly in class AbstractGroupProviderpublic Collection<String> search(String query)
AbstractGroupProvidersearch in interface GroupProvidersearch in class AbstractGroupProviderquery - the search string for group names.public Collection<String> search(String query, int startIndex, int numResults)
AbstractGroupProvidersearch in interface GroupProvidersearch in class AbstractGroupProviderquery - the search string for group names.startIndex - start index in results.numResults - number of results to return.public boolean isSearchSupported()
AbstractGroupProviderisSearchSupported in interface GroupProviderisSearchSupported in class AbstractGroupProviderpublic boolean isSharingSupported()
GroupProviderisSharingSupported in interface GroupProviderisSharingSupported in class AbstractGroupProviderCopyright © 2003-2008 Jive Software.