Skip to content

Commit

Permalink
SAK-2008
Browse files Browse the repository at this point in the history
Updates the providers to include a simple implementation of the new getUsers(Collection) method of the UDP API.



git-svn-id: https://source.sakaiproject.org/svn/trunk/sakai/providers@1635 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
Glenn R. Golden committed Sep 12, 2005
1 parent 909c98c commit 8dc7e85
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
package org.sakaiproject.component.imsent.user;

// imports
import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.sql.Connection;
import java.sql.ResultSet;
Expand Down Expand Up @@ -313,6 +315,22 @@ public boolean getUser(UserEdit edit)
return true;
} // getUser

/**
* Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
* @param users The UserEdit objects (with id set) to fill in or remove.
*/
public void getUsers(Collection users)
{
for (Iterator i = users.iterator(); i.hasNext();)
{
UserEdit user = (UserEdit) i.next();
if (!getUser(user))
{
i.remove();
}
}
}

/**
* Find a user object who has this email address. Update the object with the information found.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

package edu.amc.sakai.user;

import java.util.Collection;
import java.util.Hashtable;import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


Expand Down Expand Up @@ -323,6 +325,23 @@ public boolean getUser(UserEdit edit) {
}
}

/**
* Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
* @param users The UserEdit objects (with id set) to fill in or remove.
*/
public void getUsers(Collection users)
{
// TODO: is there a more efficient multi-user LDAP call to use instead of this iteration?
for (Iterator i = users.iterator(); i.hasNext();)
{
UserEdit user = (UserEdit) i.next();
if (!getUser(user))
{
i.remove();
}
}
}

public boolean updateUserAfterAuthentication() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
package org.sakaiproject.component.kerberos.user;

// imports
import java.util.Collection;
import java.util.Iterator;

import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.ConfirmationCallback;
Expand Down Expand Up @@ -191,6 +194,22 @@ public boolean getUser(UserEdit edit)
return true;
} // getUser

/**
* Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
* @param users The UserEdit objects (with id set) to fill in or remove.
*/
public void getUsers(Collection users)
{
for (Iterator i = users.iterator(); i.hasNext();)
{
UserEdit user = (UserEdit) i.next();
if (!getUser(user))
{
i.remove();
}
}
}

/**
* Find a user object who has this email address. Update the object with the information found.
* @param email The email address string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@

package es.udl.asic.user;

import java.util.Collection;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


Expand Down Expand Up @@ -169,6 +171,22 @@ public boolean getUser(UserEdit edit) {
return getUserInf(edit,filter);
}

/**
* Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
* @param users The UserEdit objects (with id set) to fill in or remove.
*/
public void getUsers(Collection users)
{
for (Iterator i = users.iterator(); i.hasNext();)
{
UserEdit user = (UserEdit) i.next();
if (!getUser(user))
{
i.remove();
}
}
}

public boolean updateUserAfterAuthentication() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
package org.sakaiproject.component.legacy.user;

// imports
import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -169,6 +171,22 @@ public boolean getUser(UserEdit edit)

} // getUser

/**
* Access a collection of UserEdit objects; if the user is found, update the information, otherwise remove the UserEdit object from the collection.
* @param users The UserEdit objects (with id set) to fill in or remove.
*/
public void getUsers(Collection users)
{
for (Iterator i = users.iterator(); i.hasNext();)
{
UserEdit user = (UserEdit) i.next();
if (!getUser(user))
{
i.remove();
}
}
}

/**
* Find a user object who has this email address. Update the object with the information found.
*
Expand Down

0 comments on commit 8dc7e85

Please sign in to comment.