Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger.ldap
Class LdapGroupProvider

java.lang.Object
  extended by org.jivesoftware.messenger.ldap.LdapGroupProvider
All Implemented Interfaces:
GroupProvider

public class LdapGroupProvider
extends Object
implements GroupProvider

LDAP implementation of the GroupProvider interface. All data in the directory is treated as read-only so any set operations will result in an exception.

Author:
Greg Ferguson and Cameron Moore

Constructor Summary
LdapGroupProvider()
          Constructor of the LdapGroupProvider class.
 
Method Summary
 void addMember(String groupName, String username, boolean administrator)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 Group createGroup(String name)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 void deleteGroup(String name)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 void deleteMember(String groupName, String username)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 Group getGroup(String group)
          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 start, int num)
          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()
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 void setDescription(String name, String description)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 void setName(String oldName, String newName)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 void updateMember(String groupName, String username, boolean administrator)
          Always throws an UnsupportedOperationException because LDAP groups are read-only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapGroupProvider

public LdapGroupProvider()
Constructor of the LdapGroupProvider class. Gets an LdapManager instance from the LdapManager class.

Method Detail

createGroup

public Group createGroup(String name)
                  throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

Specified by:
createGroup in interface GroupProvider
Parameters:
name - the name of the group to create.
Returns:
the newly created group.
Throws:
UnsupportedOperationException - when called.

deleteGroup

public void deleteGroup(String name)
                 throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

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

getGroup

public Group getGroup(String group)
Description copied from interface: GroupProvider
Returns a group based on it's name.

Specified by:
getGroup in interface GroupProvider
Parameters:
group - the name of the group.
Returns:
the group with the given name.

setName

public void setName(String oldName,
                    String newName)
             throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

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

setDescription

public void setDescription(String name,
                           String description)
                    throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

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

getGroupCount

public int getGroupCount()
Description copied from interface: GroupProvider
Returns the number of groups in the system.

Specified by:
getGroupCount in interface GroupProvider
Returns:
the number of groups in the system.

getGroups

public Collection<Group> getGroups()
Description copied from interface: GroupProvider
Returns the Collection of all groups in the system.

Specified by:
getGroups in interface GroupProvider
Returns:
the Collection of all groups.

getGroups

public Collection<Group> getGroups(int start,
                                   int num)
Description copied from interface: GroupProvider
Returns the Collection of all groups in the system.

Specified by:
getGroups in interface GroupProvider
Parameters:
start - start index in results.
num - number of results to return.
Returns:
the Collection of all groups given the startIndex and numResults.

getGroups

public Collection<Group> getGroups(User user)
Description copied from interface: GroupProvider
Returns the Collection of Groups that a user belongs to.

Specified by:
getGroups in interface GroupProvider
Parameters:
user - the user.
Returns:
the Collection of groups that the user belongs to.

addMember

public void addMember(String groupName,
                      String username,
                      boolean administrator)
               throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

Specified by:
addMember in interface GroupProvider
Parameters:
groupName - name of a group.
username - name of a user.
administrator - true if is an administrator.
Throws:
UnsupportedOperationException - when called.

updateMember

public void updateMember(String groupName,
                         String username,
                         boolean administrator)
                  throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

Specified by:
updateMember in interface GroupProvider
Parameters:
groupName - the naame of a group.
username - the name of a user.
administrator - true if is an administrator.
Throws:
UnsupportedOperationException - when called.

deleteMember

public void deleteMember(String groupName,
                         String username)
                  throws UnsupportedOperationException
Always throws an UnsupportedOperationException because LDAP groups are read-only.

Specified by:
deleteMember in interface GroupProvider
Parameters:
groupName - the name of a group.
username - the ame of a user.
Throws:
UnsupportedOperationException - when called.

isReadOnly

public boolean isReadOnly()
Always throws an UnsupportedOperationException because LDAP groups are read-only.

Specified by:
isReadOnly in interface GroupProvider
Returns:
true because all LDAP functions are read-only.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.