oql.bind(userName);
QueryResults results = oql.execute();
while (results.hasMore())
{
SystemUserGroupImpl sur = (SystemUserGroupImpl)results.nextElement();
if(groupNamesToKeep != null && groupNamesToKeep.contains(sur.getGroupName()))
{
logger.info("Keeping " + sur.getUserName() + "/" + sur.getGroupName());
groupNamesToKeep.remove(sur.getGroupName());
}
else
{
logger.info("Deleting " + sur.getUserName() + "/" + sur.getGroupName());
db.remove(sur);
}
}
results.close();