private WSCredential getWSCredentialFromSubject ( Subject subject ) { if ( subject != null ) { java . util . Collection < Object > publicCreds = subject . getPublicCredentials ( ) ; if ( publicCreds != null && publicCreds . size ( ) > 0 ) { java . util . Iterator < Object > publicCredIterator = publicCreds . iterator ( ) ; while ( publicCredIterator . hasNext ( ) ) { Object cred = publicCredIterator . next ( ) ; if ( cred instanceof WSCredential ) { return ( WSCredential ) cred ; } } } } return null ; }
Get the WSCredential from the given Subject