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