@POST
@Path("/{c_id}/session")
@Consumes({ BASE_JSON_MEDIA_TYPE, BASE_XML_MEDIA_TYPE })
public Response createSession(@PathParam("c_id") String conferenceId, SessionRepresentation sessionRepresentation) {
Conference conference = getRepository().get(conferenceId);
if (conference == null) {
return Response.status(Status.BAD_REQUEST).build(); // TODO: Need Business Exception type to explain why?
}
Session session = sessionConverter.to(getUriInfo(), sessionRepresentation);
conference.addSession(session);
getRepository().store(conference);
return Response.created(
UriBuilder.fromResource(
SessionResource.class).segment("{id}")