toolbox.services.ldap.simple
Class SimpleGroupServiceImpl

Package class diagram package SimpleGroupServiceImpl
java.lang.Object
  extended by toolbox.services.BaseService
      extended by toolbox.services.ldap.LDAPService
          extended by toolbox.services.ldap.simple.SimpleGroupServiceImpl
All Implemented Interfaces:
SimpleGroupService, Service

public class SimpleGroupServiceImpl
extends LDAPService
implements SimpleGroupService

Default implementation of the SimpleGroupService interface.


Constructor Summary
SimpleGroupServiceImpl()
          Default constructor.
 
Method Summary
 void addGroup(SimpleGroup group)
          Add a group to the directory.
 void addMember(java.lang.String cn, SimpleUser user)
          Add the given user to the named group.
 java.util.List findGroups(SimpleGroup params)
          Find groups in the directory making use of populated properties in the given SimpleGroup instance.
 SimpleGroup getGroup(java.lang.String cn)
          Return a single group entry from the directory.
 void removeGroup(java.lang.String cn)
          Remove a group from the directory.
 void removeMember(java.lang.String cn, SimpleUser user)
          Remove the given user from the named group.
 void updateGroup(SimpleGroup group)
          Update the given group.
 
Methods inherited from class toolbox.services.ldap.LDAPService
create, destroy, getLDAPWorker, search, search
 
Methods inherited from class toolbox.services.BaseService
getConfigHome, getName, getProperties, getProperty, getXMLProperties, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGroupServiceImpl

public SimpleGroupServiceImpl()
Default constructor.

Method Detail

addGroup

public void addGroup(SimpleGroup group)
              throws SimpleGroupException
Add a group to the directory.

Specified by:
addGroup in interface SimpleGroupService
Parameters:
group - SimpleGroup instance to add to the directory.
Throws:
SimpleGroupException - if the user cannot be added.

updateGroup

public void updateGroup(SimpleGroup group)
                 throws SimpleGroupException
Update the given group. This implementation ignores the uniqueMember property.

Specified by:
updateGroup in interface SimpleGroupService
Parameters:
group - SimpleGroup instance to update in the directory.
Throws:
SimpleGroupException - if the group cannot be updated.

getGroup

public SimpleGroup getGroup(java.lang.String cn)
                     throws SimpleGroupException
Return a single group entry from the directory.

Specified by:
getGroup in interface SimpleGroupService
Parameters:
cn - String containing the common name of the group to return.
Returns:
SimpleGroup instance.
Throws:
SimpleGroupException - if the group cannot be returned.

addMember

public void addMember(java.lang.String cn,
                      SimpleUser user)
               throws SimpleGroupException
Add the given user to the named group.

Specified by:
addMember in interface SimpleGroupService
Parameters:
cn - String containing the name of the group to modify.
user - SimpleUser instance to add to the group.
Throws:
SimpleGroupException

removeMember

public void removeMember(java.lang.String cn,
                         SimpleUser user)
                  throws SimpleGroupException
Remove the given user from the named group.

Specified by:
removeMember in interface SimpleGroupService
Parameters:
cn - String containing the name of the group to modify.
user - SimpleUser instance to remove from the group.
Throws:
SimpleGroupException

removeGroup

public void removeGroup(java.lang.String cn)
                 throws SimpleGroupException
Remove a group from the directory.

Specified by:
removeGroup in interface SimpleGroupService
Parameters:
cn - String containing the common name of the group to remove.
Throws:
SimpleGroupException - if the group cannot be removed.

findGroups

public java.util.List findGroups(SimpleGroup params)
                          throws SimpleGroupException
Find groups in the directory making use of populated properties in the given SimpleGroup instance.

Specified by:
findGroups in interface SimpleGroupService
Parameters:
params - SimpleGroup instance containing the properties to search on.
Returns:
List containing SimpleGroup instances.
Throws:
SimpleGroupException - if the search cannot be performed.