@Path(value="event") @Produces(value="application/json") @Consumes(value="application/json") public class EventResource extends Object
Events in the application.| Constructor and Description |
|---|
EventResource() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
advancedSearch(String query,
String state,
String category,
int page,
int size)
REST aplication of the EJB advanced_search method
|
javax.ws.rs.core.Response |
attendToEvent(int id) |
javax.ws.rs.core.Response |
cancelEvent(int eventId) |
javax.ws.rs.core.Response |
create(es.uvigo.esei.dgss.letta.domain.entities.Event event) |
javax.ws.rs.core.Response |
get(int id) |
javax.ws.rs.core.Response |
getAttendees(int id) |
javax.ws.rs.core.Response |
getEventInfo(int eventId)
Returns the
Event information |
javax.ws.rs.core.Response |
highlighted()
Returns the list of
Events that are currently highlighted. |
javax.ws.rs.core.Response |
list(int page,
int size)
Returns the list of
Events stored in the application,
sorted by ascending date and paginated. |
javax.ws.rs.core.Response |
search(String query,
int page,
int size)
Returns the list of
Events matching a given search query. |
javax.ws.rs.core.Response |
update(int id,
es.uvigo.esei.dgss.letta.domain.entities.Event event) |
@GET
@Path(value="{id: \\d+}")
public javax.ws.rs.core.Response get(@PathParam(value="id")
int id)
@GET
public javax.ws.rs.core.Response list(@QueryParam(value="page") @DefaultValue(value="1")
int page,
@QueryParam(value="size") @DefaultValue(value="20")
int size)
throws IllegalArgumentException
Events stored in the application,
sorted by ascending date and paginated.page - Page number to retrieve, counting from 1. If not set, it will
be defaulted to the first page.size - Number of events to retrieve per page. If not set, it will be
defaulted to twenty.OK HTTP response containing the list of events in the
requested page.IllegalArgumentException - If either the page number is less than
one or the page size is less than zero.@GET @Path(value="highlighted") public javax.ws.rs.core.Response highlighted()
Events that are currently highlighted.OK HTTP response containing the list of the events in
the application that are currently highlighted.@GET
@Path(value="search")
public javax.ws.rs.core.Response search(@QueryParam(value="query") @DefaultValue(value="")
String query,
@QueryParam(value="page") @DefaultValue(value="1")
int page,
@QueryParam(value="size") @DefaultValue(value="20")
int size)
throws IllegalArgumentException
Events matching a given search query.
The search will be performed in both the event's title and the summary.query - The search query (title/summary terms) to perform. If not
set, it will be defaulted to an empty search query, thus
supposedly returning all the events (equivalent to
list(int, int)).page - Page number to retrieve, counting from 1. If not set, it will
be defaulted to the first page.size - Number of events to retrieve per page. If not set, it will be
defaulted to twenty.OK HTTP response containing the list of events that
result from executing a search with the specified query in the
requested page.IllegalArgumentException - If either the page number is less than
one or the page size is less than zero.@POST
public javax.ws.rs.core.Response create(es.uvigo.esei.dgss.letta.domain.entities.Event event)
throws IllegalArgumentException,
SecurityException
@PUT
@Path(value="{id: \\d+}")
public javax.ws.rs.core.Response update(@PathParam(value="id")
int id,
es.uvigo.esei.dgss.letta.domain.entities.Event event)
throws IllegalArgumentException,
SecurityException,
javax.mail.MessagingException
IllegalArgumentExceptionSecurityExceptionjavax.mail.MessagingException@GET
@Path(value="{id: \\d+}/attendees")
public javax.ws.rs.core.Response getAttendees(@PathParam(value="id")
int id)
@POST
@Path(value="{id: \\d+}/attendees")
public javax.ws.rs.core.Response attendToEvent(@PathParam(value="id")
int id)
throws SecurityException,
IllegalArgumentException
@GET
@Path(value="advanced_search")
public javax.ws.rs.core.Response advancedSearch(@QueryParam(value="query") @DefaultValue(value="")
String query,
@QueryParam(value="state") @DefaultValue(value="AVAILABLE")
String state,
@QueryParam(value="category") @DefaultValue(value="TELEVISION")
String category,
@QueryParam(value="page") @DefaultValue(value="1")
int page,
@QueryParam(value="size") @DefaultValue(value="20")
int size)
throws IllegalArgumentException
query - state - category - page - size - IllegalArgumentException@GET
@Path(value="{id}")
public javax.ws.rs.core.Response getEventInfo(@PathParam(value="id")
int eventId)
throws IllegalArgumentException
Event informationeventId - indicates the Event idEvent informationIllegalArgumentException - if the Event is not found@POST
@Path(value="{id: \\d+}/cancel")
public javax.ws.rs.core.Response cancelEvent(@PathParam(value="id")
int eventId)
Copyright © 2016. All rights reserved.