Package org.jivesoftware.openfire.group
Class DefaultGroupProvider
java.lang.Object
org.jivesoftware.openfire.group.AbstractGroupProvider
org.jivesoftware.openfire.group.DefaultGroupProvider
- All Implemented Interfaces:
GroupProvider
Database implementation of the GroupManager interface.
- Author:
- Matt Tucker
-
Field Summary
Fields inherited from class org.jivesoftware.openfire.group.AbstractGroupProvider
SHARED_GROUP_RECURSIVE, sharedGroupMetaCache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an entity to a group (optional operation).createGroup(String name) Creates a group with the given name (optional operation).voiddeleteGroup(String groupName) Deletes the group (optional operation).voiddeleteMember(String groupName, org.xmpp.packet.JID user) Deletes an entity from a group (optional operation).Returns a group based on its name.intReturns the number of groups in the system.Returns the Collection of all group names in the system.getGroupNames(int startIndex, int numResults) Returns the Collection of all groups in the system.getGroupNames(org.xmpp.packet.JID user) Returns the Collection of group names that an entity belongs to.booleanAlways true for a read-only providerbooleanReturns true if the provider supports group search capability.booleanReturns true if this GroupProvider allows group sharing.Returns a collection of group search results.Returns a collection of group search results.voidsetDescription(String name, String description) Updates the group's description.voidSets the name of a group to a new name.voidupdateMember(String groupName, org.xmpp.packet.JID user, boolean administrator) Updates the privileges of an entity in a group.Methods inherited from class org.jivesoftware.openfire.group.AbstractGroupProvider
getPublicSharedGroupNames, getSharedGroupNames, getSharedGroupNames, getVisibleGroupNames, hasSharedGroups, loadProperties, search
-
Constructor Details
-
DefaultGroupProvider
public DefaultGroupProvider()
-
-
Method Details
-
createGroup
Description copied from interface:GroupProviderCreates a group with the given name (optional operation).The provider is responsible for setting the creation date and modification date to the current date/time.
- Specified by:
createGroupin interfaceGroupProvider- Overrides:
createGroupin classAbstractGroupProvider- Parameters:
name- name of the group.- Returns:
- the newly created group.
- Throws:
GroupNameInvalidException- if the provided new name is an unacceptable value.GroupAlreadyExistsException- if a group with the same name already exists.
-
getGroup
Description copied from interface:GroupProviderReturns a group based on its name.- Parameters:
name- the name of the group.- Returns:
- the group with the given name.
- Throws:
GroupNotFoundException- If no group with that ID could be found
-
setDescription
Description copied from interface:GroupProviderUpdates the group's description.- Specified by:
setDescriptionin interfaceGroupProvider- Overrides:
setDescriptionin classAbstractGroupProvider- Parameters:
name- the group name.description- the group description.- Throws:
GroupNotFoundException- if the group could not be found
-
setName
public void setName(String oldName, String newName) throws GroupAlreadyExistsException, GroupNameInvalidException, GroupNotFoundException Description copied from interface:GroupProviderSets the name of a group to a new name.- Specified by:
setNamein interfaceGroupProvider- Overrides:
setNamein classAbstractGroupProvider- Parameters:
oldName- the current name of the group.newName- the desired new name of the group.- Throws:
GroupAlreadyExistsException- if the group already existsGroupNameInvalidException- if the provided new name is an unacceptable value.GroupNotFoundException- if the provided old name does not refer to an existing group.
-
deleteGroup
Description copied from interface:GroupProviderDeletes the group (optional operation).- Specified by:
deleteGroupin interfaceGroupProvider- Overrides:
deleteGroupin classAbstractGroupProvider- Parameters:
groupName- the name of the group to delete.- Throws:
GroupNotFoundException
-
getGroupCount
public int getGroupCount()Description copied from interface:GroupProviderReturns the number of groups in the system.- Returns:
- the number of groups in the system.
-
getGroupNames
Description copied from interface:GroupProviderReturns the Collection of all group names in the system.- Returns:
- the Collection of all groups.
-
getGroupNames
Description copied from interface:GroupProviderReturns the Collection of all groups in the system.- Parameters:
startIndex- start index in results.numResults- number of results to return.- Returns:
- the Collection of all group names given the
startIndexandnumResults.
-
getGroupNames
Description copied from interface:GroupProviderReturns the Collection of group names that an entity belongs to. Implementations should use the bare JID representation of the JID passed as an argument to this method.- Parameters:
user- the (bare) JID of the entity.- Returns:
- the Collection of group names that the user belongs to.
-
addMember
public void addMember(String groupName, org.xmpp.packet.JID user, boolean administrator) throws GroupNotFoundException Description copied from interface:GroupProviderAdds an entity to a group (optional operation). Implementations should use the bare JID representation of the JID passed as an argument to this method.- Specified by:
addMemberin interfaceGroupProvider- Overrides:
addMemberin classAbstractGroupProvider- Parameters:
groupName- the group to add the member touser- the (bare) JID of the entity to addadministrator- True if the member is an administrator of the group- Throws:
GroupNotFoundException- if the provided group name does not refer to an existing group.
-
updateMember
public void updateMember(String groupName, org.xmpp.packet.JID user, boolean administrator) throws GroupNotFoundException Description copied from interface:GroupProviderUpdates the privileges of an entity in a group. Implementations should use the bare JID representation of the JID passed as an argument to this method.- Specified by:
updateMemberin interfaceGroupProvider- Overrides:
updateMemberin classAbstractGroupProvider- Parameters:
groupName- the group where the change happeneduser- the (bare) JID of the entity with new privilegesadministrator- True if the member is an administrator of the group- Throws:
GroupNotFoundException- if the provided group name does not refer to an existing group.
-
deleteMember
Description copied from interface:GroupProviderDeletes an entity from a group (optional operation). Implementations should use the bare JID representation of the JID passed as an argument to this method.- Specified by:
deleteMemberin interfaceGroupProvider- Overrides:
deleteMemberin classAbstractGroupProvider- Parameters:
groupName- the group name.user- the (bare) JID of the entity to delete.
-
isReadOnly
public boolean isReadOnly()Description copied from class:AbstractGroupProviderAlways true for a read-only provider- Specified by:
isReadOnlyin interfaceGroupProvider- Overrides:
isReadOnlyin classAbstractGroupProvider- Returns:
- true if the user provider is read-only.
-
search
Description copied from class:AbstractGroupProviderReturns a collection of group search results. This implementation returns an empty collection.- Specified by:
searchin interfaceGroupProvider- Overrides:
searchin classAbstractGroupProvider- Parameters:
query- the search string for group names.- Returns:
- all groups that match the search.
-
search
Description copied from class:AbstractGroupProviderReturns a collection of group search results. This implementation returns an empty collection.- Specified by:
searchin interfaceGroupProvider- Overrides:
searchin classAbstractGroupProvider- Parameters:
query- the search string for group names.startIndex- start index in results.numResults- number of results to return.- Returns:
- all groups that match the search.
-
isSearchSupported
public boolean isSearchSupported()Description copied from class:AbstractGroupProviderReturns true if the provider supports group search capability. This implementation always returns false.- Specified by:
isSearchSupportedin interfaceGroupProvider- Overrides:
isSearchSupportedin classAbstractGroupProvider- Returns:
- true if searching is supported.
-
isSharingSupported
public boolean isSharingSupported()Description copied from interface:GroupProviderReturns true if this GroupProvider allows group sharing. Shared groups enable roster sharing.- Specified by:
isSharingSupportedin interfaceGroupProvider- Overrides:
isSharingSupportedin classAbstractGroupProvider- Returns:
- true if the group provider supports group sharing.
-