public DecoratedUserContext getUserContext ( String authProviderIdentifier ) throws GuacamoleException { // Locate and return the UserContext associated with the // AuthenticationProvider having the given identifier, if any for ( DecoratedUserContext userContext : getUserContexts ( ) ) { // Get AuthenticationProvider associated with current UserContext AuthenticationProvider authProvider = userContext . getAuthenticationProvider ( ) ; // If AuthenticationProvider identifier matches, done if ( authProvider . getIdentifier ( ) . equals ( authProviderIdentifier ) ) return userContext ; } throw new GuacamoleResourceNotFoundException ( "Session not associated " + "with authentication provider \"" + authProviderIdentifier + "\"." ) ; }
Returns the UserContext associated with this session that originated from the AuthenticationProvider with the given identifier . If no such UserContext exists an exception is thrown .