@ RequestMapping ( value = "/api/profile/{profileIdentifier}/clients/delete" , method = RequestMethod . POST ) public @ ResponseBody HashMap < String , Object > deleteClient ( Model model , @ RequestParam ( "profileIdentifier" ) String profileIdentifier , @ RequestParam ( "clientUUID" ) String [ ] clientUUID ) throws Exception { logger . info ( "Attempting to remove clients from the profile: " , profileIdentifier ) ; logger . info ( "Attempting to remove the following clients: {}" , Arrays . toString ( clientUUID ) ) ; HashMap < String , Object > valueHash = new HashMap < String , Object > ( ) ; Integer profileId = ControllerUtils . convertProfileIdentifier ( profileIdentifier ) ; for ( int i = 0 ; i < clientUUID . length ; i ++ ) { if ( clientUUID [ i ] . compareTo ( Constants . PROFILE_CLIENT_DEFAULT_ID ) == 0 ) throw new Exception ( "Default client cannot be deleted" ) ; clientService . remove ( profileId , clientUUID [ i ] ) ; } valueHash . put ( "clients" , clientService . findAllClients ( profileId ) ) ; return valueHash ; }
Bulk delete clients from a profile .