Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger.group
Interface GroupProvider

All Known Implementing Classes:
DefaultGroupProvider, LdapGroupProvider

public interface GroupProvider

Provider interface for groups. Users that wish to integrate with their own group system must implement this class and then register the implementation with Jive Messenger in the jive-messenger.xml file. An entry in that file would look like the following:

   <provider>
     <group>
       <className>com.foo.auth.CustomGroupProvider</className>
     </group>
   </provider>

Author:
Matt Tucker

Method Summary
 void addMember(String groupName, String username, boolean administrator)
          Adds a user 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, String username)
          Deletes a user 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<Group> getGroups()
          Returns the Collection of all groups in the system.
 Collection<Group> getGroups(int startIndex, int numResults)
          Returns the Collection of all groups in the system.
 Collection<Group> getGroups(User user)
          Returns the Collection of Groups that a user belongs to.
 boolean isReadOnly()
          Returns true if this GroupProvider is read-only.
 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, String username, boolean administrator)
          Updates the privileges of a user in a group.
 

Method Detail

createGroup

Group createGroup(String name)
                  throws UnsupportedOperationException,
                         GroupAlreadyExistsException
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.

Parameters:
name - name of the group.
Returns:
the newly created group.
Throws:
GroupAlreadyExistsException - if a group with the same name already exists.
UnsupportedOperationException - if the provider does not support the operation.

deleteGroup

void deleteGroup(String name)
                 throws UnsupportedOperationException
Deletes the group (optional operation).

Parameters:
name - the name of the group to delete.
Throws:
UnsupportedOperationException - if the provider does not support the operation.

getGroup

Group getGroup(String name)
               throws GroupNotFoundException
Returns a group based on it's 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

setName

void setName(String oldName,
             String newName)
             throws UnsupportedOperationException,
                    GroupAlreadyExistsException
Sets the name of a group to a new name.

Parameters:
oldName - the current name of the group.
newName - the desired new name of the group.
Throws:
GroupAlreadyExistsException - if a group with the same name already exists.
UnsupportedOperationException - if the provider does not support the operation.

setDescription

void setDescription(String name,
                    String description)
                    throws GroupNotFoundException
Updates the group's description.

Parameters:
name - the group name.
description - the group description.
Throws:
GroupNotFoundException - if no existing group could be found to update.

getGroupCount

int getGroupCount()
Returns the number of groups in the system.

Returns:
the number of groups in the system.

getGroups

Collection<Group> getGroups()
Returns the Collection of all groups in the system.

Returns:
the Collection of all groups.

getGroups

Collection<Group> getGroups(int startIndex,
                            int numResults)
Returns 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 groups given the startIndex and numResults.

getGroups

Collection<Group> getGroups(User user)
Returns the Collection of Groups that a user belongs to.

Parameters:
user - the user.
Returns:
the Collection of groups that the user belongs to.

addMember

void addMember(String groupName,
               String username,
               boolean administrator)
               throws UnsupportedOperationException
Adds a user to a group (optional operation).

Parameters:
groupName - the group to add the member to
username - the username to add
administrator - True if the member is an administrator of the group
Throws:
UnsupportedOperationException - if the provider does not support the operation.

updateMember

void updateMember(String groupName,
                  String username,
                  boolean administrator)
                  throws UnsupportedOperationException
Updates the privileges of a user in a group.

Parameters:
groupName - the group where the change happened
username - the username to of the user with new privileges
administrator - True if the member is an administrator of the group
Throws:
UnsupportedOperationException - if the provider does not support the operation.

deleteMember

void deleteMember(String groupName,
                  String username)
                  throws UnsupportedOperationException
Deletes a user from a group (optional operation).

Parameters:
groupName - the group name.
username - the username.
Throws:
UnsupportedOperationException - if the provider does not support the operation.

isReadOnly

boolean isReadOnly()
Returns true if this GroupProvider is read-only. When read-only, groups can not be created, deleted, or modified.

Returns:
true if the user provider is read-only.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.