public LdapUser createLdapUser ( final String username ) { pm . currentTransaction ( ) . begin ( ) ; final LdapUser user = new LdapUser ( ) ; user . setUsername ( username ) ; user . setDN ( "Syncing..." ) ; pm . makePersistent ( user ) ; pm . currentTransaction ( ) . commit ( ) ; EventService . getInstance ( ) . publish ( new LdapSyncEvent ( user . getUsername ( ) ) ) ; return getObjectById ( LdapUser . class , user . getId ( ) ) ; }
Creates a new LdapUser object with the specified username .