/** * @param simpleFilter Principal name or fragment. * @return An iterator over the main principals of the authorizables found * by the user manager. */ private PrincipalIterator findGroupPrincipals(final String simpleFilter) { synchronized (userManager) { try { Iterator<Authorizable> itr = userManager.findAuthorizables(pPrincipalName, simpleFilter, UserManager.SEARCH_TYPE_GROUP); // everyone will not be found by the user manager -> extra test boolean addEveryone = everyonePrincipal.getName().matches(".*"+simpleFilter+".*"); return new PrincipalIteratorImpl(itr, addEveryone); } catch (RepositoryException e) { log.error("Error while searching group principals.", e); return PrincipalIteratorAdapter.EMPTY; } } }
/** * @param simpleFilter Principal name or fragment. * @return An iterator over the main principals of the authorizables found * by the user manager. */ private PrincipalIterator findUserPrincipals(String simpleFilter) { synchronized (userManager) { try { Iterator<Authorizable> itr = userManager.findAuthorizables(pPrincipalName, simpleFilter, UserManager.SEARCH_TYPE_USER); return new PrincipalIteratorImpl(itr, false); } catch (RepositoryException e) { log.error("Error while searching user principals.", e); return PrincipalIteratorAdapter.EMPTY; } } }
/** * @param simpleFilter Principal name or fragment. * @return An iterator over the main principals of the authorizables found * by the user manager. */ private PrincipalIterator findGroupPrincipals(final String simpleFilter) { synchronized (userManager) { try { Iterator<Authorizable> itr = userManager.findAuthorizables(pPrincipalName, simpleFilter, UserManager.SEARCH_TYPE_GROUP); // everyone will not be found by the user manager -> extra test boolean addEveryone = everyonePrincipal.getName().matches(".*"+simpleFilter+".*"); return new PrincipalIteratorImpl(itr, addEveryone); } catch (RepositoryException e) { log.error("Error while searching group principals.", e); return PrincipalIteratorAdapter.EMPTY; } } }
/** * @param simpleFilter Principal name or fragment. * @return An iterator over the main principals of the authorizables found * by the user manager. */ private PrincipalIterator findUserPrincipals(String simpleFilter) { synchronized (userManager) { try { Iterator<Authorizable> itr = userManager.findAuthorizables(pPrincipalName, simpleFilter, UserManager.SEARCH_TYPE_USER); return new PrincipalIteratorImpl(itr, false); } catch (RepositoryException e) { log.error("Error while searching user principals.", e); return PrincipalIteratorAdapter.EMPTY; } } }
private PrincipalIteratorImpl(Iterator<Authorizable> authorizableItr, boolean addEveryone) { this.authorizableItr = authorizableItr; this.addEveryone = addEveryone; next = seekNext(); }
private PrincipalIteratorImpl(Iterator<Authorizable> authorizableItr, boolean addEveryone) { this.authorizableItr = authorizableItr; this.addEveryone = addEveryone; next = seekNext(); }