public Collection < WsGetGroupsResult > getGroupsForSubjectId ( final String subjectId ) { try { val groupsClient = new GcGetGroups ( ) . addSubjectId ( subjectId ) ; val results = groupsClient . execute ( ) . getResults ( ) ; if ( results == null || results . length == 0 ) { LOGGER . warn ( "Subject id [{}] could not be located." , subjectId ) ; return new ArrayList <> ( 0 ) ; } LOGGER . debug ( "Found [{}] groups for [{}]" , results . length , subjectId ) ; return CollectionUtils . wrapList ( results ) ; } catch ( final Exception e ) { LOGGER . warn ( "Grouper WS did not respond successfully. Ensure your credentials are correct " + ", the url endpoint for Grouper WS is correctly configured and the subject [{}] exists in Grouper." , subjectId , e ) ; } return new ArrayList <> ( 0 ) ; }
Gets groups for subject id .