@Path(value="public/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 |
eventInfo(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. |
@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.@GET
@Path(value="{id}")
public javax.ws.rs.core.Response eventInfo(@PathParam(value="id")
int eventId)
throws IllegalArgumentException
Event informationeventId - indicates the Event idEvent informationIllegalArgumentException - if the Event is not foundCopyright © 2015. All rights reserved.