public static UserProfile getUserProfile ( ) { UserProfile userProfile = null ; Subject subject = getSubject ( ) ; Iterator < UserProfile > userProfilesIterator = subject . getPrivateCredentials ( UserProfile . class ) . iterator ( ) ; if ( userProfilesIterator . hasNext ( ) ) { userProfile = userProfilesIterator . next ( ) ; } return userProfile ; }
Get UserProfile for the subject on the thread .