private ManageUserAccountResponse performOperation ( final ManageUserAccountRequest serviceRequest , final CreateApplicationEventRequest eventRequest ) { ManageUserAccountResponse response ; eventRequest . setElementId ( serviceRequest . getUserAcountId ( ) ) ; eventRequest . setApplicationMessage ( serviceRequest . getAccountOperation ( ) . toString ( ) ) ; final UserAccount accountToModify = getUserDAO ( ) . findFirstByProperty ( UserAccount_ . userId , serviceRequest . getUserAcountId ( ) ) ; final UserCommand userCommand = userCommandMap . get ( serviceRequest . getAccountOperation ( ) ) ; if ( accountToModify != null && userCommand != null ) { response = userCommand . execute ( accountToModify ) ; } else { response = new ManageUserAccountResponse ( ServiceResult . FAILURE ) ; } eventRequest . setApplicationMessage ( response . getResult ( ) . toString ( ) ) ; return response ; }
Perform operation .