Openfire 3.8.0 Javadoc

org.jivesoftware.openfire.group
Class AbstractReadOnlyGroupProvider

java.lang.Object
  extended by org.jivesoftware.openfire.group.AbstractReadOnlyGroupProvider
All Implemented Interfaces:
GroupProvider
Direct Known Subclasses:
ClearspaceGroupProvider, JDBCGroupProvider, LdapGroupProvider

public abstract class AbstractReadOnlyGroupProvider
extends Object
implements GroupProvider

Common base class for immutable (read-only) GroupProvider implementations.

Author:
Tom Evans

Constructor Summary
AbstractReadOnlyGroupProvider()
           
 
Method Summary
 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 a collection of shared public group names.
 Collection<String> getSharedGroupNames()
          Returns a collection of shared group names.
 Collection<String> getSharedGroupNames(org.xmpp.packet.JID user)
          Returns a collection of shared group names for the given user.
 Collection<String> getVisibleGroupNames(String userGroup)
          Returns a collection of groups shared with 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 the provider supports group sharing.
 Map<String,String> loadProperties(Group group)
          Returns a map of properties for the given group.
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jivesoftware.openfire.group.GroupProvider
getGroup, getGroupCount, getGroupNames, getGroupNames, getGroupNames
 

Constructor Detail

AbstractReadOnlyGroupProvider

public AbstractReadOnlyGroupProvider()
Method Detail

addMember

public final void addMember(String groupName,
                            org.xmpp.packet.JID user,
                            boolean administrator)
                     throws UnsupportedOperationException
Description copied from interface: GroupProvider
Adds an entity to a group (optional operation).

Specified by:
addMember in interface GroupProvider
Parameters:
groupName - the group to add the member to
user - the JID of the entity to add
administrator - True if the member is an administrator of the group
Throws:
UnsupportedOperationException

updateMember

public final void updateMember(String groupName,
                               org.xmpp.packet.JID user,
                               boolean administrator)
                        throws UnsupportedOperationException
Description copied from interface: GroupProvider
Updates the privileges of an entity in a group.

Specified by:
updateMember in interface GroupProvider
Parameters:
groupName - the group where the change happened
user - the JID of the entity with new privileges
administrator - True if the member is an administrator of the group
Throws:
UnsupportedOperationException

deleteMember

public final void deleteMember(String groupName,
                               org.xmpp.packet.JID user)
                        throws UnsupportedOperationException
Description copied from interface: GroupProvider
Deletes an entity from a group (optional operation).

Specified by:
deleteMember in interface GroupProvider
Parameters:
groupName - the group name.
user - the JID of the entity to delete.
Throws:
UnsupportedOperationException

isReadOnly

public final boolean isReadOnly()
Always true for a read-only provider

Specified by:
isReadOnly in interface GroupProvider
Returns:
true if the user provider is read-only.

createGroup

public final Group createGroup(String name)
                        throws UnsupportedOperationException
Description copied from interface: GroupProvider
Creates 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:
createGroup in interface GroupProvider
Parameters:
name - name of the group.
Returns:
the newly created group.
Throws:
UnsupportedOperationException

deleteGroup

public final void deleteGroup(String name)
                       throws UnsupportedOperationException
Description copied from interface: GroupProvider
Deletes the group (optional operation).

Specified by:
deleteGroup in interface GroupProvider
Parameters:
name - the name of the group to delete.
Throws:
UnsupportedOperationException

setName

public final void setName(String oldName,
                          String newName)
                   throws UnsupportedOperationException
Description copied from interface: GroupProvider
Sets the name of a group to a new name.

Specified by:
setName in interface GroupProvider
Parameters:
oldName - the current name of the group.
newName - the desired new name of the group.
Throws:
UnsupportedOperationException

setDescription

public final void setDescription(String name,
                                 String description)
                          throws UnsupportedOperationException
Description copied from interface: GroupProvider
Updates the group's description.

Specified by:
setDescription in interface GroupProvider
Parameters:
name - the group name.
description - the group description.
Throws:
UnsupportedOperationException

isSearchSupported

public boolean isSearchSupported()
Returns true if the provider supports group search capability. This implementation always returns false.

Specified by:
isSearchSupported in interface GroupProvider
Returns:
true if searching is supported.

search

public Collection<String> search(String query)
Returns a collection of group search results. This implementation returns an empty collection.

Specified by:
search in interface GroupProvider
Parameters:
query - the search string for group names.
Returns:
all groups that match the search.

search

public Collection<String> search(String query,
                                 int startIndex,
                                 int numResults)
Returns a collection of group search results. This implementation returns an empty collection.

Specified by:
search in interface GroupProvider
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.

search

public Collection<String> search(String key,
                                 String value)
Returns a collection of group search results. This implementation returns an empty collection.

Specified by:
search in interface GroupProvider
Parameters:
key - The name of a group property (e.g. "sharedRoster.showInRoster")
value - The value to match for the given property
Returns:
unmodifiable Collection of group names that match the given key/value pair.

isSharingSupported

public boolean isSharingSupported()
Returns true if the provider supports group sharing. This implementation always returns false.

Specified by:
isSharingSupported in interface GroupProvider
Returns:
true if the group provider supports group sharing.

getSharedGroupNames

public Collection<String> getSharedGroupNames()
Returns a collection of shared group names. This implementation returns an empty collection.

Specified by:
getSharedGroupNames in interface GroupProvider
Returns:
unmodifiable Collection of all shared groups in the system.

getSharedGroupNames

public Collection<String> getSharedGroupNames(org.xmpp.packet.JID user)
Returns a collection of shared group names for the given user. This implementation returns an empty collection.

Specified by:
getSharedGroupNames in interface GroupProvider
Returns:
unmodifiable Collection of all shared groups in the system for a given user.

getPublicSharedGroupNames

public Collection<String> getPublicSharedGroupNames()
Returns a collection of shared public group names. This implementation returns an empty collection.

Specified by:
getPublicSharedGroupNames in interface GroupProvider
Returns:
unmodifiable Collection of all public shared groups in the system.

getVisibleGroupNames

public Collection<String> getVisibleGroupNames(String userGroup)
Returns a collection of groups shared with the given group. This implementation returns an empty collection.

Specified by:
getVisibleGroupNames in interface GroupProvider
Parameters:
userGroup - The given group
Returns:
unmodifiable Collection of group names that are visible to the given group.

loadProperties

public Map<String,String> loadProperties(Group group)
Returns a map of properties for the given group. This implementation returns an empty immutable map.

Specified by:
loadProperties in interface GroupProvider
Parameters:
group - The target group
Returns:
The properties for the given group

Openfire 3.8.0 Javadoc

Copyright © 2003-2008 Jive Software.