public String getUserName ( boolean notAlternateUser ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getUserName" , new Object [ ] { new Boolean ( notAlternateUser ) } ) ; String userName = null ; if ( ! notAlternateUser // this catches the case where we want the // user associated with the subject && isAlternateUserBased ( ) ) { userName = alternateUser ; } else if ( isSubjectBased ( ) ) { if ( authorisationUtils != null ) { userName = authorisationUtils . getUserName ( subject ) ; } } else if ( isUserIdBased ( ) ) { userName = userId ; } else if ( isMsgBased ( ) ) { userName = msg . getSecurityUserid ( ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getUserName" , userName ) ; return userName ; }
Extract the appropriate username from this security context