Package org.apache.jackrabbit.api.security.principal

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator


     */
    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)) {
View Full Code Here


            return delegatee.isMember(member);
        }

        public Enumeration<? extends Principal> members() {
            Iterator<? extends Principal> it = Collections.list(delegatee.members()).iterator();
            final PrincipalIterator members = new CheckedPrincipalIterator(it, provider);
            return new Enumeration<Principal>() {
                public boolean hasMoreElements() {
                    return members.hasNext();
                }
                public Principal nextElement() {
                    return members.nextPrincipal();
                }
            };
        }
View Full Code Here

    public void testMultiplePrincipals() throws RepositoryException, NotExecutableException {
        PrincipalManager pMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        Principal everyone = pMgr.getEveryone();
        Principal grPrincipal = null;
        PrincipalIterator it = pMgr.findPrincipals("", PrincipalManager.SEARCH_TYPE_GROUP);
        while (it.hasNext()) {
            Group gr = (Group) it.nextPrincipal();
            if (!everyone.equals(gr)) {
                grPrincipal = gr;
            }
        }
        if (grPrincipal == null || grPrincipal.equals(everyone)) {
View Full Code Here

        if (!(superuser instanceof JackrabbitSession)) {
            throw new NotExecutableException();
        }

        principalMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        PrincipalIterator it = principalMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        if (it.hasNext()) {
            testPrincipal = it.nextPrincipal();
        } else {
            throw new NotExecutableException();
        }
        privilegeMgr = (PrivilegeManagerImpl) ((JackrabbitWorkspace) superuser.getWorkspace()).getPrivilegeManager();
    }
View Full Code Here

    public PrincipalIterator findPrincipals(String simpleFilter) {
        checkIsValid();
        List entries = new ArrayList(providers.length);
        for (int i = 0; i < providers.length; i++) {
            PrincipalProvider pp = providers[i];
            PrincipalIterator it = pp.findPrincipals(simpleFilter);
            if (it.hasNext()) {
                entries.add(new CheckedIteratorEntry(it, pp));
            }
        }
        return new CheckedPrincipalIterator(entries);
    }
View Full Code Here

    public PrincipalIterator findPrincipals(String simpleFilter, int searchType) {
        checkIsValid();
        List entries = new ArrayList(providers.length);
        for (int i = 0; i < providers.length; i++) {
            PrincipalProvider pp = providers[i];
            PrincipalIterator it = pp.findPrincipals(simpleFilter, searchType);
            if (it.hasNext()) {
                entries.add(new CheckedIteratorEntry(it, pp));
            }
        }
        return new CheckedPrincipalIterator(entries);
    }
View Full Code Here

    public PrincipalIterator getPrincipals(int searchType) {
        checkIsValid();
        List entries = new ArrayList(providers.length);
        for (int i = 0; i < providers.length; i++) {
            PrincipalProvider pp = providers[i];
            PrincipalIterator it = pp.getPrincipals(searchType);
            if (it.hasNext()) {
                entries.add(new CheckedIteratorEntry(it, pp));
            }
        }
        return new CheckedPrincipalIterator(entries);
    }
View Full Code Here

    public PrincipalIterator getGroupMembership(Principal principal) {
        checkIsValid();
        List entries =  new ArrayList(providers.length + 1);
        for (int i = 0; i < providers.length; i++) {
            PrincipalProvider pp = providers[i];
            PrincipalIterator groups = pp.getGroupMembership(principal);
            if (groups.hasNext()) {
                entries.add(new CheckedIteratorEntry(groups, pp));
            }
        }
        // additional entry for the 'everyone' group
        if (!(principal instanceof EveryonePrincipal)) {
View Full Code Here

                return new PrincipalIteratorAdapter(Collections.singletonList(p));
            }
        }

        public PrincipalIterator getPrincipals(int searchType) {
            PrincipalIterator it;
            switch (searchType) {
                case PrincipalManager.SEARCH_TYPE_GROUP:
                    it = new PrincipalIteratorAdapter(Collections.singletonList(EveryonePrincipal.getInstance()));
                    break;
                case PrincipalManager.SEARCH_TYPE_NOT_GROUP:
View Full Code Here

        if (!(superuser instanceof JackrabbitSession)) {
            throw new NotExecutableException();
        }

        PrincipalManager pMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        PrincipalIterator it = pMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        if (it.hasNext()) {
            return it.nextPrincipal();
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.api.security.principal.PrincipalIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.