class SessionVote {

    @POST
    @Path("/rate")
    @Produces(APPLICATION_JSON)
    @Consumes(APPLICATION_JSON)
    public SessionRating rateSession(SessionRating sessionRating) {
        String attendeeId = sessionRating.getAttendeeId();
        Attendee attendee = selectedAttendeeDAO.getAttendee(attendeeId);
        if (attendee == null) {
            throw new BadRequestException("Invalid attendee id: " + attendeeId);
        }

        SessionRating rating = selectedSessionRatingDAO.rateSession(sessionRating);
        return rating;
    }

}