public interface GroupProvider
openfire.xml
file. An entry in that file would look like the following:
<provider> <group> <className>com.foo.auth.CustomGroupProvider</className> </group> </provider>
AbstractGroupProvider
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 name)
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.
|
Collection<String> |
getPublicSharedGroupNames()
Returns an unmodifiable Collection of all public shared groups in the system.
|
Collection<String> |
getSharedGroupNames()
Returns an unmodifiable Collection of all shared groups in the system.
|
Collection<String> |
getSharedGroupNames(org.xmpp.packet.JID user)
Returns an unmodifiable Collection of all shared groups in the system for a given user.
|
Collection<String> |
getVisibleGroupNames(String userGroup)
Returns an unmodifiable Collection of groups that are visible
to the members of the given group.
|
boolean |
isReadOnly()
Returns true if this GroupProvider is read-only.
|
boolean |
isSearchSupported()
Returns true if group searching is supported by the provider.
|
boolean |
isSharingSupported()
Returns true if this GroupProvider allows group sharing.
|
PersistableMap<String,String> |
loadProperties(Group group)
Loads the group properties (if any) from the backend data store.
|
Collection<String> |
search(String query)
Returns the group names that match a search.
|
Collection<String> |
search(String query,
int startIndex,
int numResults)
Returns the group names that match a search given a start index and desired number of results.
|
Collection<String> |
search(String key,
String value)
Returns the names of groups that have a property matching the given
key/value pair.
|
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.
|
Group createGroup(String name) throws GroupAlreadyExistsException
The provider is responsible for setting the creation date and modification date to the current date/time.
name
- name of the group.GroupAlreadyExistsException
- if a group with the same name already
exists.UnsupportedOperationException
- if the provider does not
support the operation.void deleteGroup(String name)
name
- the name of the group to delete.UnsupportedOperationException
- if the provider does not
support the operation.Group getGroup(String name) throws GroupNotFoundException
name
- the name of the group.GroupNotFoundException
- If no group with that ID could be foundvoid setName(String oldName, String newName) throws GroupAlreadyExistsException
oldName
- the current name of the group.newName
- the desired new name of the group.GroupAlreadyExistsException
- if a group with the same name already
exists.UnsupportedOperationException
- if the provider does not
support the operation.void setDescription(String name, String description) throws GroupNotFoundException
name
- the group name.description
- the group description.GroupNotFoundException
- if no existing group could be found to update.int getGroupCount()
Collection<String> getGroupNames()
boolean isSharingSupported()
Collection<String> getSharedGroupNames()
Collection<String> getSharedGroupNames(org.xmpp.packet.JID user)
user
- The bare JID for the user (node@domain)Collection<String> getPublicSharedGroupNames()
Collection<String> getVisibleGroupNames(String userGroup)
userGroup
- The given groupCollection<String> getGroupNames(int startIndex, int numResults)
startIndex
- start index in results.numResults
- number of results to return.startIndex
and numResults
.Collection<String> getGroupNames(org.xmpp.packet.JID user)
user
- the JID of the entity.void addMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
groupName
- the group to add the member touser
- the JID of the entity to addadministrator
- True if the member is an administrator of the groupUnsupportedOperationException
- if the provider does not
support the operation.void updateMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
groupName
- the group where the change happeneduser
- the JID of the entity with new privilegesadministrator
- True if the member is an administrator of the groupUnsupportedOperationException
- if the provider does not
support the operation.void deleteMember(String groupName, org.xmpp.packet.JID user)
groupName
- the group name.user
- the JID of the entity to delete.UnsupportedOperationException
- if the provider does not
support the operation.boolean isReadOnly()
Collection<String> search(String query)
Before searching or showing a search UI, use the isSearchSupported()
method
to ensure that searching is supported.
query
- the search string for group names.Collection<String> search(String query, int startIndex, int numResults)
Before searching or showing a search UI, use the isSearchSupported()
method
to ensure that searching is supported.
query
- the search string for group names.startIndex
- start index in results.numResults
- number of results to return.Collection<String> search(String key, String value)
isSearchSupported()
method
to ensure that searching is supported.key
- The name of a group property (e.g. "sharedRoster.showInRoster")value
- The value to match for the given propertyboolean isSearchSupported()
PersistableMap<String,String> loadProperties(Group group)
Map
are persisted to the
backend data store. Otherwise if a mutator method is called, the
implementation should throw an UnsupportedOperationException
.
If there are no corresponding properties for the given group, or if the
provider does not support group properties, this method should return
an empty Map rather than null.group
- The target groupCopyright © 2003–2020 Ignite Realtime. All rights reserved.