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