Package org.apache.servicemix.nmr.api.security

Examples of org.apache.servicemix.nmr.api.security.GroupPrincipal


        DefaultAuthorizationEntry entry = new DefaultAuthorizationEntry();
        entry.setRoles("role1, role2");
        Set<GroupPrincipal> acls = entry.getAcls();
        assertNotNull(acls);
        assertEquals(2, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role1")));
        assertTrue(acls.contains(new GroupPrincipal("role2")));
    }
View Full Code Here


        addEntry("ep1", null, "role1", AuthorizationEntry.Type.Set);

        Set<GroupPrincipal> acls = service.getAcls("ep1", null);
        assertNotNull(acls);
        assertEquals(1, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role1")));
        acls = service.getAcls("ep2", null);
        assertNotNull(acls);
        assertEquals(1, acls.size());
        assertTrue(acls.contains(GroupPrincipal.ANY));
    }
View Full Code Here

        addEntry("ep1", null, "role1", AuthorizationEntry.Type.Add);

        Set<GroupPrincipal> acls = service.getAcls("ep1", null);
        assertNotNull(acls);
        assertEquals(1, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role1")));
        acls = service.getAcls("ep2", null);
        assertNotNull(acls);
        assertEquals(0, acls.size());
        acls = service.getAcls("p3", null);
        assertNotNull(acls);
View Full Code Here

        addEntry("ep1", null, "role1", AuthorizationEntry.Type.Add);

        Set<GroupPrincipal> acls = service.getAcls("ep1", null);
        assertNotNull(acls);
        assertEquals(2, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role1")));
        assertTrue(acls.contains(GroupPrincipal.ANY));
    }
View Full Code Here

    public String getRoles() {
        StringBuffer sb = new StringBuffer();
        if (this.acls != null) {
            for (Iterator<GroupPrincipal> iter = this.acls.iterator(); iter.hasNext();) {
                GroupPrincipal p = iter.next();
                sb.append(p);
                if (iter.hasNext()) {
                    sb.append(",");
                }
            }
View Full Code Here

    private Set<GroupPrincipal> buildRoles(String roles) {
        Set<GroupPrincipal> s = new HashSet<GroupPrincipal>();
        StringTokenizer iter = new StringTokenizer(roles, ",");
        while (iter.hasMoreTokens()) {
            String name = iter.nextToken().trim();
            s.add(new GroupPrincipal(name));
        }
        return s;
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.nmr.api.security.GroupPrincipal

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.