* @return The set of principals associated with the given {@code userId}.
* @see #getPrincipalProvider()
*/
@Nonnull
protected Set<? extends Principal> getPrincipals(String userId) {
PrincipalProvider principalProvider = getPrincipalProvider();
if (principalProvider == null) {
log.debug("Cannot retrieve principals. No principal provider configured.");
return Collections.emptySet();
} else {
return principalProvider.getPrincipals(userId);
}
}