@Path(value="/competition") @Consumes(value="application/json") @Produces(value="application/json") public class CompetitionRest extends Object
| Constructor and Description |
|---|
CompetitionRest() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
create(es.uvigo.esei.dgss.teamd.ligaaas.domain.entities.Competition competition)
Creates a new competition.
|
javax.ws.rs.core.Response |
delete(String name)
Deletes a competition.
|
javax.ws.rs.core.Response |
get()
Returns all competitions.
|
javax.ws.rs.core.Response |
getByLocation(String location)
Return the competitions that belong to the provided location.
|
javax.ws.rs.core.Response |
getByName(String name)
Returns the competition identified by the name.
|
javax.ws.rs.core.Response |
getBySport(String sport)
Return the competitions that belong to the provided sport.
|
javax.ws.rs.core.Response |
update(es.uvigo.esei.dgss.teamd.ligaaas.domain.entities.Competition competition)
Updates the information of a competition.
|
@GET public javax.ws.rs.core.Response get()
OK response containing all competitions.@Path(value="{name}")
@GET
public javax.ws.rs.core.Response getByName(@PathParam(value="name")
String name)
name - the name of a competition.OK response containing the Competition with the
provided name.@Path(value="{sport}")
@GET
public javax.ws.rs.core.Response getBySport(@PathParam(value="sport")
String sport)
sport - the sport name to search forOK response containing the list of competitions belong to the
provided sport.@Path(value="{location}")
@GET
public javax.ws.rs.core.Response getByLocation(@PathParam(value="location")
String location)
location - the location name to realize the searchingOK response containing the list of competitions belong to the
provided location.@POST
public javax.ws.rs.core.Response create(es.uvigo.esei.dgss.teamd.ligaaas.domain.entities.Competition competition)
throws SecurityException
competition - a new competition to be stored.CREATED response with the URI of the new competition in the
Location header.IllegalArgumentException - if competition is null.SecurityException@PUT
public javax.ws.rs.core.Response update(es.uvigo.esei.dgss.teamd.ligaaas.domain.entities.Competition competition)
throws SecurityException
competition - a competition to be updated.OK response.IllegalArgumentException - if competition is null.SecurityException@Path(value="{name}")
@DELETE
public javax.ws.rs.core.Response delete(@PathParam(value="name")
String name)
throws SecurityException
name - of the competition to be deleted.OK response.SecurityExceptionCopyright © 2018. All rights reserved.