protected Person createPerson ( final LoginContext _login ) throws EFapsException { Person person = null ; for ( final JAASSystem system : JAASSystem . getAllJAASSystems ( ) ) { final Set < ? > users = _login . getSubject ( ) . getPrincipals ( system . getPersonJAASPrincipleClass ( ) ) ; for ( final Object persObj : users ) { try { final String persKey = ( String ) system . getPersonMethodKey ( ) . invoke ( persObj ) ; final String persName = ( String ) system . getPersonMethodName ( ) . invoke ( persObj ) ; if ( person == null ) { person = Person . createPerson ( system , persKey , persName , null ) ; } else { person . assignToJAASSystem ( system , persKey ) ; } } catch ( final IllegalAccessException e ) { LoginHandler . LOG . error ( "could not execute a person method for system " + system . getName ( ) , e ) ; throw new EFapsException ( LoginHandler . class , "IllegalAccessException" , e ) ; } catch ( final IllegalArgumentException e ) { LoginHandler . LOG . error ( "could not execute a person method for system " + system . getName ( ) , e ) ; throw new EFapsException ( LoginHandler . class , "IllegalArgumentException" , e ) ; } catch ( final InvocationTargetException e ) { LoginHandler . LOG . error ( "could not execute a person method for system " + system . getName ( ) , e ) ; throw new EFapsException ( LoginHandler . class , "InvocationTargetException" , e ) ; } } } return person ; }
The person represented in the JAAS login context is created and associated to eFaps . If the person is defined in more than one JAAS system the person is also associated to the other JAAS systems .