users.put("guest","guest");
users.put("admin","admin");
final PropertiesPrincipalDatabase ppd = new PropertiesPrincipalDatabase(users);
final AuthenticationManager pdam = new PrincipalDatabaseAuthenticationManager()
{
/**
* @see org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager#configure(org.apache.qpid.server.configuration.plugins.ConfigurationPlugin)
*/
@Override
public void configure(ConfigurationPlugin config) throws ConfigurationException
{
// We don't pass configuration to this test instance.
}
@Override
public void initialise()
{
setPrincipalDatabase(ppd);
super.initialise();
}
};
pdam.initialise();
return new IAuthenticationManagerRegistry()
{
@Override
public void close()
{
pdam.close();
}
@Override
public AuthenticationManager getAuthenticationManager(
SocketAddress address)
{
return pdam;
}
@Override
public Map<String, AuthenticationManager> getAvailableAuthenticationManagers()
{
return Collections.singletonMap(pdam.getClass().getName(), pdam);
}
@Override
public void addRegistryChangeListener(RegistryChangeListener listener)
{