Package org.apache.activemq.jaas

Examples of org.apache.activemq.jaas.GroupPrincipal


            userPasswords.put(user.getUsername(), user.getPassword());
            Set<GroupPrincipal> groups = new HashSet<GroupPrincipal>();
            StringTokenizer iter = new StringTokenizer(user.getGroups(), ",");
            while (iter.hasMoreTokens()) {
                String name = iter.nextToken().trim();
                groups.add(new GroupPrincipal(name));
            }
            userGroups.put(user.getUsername(), groups);
        }
    }
View Full Code Here


    @Test
    public void testGetAdminACLs() {
        ActiveMQDestination q1 = new ActiveMQQueue("queue1");
        Set aclsq1 = authMap.getAdminACLs(q1);
        assertEquals(1, aclsq1.size());
        assertTrue(aclsq1.contains(new GroupPrincipal("role1")));

        ActiveMQDestination t1 = new ActiveMQTopic("topic1");
        Set aclst1 = authMap.getAdminACLs(t1);
        assertEquals(1, aclst1.size());
        assertTrue(aclst1.contains(new GroupPrincipal("role1")));
    }
View Full Code Here

    @Test
    public void testGetReadACLs() {
        ActiveMQDestination q1 = new ActiveMQQueue("queue1");
        Set aclsq1 = authMap.getReadACLs(q1);
        assertEquals(1, aclsq1.size());
        assertTrue(aclsq1.contains(new GroupPrincipal("role1")));

        ActiveMQDestination t1 = new ActiveMQTopic("topic1");
        Set aclst1 = authMap.getReadACLs(t1);
        assertEquals(1, aclst1.size());
        assertTrue(aclst1.contains(new GroupPrincipal("role2")));
    }
View Full Code Here

    @Test
    public void testGetWriteACLs() {
        ActiveMQDestination q1 = new ActiveMQQueue("queue1");
        Set aclsq1 = authMap.getWriteACLs(q1);
        assertEquals(2, aclsq1.size());
        assertTrue(aclsq1.contains(new GroupPrincipal("role1")));
        assertTrue(aclsq1.contains(new GroupPrincipal("role2")));

        ActiveMQDestination t1 = new ActiveMQTopic("topic1");
        Set aclst1 = authMap.getWriteACLs(t1);
        assertEquals(1, aclst1.size());
        assertTrue(aclst1.contains(new GroupPrincipal("role3")));
    }
View Full Code Here

    public void testAdvisory() {
        ActiveMQDestination dest = AdvisorySupport.getConnectionAdvisoryTopic();
        Set acls = authMap.getWriteACLs(dest);

        assertEquals(1, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role3")));
    }
View Full Code Here

        @Test
    public void testTemp() {
        Set acls = authMap.getTempDestinationAdminACLs();

        assertEquals(1, acls.size());
        assertTrue(acls.contains(new GroupPrincipal("role1")));
    }
View Full Code Here

            if ((!group && !user) || (group && user)) {
                LOG.error("Policy not applied! Can't determine type of member "
                        + memberDn + " under entry " + result.getNameInNamespace());
            } else if (principalName != null){
                if (group && !user) {
                    members.add(new GroupPrincipal(principalName));
                } else if (!group && user) {
                    members.add(new UserPrincipal(principalName));
                }
            }
        }
View Full Code Here

            for (Iterator<String> iter = acls.iterator(); iter.hasNext();) {
                String roleName = iter.next();
                LdapName ldapname = new LdapName(roleName);
                Rdn rdn = ldapname.getRdn(ldapname.size() - 1);
                LOG.debug("Found role: [" + rdn.getValue().toString() + "]");
                roles.add(new GroupPrincipal(rdn.getValue().toString()));
            }
            return roles;
        } catch (NamingException e) {
            LOG.error(e.toString());
            return new HashSet<GroupPrincipal>();
View Full Code Here

                info.setUserName(anonymousUser);
                s = new SecurityContext(info.getUserName()) {
                    @Override
                    public Set<Principal> getPrincipals() {
                        Set<Principal> groups = new HashSet<Principal>();
                        groups.add(new GroupPrincipal(anonymousGroup));
                        return groups;
                    }
                };
            } else {
                String pw = userPasswords.get(info.getUserName());
View Full Code Here

            for (Iterator<String> iter = acls.iterator(); iter.hasNext();) {
                String roleName = iter.next();
                LdapName ldapname = new LdapName(roleName);
                Rdn rdn = ldapname.getRdn(ldapname.size() - 1);
                LOG.debug("Found role: [" + rdn.getValue().toString() + "]");
                roles.add(new GroupPrincipal(rdn.getValue().toString()));
            }
            return roles;
        } catch (NamingException e) {
            LOG.error(e.toString());
            return new HashSet<GroupPrincipal>();
View Full Code Here

TOP

Related Classes of org.apache.activemq.jaas.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.