final Iterator<AMQConnectionModel> connections =
((ServerConnection)conn).getVirtualHost().getConnectionRegistry().getConnections().iterator();
while(connections.hasNext())
{
final AMQConnectionModel amqConnectionModel = connections.next();
final String userName = amqConnectionModel.getAuthorizedPrincipal() == null
? ""
: amqConnectionModel.getAuthorizedPrincipal().getName();
if (userId.equals(userName) && !amqConnectionModel.isSessionNameUnique(name))
{
return false;
}
}
return true;