/** * {@inheritDoc} */ public Principal getEveryone() { checkIsValid(); Principal everyone = getPrincipal(EveryonePrincipal.NAME); if (everyone == null) { everyone = EveryonePrincipal.getInstance(); } return everyone; }
/** * {@inheritDoc} */ public Principal getEveryone() { checkIsValid(); Principal everyone = getPrincipal(EveryonePrincipal.NAME); if (everyone == null) { everyone = EveryonePrincipal.getInstance(); } return everyone; }
/** * {@inheritDoc} */ public PrincipalIterator findPrincipals(String simpleFilter) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.findPrincipals(simpleFilter); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} */ public PrincipalIterator findPrincipals(String simpleFilter, int searchType) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.findPrincipals(simpleFilter, searchType); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} */ public PrincipalIterator findPrincipals(String simpleFilter, int searchType) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.findPrincipals(simpleFilter, searchType); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} */ public PrincipalIterator findPrincipals(String simpleFilter) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.findPrincipals(simpleFilter); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} * @param searchType */ public PrincipalIterator getPrincipals(int searchType) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.getPrincipals(searchType); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} * @param searchType */ public PrincipalIterator getPrincipals(int searchType) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length); for (PrincipalProvider pp : providers) { PrincipalIterator it = pp.getPrincipals(searchType); if (it.hasNext()) { entries.add(new CheckedIteratorEntry(it, pp)); } } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} */ public PrincipalIterator getGroupMembership(Principal principal) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length + 1); for (PrincipalProvider pp : providers) { PrincipalIterator groups = pp.getGroupMembership(principal); if (groups.hasNext()) { entries.add(new CheckedIteratorEntry(groups, pp)); } } // additional entry for the 'everyone' group if (!(principal instanceof EveryonePrincipal)) { Iterator<Principal> it = Collections.singletonList(getEveryone()).iterator(); entries.add(new CheckedIteratorEntry(it, null)); } return new CheckedPrincipalIterator(entries); }
/** * {@inheritDoc} */ public PrincipalIterator getGroupMembership(Principal principal) { checkIsValid(); List<CheckedIteratorEntry> entries = new ArrayList<CheckedIteratorEntry>(providers.length + 1); for (PrincipalProvider pp : providers) { PrincipalIterator groups = pp.getGroupMembership(principal); if (groups.hasNext()) { entries.add(new CheckedIteratorEntry(groups, pp)); } } // additional entry for the 'everyone' group if (!(principal instanceof EveryonePrincipal)) { Iterator<Principal> it = Collections.singletonList(getEveryone()).iterator(); entries.add(new CheckedIteratorEntry(it, null)); } return new CheckedPrincipalIterator(entries); }
/** * @param principalName the name of the principal * @return The principal with the given name or <code>null</code> if none * of the providers knows that principal of if the Session is not allowed * to see it. */ private Principal internalGetPrincipal(String principalName) { checkIsValid(); for (PrincipalProvider provider : providers) { Principal principal = provider.getPrincipal(principalName); if (principal != null && provider.canReadPrincipal(session, principal)) { return disguise(principal, provider); } } // nothing found or not allowed to see it. return null; }
/** * @param principalName the name of the principal * @return The principal with the given name or <code>null</code> if none * of the providers knows that principal of if the Session is not allowed * to see it. */ private Principal internalGetPrincipal(String principalName) { checkIsValid(); for (PrincipalProvider provider : providers) { Principal principal = provider.getPrincipal(principalName); if (principal != null && provider.canReadPrincipal(session, principal)) { return disguise(principal, provider); } } // nothing found or not allowed to see it. return null; }