diff --git a/src/main/java/com/threerings/user/depot/ExternalAuthRepository.java b/src/main/java/com/threerings/user/depot/ExternalAuthRepository.java index 1617564..05318b2 100644 --- a/src/main/java/com/threerings/user/depot/ExternalAuthRepository.java +++ b/src/main/java/com/threerings/user/depot/ExternalAuthRepository.java @@ -93,6 +93,22 @@ public class ExternalAuthRepository extends DepotRepository return ids; } + /** + * Loads a mapping of (ooouser id -> exid) for all members in the supplied list that are found + * in the database. + */ + public Map loadExternalIds (ExternalAuther auther, Collection oooIds) + { + Preconditions.checkNotNull(auther); + Map ids = Maps.newHashMap(); + for (ExternalAuthRecord exrec : from(ExternalAuthRecord.class).where( + ExternalAuthRecord.AUTHER.eq(auther), + ExternalAuthRecord.USER_ID.in(oooIds)).select()) { + ids.put(exrec.userId, exrec.externalId); + } + return ids; + } + /** * Creates a mapping for the specified user to the supplied external credentials. */