/** * Sets individual users for authentication * * @org.apache.xbean.ElementType class="org.apache.activemq.security.AuthenticationUser" */ public void setUsers(List<?> users) { userPasswords.clear(); userGroups.clear(); for (Iterator<?> it = users.iterator(); it.hasNext();) { AuthenticationUser user = (AuthenticationUser)it.next(); userPasswords.put(user.getUsername(), user.getPassword()); Set<Principal> groups = new HashSet<Principal>(); StringTokenizer iter = new StringTokenizer(user.getGroups(), ","); while (iter.hasMoreTokens()) { String name = iter.nextToken().trim(); groups.add(new GroupPrincipal(name)); } userGroups.put(user.getUsername(), groups); } }
public static Object inferTargetObject(Object elementContent) { if (DtoTopic.class.isAssignableFrom(elementContent.getClass())) { return new ActiveMQTopic(); } else if (DtoQueue.class.isAssignableFrom(elementContent.getClass())) { return new ActiveMQQueue(); } else if (DtoAuthenticationUser.class.isAssignableFrom(elementContent.getClass())) { return new AuthenticationUser(); } else if (DtoFilteredDestination.class.isAssignableFrom(elementContent.getClass())) { return new FilteredDestination(); } else { return new Object(); } }
protected BrokerPlugin configureAuthentication() throws Exception { List<AuthenticationUser> users = new ArrayList<AuthenticationUser>(); users.add(new AuthenticationUser(USERNAME_ADMIN, PASSWORD_ADMIN, "users,admins")); users.add(new AuthenticationUser(USERNAME_USER, PASSWORD_USER, "users")); users.add(new AuthenticationUser(USERNAME_GUEST, PASSWORD_GUEST, "guests")); SimpleAuthenticationPlugin authenticationPlugin = new SimpleAuthenticationPlugin(users); authenticationPlugin.setAnonymousAccessAllowed(isAnonymousAccessAllowed()); return authenticationPlugin; } }
/** * Sets individual users for authentication * * @org.apache.xbean.ElementType class="org.apache.activemq.security.AuthenticationUser" */ public void setUsers(List<?> users) { userPasswords.clear(); userGroups.clear(); for (Iterator<?> it = users.iterator(); it.hasNext();) { AuthenticationUser user = (AuthenticationUser)it.next(); userPasswords.put(user.getUsername(), user.getPassword()); Set<Principal> groups = new HashSet<Principal>(); StringTokenizer iter = new StringTokenizer(user.getGroups(), ","); while (iter.hasMoreTokens()) { String name = iter.nextToken().trim(); groups.add(new GroupPrincipal(name)); } userGroups.put(user.getUsername(), groups); } }
/** * Sets individual users for authentication * * @org.apache.xbean.ElementType class="org.apache.activemq.security.AuthenticationUser" */ public void setUsers(List users) { userPasswords = new HashMap<String, String>(); userGroups = new HashMap<String, Set<GroupPrincipal>>(); for (Iterator it = users.iterator(); it.hasNext();) { AuthenticationUser user = (AuthenticationUser)it.next(); 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); } }
/** * Sets individual users for authentication * * @org.apache.xbean.ElementType class="org.apache.activemq.security.AuthenticationUser" */ public void setUsers(List<?> users) { userPasswords.clear(); userGroups.clear(); for (Iterator<?> it = users.iterator(); it.hasNext();) { AuthenticationUser user = (AuthenticationUser)it.next(); userPasswords.put(user.getUsername(), user.getPassword()); Set<Principal> groups = new HashSet<Principal>(); StringTokenizer iter = new StringTokenizer(user.getGroups(), ","); while (iter.hasMoreTokens()) { String name = iter.nextToken().trim(); groups.add(new GroupPrincipal(name)); } userGroups.put(user.getUsername(), groups); } }
/** * Sets individual users for authentication * * @org.apache.xbean.ElementType class="org.apache.activemq.security.AuthenticationUser" */ public void setUsers(List<?> users) { userPasswords.clear(); userGroups.clear(); for (Iterator<?> it = users.iterator(); it.hasNext();) { AuthenticationUser user = (AuthenticationUser)it.next(); userPasswords.put(user.getUsername(), user.getPassword()); Set<Principal> groups = new HashSet<Principal>(); StringTokenizer iter = new StringTokenizer(user.getGroups(), ","); while (iter.hasMoreTokens()) { String name = iter.nextToken().trim(); groups.add(new GroupPrincipal(name)); } userGroups.put(user.getUsername(), groups); } }