public abstract class AbstractGroupProvider extends Object implements GroupProvider
UnsupportedOperationException
. In
addition, group search operations are disabled.
Subclasses may optionally implement these capabilities, and must also
at minimum implement the GroupProvider.getGroup(String)
method.Constructor and Description |
---|
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).
|
Collection<String> |
getPublicSharedGroupNames()
Returns an unmodifiable Collection of all public shared groups in the system.
|
Collection<String> |
getSharedGroupNames()
Returns the name of the groups that are shared groups.
|
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()
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.
|
PersistableMap<String,String> |
loadProperties(Group group)
Returns a custom
Map that updates the database whenever
a property value is added, changed, or deleted. |
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.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGroup, getGroupCount, getGroupNames, getGroupNames, getGroupNames
public void addMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
GroupProvider
addMember
in interface GroupProvider
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
public void updateMember(String groupName, org.xmpp.packet.JID user, boolean administrator)
GroupProvider
updateMember
in interface GroupProvider
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
public void deleteMember(String groupName, org.xmpp.packet.JID user)
GroupProvider
deleteMember
in interface GroupProvider
groupName
- the group name.user
- the JID of the entity to delete.UnsupportedOperationException
public boolean isReadOnly()
isReadOnly
in interface GroupProvider
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.UnsupportedOperationException
GroupAlreadyExistsException
- if a group with the same name already
exists.public void deleteGroup(String name)
GroupProvider
deleteGroup
in interface GroupProvider
name
- the name of the group to delete.UnsupportedOperationException
public void setName(String oldName, String newName) throws GroupAlreadyExistsException
GroupProvider
setName
in interface GroupProvider
oldName
- the current name of the group.newName
- the desired new name of the group.UnsupportedOperationException
GroupAlreadyExistsException
- if a group with the same name already
exists.public void setDescription(String name, String description) throws GroupNotFoundException
GroupProvider
setDescription
in interface GroupProvider
name
- the group name.description
- the group description.UnsupportedOperationException
GroupNotFoundException
- if no existing group could be found to update.public boolean isSearchSupported()
isSearchSupported
in interface GroupProvider
public Collection<String> search(String query)
search
in interface GroupProvider
query
- the search string for group names.public Collection<String> search(String query, int startIndex, int numResults)
search
in interface GroupProvider
query
- the search string for group names.startIndex
- start index in results.numResults
- number of results to return.public Collection<String> getSharedGroupNames()
getSharedGroupNames
in interface GroupProvider
public Collection<String> getSharedGroupNames(org.xmpp.packet.JID user)
GroupProvider
getSharedGroupNames
in interface GroupProvider
user
- The bare JID for the user (node@domain)public Collection<String> getVisibleGroupNames(String userGroup)
GroupProvider
getVisibleGroupNames
in interface GroupProvider
userGroup
- The given grouppublic Collection<String> search(String key, String value)
GroupProvider
GroupProvider.isSearchSupported()
method
to ensure that searching is supported.search
in interface GroupProvider
key
- The name of a group property (e.g. "sharedRoster.showInRoster")value
- The value to match for the given propertypublic Collection<String> getPublicSharedGroupNames()
GroupProvider
getPublicSharedGroupNames
in interface GroupProvider
public boolean isSharingSupported()
GroupProvider
isSharingSupported
in interface GroupProvider
public PersistableMap<String,String> loadProperties(Group group)
Map
that updates the database whenever
a property value is added, changed, or deleted.loadProperties
in interface GroupProvider
group
- The target groupCopyright © 2003-2008 Jive Software.