{
criteria.add(TurbineUserPeer.USER_ID, principal.getName());
}
else
{
throw new UserException("Invalid Principal Type in getUser: " + principal.getClass().getName());
}
List users;
try
{
users = TurbineUserPeer.doSelectUsers(criteria);
}
catch(Exception e)
{
throw new UserException("Failed to retrieve user '" +
principal.getName() + "'", e);
}
if ( users.size() > 1 )
{
throw new UserException(
"Multiple Users with same username '" + principal.getName() + "'");
}
if ( users.size() == 1 )
{
return (JetspeedUser)users.get(0);