@Override public void modifyTournament( @WebParam(name = "tournamentId") String tournamentId, @WebParam(name = "date") String date, @WebParam(name = "location") String location, @WebParam(name = "surface") String surface, @WebParam(name = "draw") String draw, @WebParam(name = "numberOfSeeds") String numberOfSeeds) throws InvalidInputException { Tournament tournament = tournamentService.getTournament(Integer.parseInt(tournamentId)); DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date tournamentDate; try { tournamentDate = format.parse(date); } catch (ParseException e) { throw new InvalidInputException(e.getMessage(), "Invalid date format"); } tournament.setTournamentDate(tournamentDate); }
@Override @WebMethod(operationName = "getTournament") public Tournament getTournament(String tournamentId) { return tournamentService.getTournament(Integer.parseInt(tournamentId)); }
@Override @WebMethod(operationName = "deleteTournament") public void deleteTournament(@WebParam(name = "tournamentId") String tournamentId) { Tournament tournament = tournamentService.getTournament(Integer.parseInt(tournamentId)); tournamentService.deleteTournament(tournament); }