Package org.apache.activemq.jaas

Examples of org.apache.activemq.jaas.UserPrincipal


            throw new FailedLoginException("Login was not allowed (as specified in configuration).");
        }
       
        for (int i = 0; i < userNames.length; ++i) {
            if (userNames[i].length() > 0 ) {
                subject.getPrincipals().add(new UserPrincipal(userNames[i]));
            }
        }
       
        for (int i = 0; i < groupNames.length; ++i) {
            if (groupNames[i].length() > 0) {
View Full Code Here


* @version $Rev: $ $Date: $
*/
public class UserPrincipalTest extends TestCase {

    public void testArguments() {
        UserPrincipal principal = new UserPrincipal("FOO");

       assertEquals("FOO", principal.getName());

        try {
            new UserPrincipal(null);
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException ingore) {

        }
    }
View Full Code Here

        }
    }

    public void testHash() {
        UserPrincipal p1 = new UserPrincipal("FOO");
        UserPrincipal p2 = new UserPrincipal("FOO");

        assertEquals(p1.hashCode(), p1.hashCode());
        assertEquals(p1.hashCode(), p2.hashCode());
    }
View Full Code Here

        assertEquals(p1.hashCode(), p1.hashCode());
        assertEquals(p1.hashCode(), p2.hashCode());
    }

    public void testEquals() {
        UserPrincipal p1 = new UserPrincipal("FOO");
        UserPrincipal p2 = new UserPrincipal("FOO");
        UserPrincipal p3 = new UserPrincipal("BAR");

        assertTrue(p1.equals(p1));
        assertTrue(p1.equals(p2));
        assertFalse(p1.equals(null));
        assertFalse(p1.equals("FOO"));
View Full Code Here

            throw new FailedLoginException("Login was not allowed (as specified in configuration).");
        }

        for (int i = 0; i < userNames.length; ++i) {
            if (userNames[i].length() > 0) {
                subject.getPrincipals().add(new UserPrincipal(userNames[i]));
            }
        }

        for (int i = 0; i < groupNames.length; ++i) {
            if (groupNames[i].length() > 0) {
View Full Code Here

                        + 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));
                }
            }
        }
       
        try {
View Full Code Here

            throw new FailedLoginException("Login was not allowed (as specified in configuration).");
        }

        for (int i = 0; i < userNames.length; ++i) {
            if (userNames[i].length() > 0) {
                subject.getPrincipals().add(new UserPrincipal(userNames[i]));
            }
        }

        for (int i = 0; i < groupNames.length; ++i) {
            if (groupNames[i].length() > 0) {
View Full Code Here

                            "Can't create a group " + principalName + " of class " + map.getGroupClass());
                        ne.initCause(e);
                        throw ne;
                    }
                } else if (!group && user) {
                    members.add(new UserPrincipal(principalName));
                }
            }
        }

        try {
View Full Code Here

                        + 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));
                }
            }
        }
       
        try {
View Full Code Here

                            "Can't create a group " + principalName + " of class " + map.getGroupClass());
                        ne.initCause(e);
                        throw ne;
                    }
                } else if (!group && user) {
                    members.add(new UserPrincipal(principalName));
                }
            }
        }

        try {
View Full Code Here

TOP

Related Classes of org.apache.activemq.jaas.UserPrincipal

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.