use of org.apache.jackrabbit.core.security.principal.PrincipalIteratorAdapter in project jackrabbit by apache.
the class ImpersonationImpl method getImpersonators.
//------------------------------------------------------< Impersonation >---
/**
* @see Impersonation#getImpersonators()
*/
public PrincipalIterator getImpersonators() throws RepositoryException {
Set<String> impersonators = getImpersonatorNames();
if (impersonators.isEmpty()) {
return PrincipalIteratorAdapter.EMPTY;
} else {
final PrincipalManager pMgr = user.getSession().getPrincipalManager();
Set<Principal> s = new HashSet<Principal>();
for (String pName : impersonators) {
Principal p = pMgr.getPrincipal(pName);
if (p == null) {
log.debug("Impersonator " + pName + " does not correspond to a known Principal.");
p = new PrincipalImpl(pName);
}
s.add(p);
}
return new PrincipalIteratorAdapter(s);
}
}
Aggregations