Examples of nextPrincipal()


Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        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

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        }

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

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

            return new Enumeration<Principal>() {
                public boolean hasMoreElements() {
                    return members.hasNext();
                }
                public Principal nextElement() {
                    return members.nextPrincipal();
                }
            };
        }

        public String getName() {
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        // of principals (as in the Subject).
        Set<Principal> principals = new LinkedHashSet<Principal>();
        principals.add(principal);
        PrincipalIterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.nextPrincipal());
        }
        return principals;
    }

    //--------------------------------------------------------------------------
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        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

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Override
    public Principal getKnownPrincipal(Session session) throws RepositoryException {
        if (session instanceof JackrabbitSession) {
            PrincipalIterator principals = ((JackrabbitSession) session).getPrincipalManager().getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
            if (principals.hasNext()) {
                return principals.nextPrincipal();
            }
        }

        throw new UnsupportedRepositoryOperationException();
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

        // of principals (as in the Subject).
        Set<Principal> principals = new LinkedHashSet<Principal>();
        principals.add(principal);
        PrincipalIterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.nextPrincipal());
        }
        return principals;
    }

    //--------------------------------------------------------------------------
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Override
    public Principal getKnownPrincipal(Session session) throws RepositoryException {
        if (session instanceof JackrabbitSession) {
            PrincipalIterator principals = ((JackrabbitSession) session).getPrincipalManager().getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
            if (principals.hasNext()) {
                return principals.nextPrincipal();
            }
        }

        throw new UnsupportedRepositoryOperationException();
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

            Principal p = principalMgr.getPrincipal(((SimpleCredentials) credentials).getUserID());
            if (p != null) {
                principals.add(p);
                PrincipalIterator principalIterator = principalMgr.getGroupMembership(p);
                while (principalIterator.hasNext()) {
                    principals.add(principalIterator.nextPrincipal());
                }
            }
        }
        return principals.toArray(new Principal[principals.size()]);
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.principal.PrincipalIterator.nextPrincipal()

    @Test
    public void testGetPrincipals() {
        PrincipalIterator it = principalMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        while (it.hasNext()) {
            Principal p = it.nextPrincipal();
            assertFalse(isGroup(p));
        }
    }

    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.