public SimpleUserContext(AuthenticationProvider authProvider,String username,Map<String,GuacamoleConfiguration> configs){
  Collection<String> connectionIdentifiers=new ArrayList<String>(configs.size());
  Collection<String> connectionGroupIdentifiers=Collections.singleton(ROOT_IDENTIFIER);
  Collection<Connection> connections=new ArrayList<Connection>(configs.size());
  for (  Map.Entry<String,GuacamoleConfiguration> configEntry : configs.entrySet()) {
    String identifier=configEntry.getKey();
    GuacamoleConfiguration config=configEntry.getValue();
    Connection connection=new SimpleConnection(identifier,identifier,config);
    connection.setParentIdentifier(ROOT_IDENTIFIER);
    connections.add(connection);
    connectionIdentifiers.add(identifier);
  }
  this.rootGroup=new SimpleConnectionGroup(ROOT_IDENTIFIER,ROOT_IDENTIFIER,connectionIdentifiers,Collections.<String>emptyList());
  this.self=new SimpleUser(username,connectionIdentifiers,connectionGroupIdentifiers);
  this.userDirectory=new SimpleUserDirectory(self);
  this.connectionDirectory=new SimpleConnectionDirectory(connections);
  this.connectionGroupDirectory=new SimpleConnectionGroupDirectory(Collections.singleton(this.rootGroup));
  this.authProvider=authProvider;
}

public SimpleUserContext ( AuthenticationProvider authProvider , String username , Map < String , GuacamoleConfiguration > configs ) { Collection < String > connectionIdentifiers = new ArrayList < String > ( configs . size ( ) ) ; Collection < String > connectionGroupIdentifiers = Collections . singleton ( ROOT_IDENTIFIER ) ; Collection < Connection > connections = new ArrayList < Connection > ( configs . size ( ) ) ; for ( Map . Entry < String , GuacamoleConfiguration > configEntry : configs . entrySet ( ) ) { String identifier = configEntry . getKey ( ) ; GuacamoleConfiguration config = configEntry . getValue ( ) ; Connection connection = new SimpleConnection ( identifier , identifier , config ) ; connection . setParentIdentifier ( ROOT_IDENTIFIER ) ; connections . add ( connection ) ; connectionIdentifiers . add ( identifier ) ; } this . rootGroup = new SimpleConnectionGroup ( ROOT_IDENTIFIER , ROOT_IDENTIFIER , connectionIdentifiers , Collections . < String > emptyList ( ) ) ; this . self = new SimpleUser ( username , connectionIdentifiers , connectionGroupIdentifiers ) ; this . userDirectory = new SimpleUserDirectory ( self ) ; this . connectionDirectory = new SimpleConnectionDirectory ( connections ) ; this . connectionGroupDirectory = new SimpleConnectionGroupDirectory ( Collections . singleton ( this . rootGroup ) ) ; this . authProvider = authProvider ; }
creates a new simpleusercontext for the user with the given username which provides access to only those configurations within the given map .
