@Path(value="/match") @Consumes(value="application/json") @Produces(value="application/json") public class MatchREST extends Object
| Constructor and Description |
|---|
MatchREST() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createMatch(es.uvigo.esei.dgss.Maatch match)
Creates a new match.
|
javax.ws.rs.core.Response |
delete(String id)
Deletes a match.
|
javax.ws.rs.core.Response |
get(String id)
Returns the match identified by its id.
|
javax.ws.rs.core.Response |
getAll()
Returns all the matches in the DB.
|
javax.ws.rs.core.Response |
search(String id)
Returns the match or matches that contain the id searched.
|
javax.ws.rs.core.Response |
update(es.uvigo.esei.dgss.Maatch match)
Updates a match.
|
@POST public javax.ws.rs.core.Response createMatch(es.uvigo.esei.dgss.Maatch match)
match - a new match to be stored.CREATED response with the URI of the new match in the
Location header.IllegalArgumentException - if match is null or if a match with the same id already
exists.@Path(value="/{id}")
@GET
public javax.ws.rs.core.Response get(@PathParam(value="id")
String id)
id - the id of a match.OK response containing the Maatch with the provided
id.IllegalArgumentException - if id is null or if it does not correspond with
any match.@GET public javax.ws.rs.core.Response getAll()
OK response containing all the Maatch in the DB.@Path(value="/search/{id}")
@GET
public javax.ws.rs.core.Response search(@PathParam(value="id")
String id)
id - the id of a match.OK response containing all the Maatch containing
the id.IllegalArgumentException - if id is null or if it does not correspond with
any match.@PUT public javax.ws.rs.core.Response update(es.uvigo.esei.dgss.Maatch match)
match - a match to be updated.OK response.IllegalArgumentException - if match is null.@Path(value="/{id}")
@DELETE
public javax.ws.rs.core.Response delete(@PathParam(value="id")
String id)
id - the id of the match to be deleted.IllegalArgumentException - if id is null or if it does not identifies a
valid match.Copyright © 2018. All rights reserved.