@Path(value="/users") public class UserManagementWebService extends Object
| Constructor and Description |
|---|
UserManagementWebService() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createUser(String login)
Create a new user account (incl.
|
javax.ws.rs.core.Response |
deleteUser(String login,
boolean delFoaf)
Delete the account with the given login.
|
javax.ws.rs.core.Response |
getUser(String login)
Return the Account data of the requested login
|
void |
initialize() |
javax.ws.rs.core.Response |
listUsers(String role)
List users (that have the given role).
|
javax.ws.rs.core.Response |
setUserPassword(String login,
String passwd)
Set the password for the given account
|
javax.ws.rs.core.Response |
setUserProfile(String login,
javax.ws.rs.core.MultivaluedMap<String,String> formParams)
Update/Save the user profile (foaf) for the given account
|
javax.ws.rs.core.Response |
setUserRoles(String login,
String[] roles,
String[] roles2)
Set the roles for the given account
|
@PostConstruct public void initialize()
@GET
@Produces(value="application/json")
public javax.ws.rs.core.Response listUsers(@QueryParam(value="role")
String role)
role - the required role (optional)UserWebService.AccountPoJos containing users (that have the required role, if
role was given) (in JSON).@POST
@Path(value="/{login}")
public javax.ws.rs.core.Response createUser(@PathParam(value="login")
String login)
login - the account name / login name of the new user.UserWebService.AccountPoJo of the newly created user.@GET
@Path(value="/{login}")
@Produces(value="application/json")
public javax.ws.rs.core.Response getUser(@PathParam(value="login")
String login)
login - the account requestedUserWebService.AccountPoJo of the requested account@DELETE
@Path(value="/{login}")
public javax.ws.rs.core.Response deleteUser(@PathParam(value="login")
String login,
@QueryParam(value="deleteFoaf")@DefaultValue(value="false")
boolean delFoaf)
login - the account to deletedelFoaf - if true, also delete the user profile (foaf)@POST
@Path(value="/{login}/roles")
public javax.ws.rs.core.Response setUserRoles(@PathParam(value="login")
String login,
@QueryParam(value="role")
String[] roles,
@QueryParam(value="role[]")
String[] roles2)
login - the accountroles - role params of the roles to setroles2 - role[] params of the roles to setUserWebService.AccountPoJo of the account after update@POST
@Path(value="/{login}/password")
public javax.ws.rs.core.Response setUserPassword(@PathParam(value="login")
String login,
@FormParam(value="password")
String passwd)
login - the account to set the password forpasswd - the new password@POST
@Path(value="/{login}/profile")
public javax.ws.rs.core.Response setUserProfile(@PathParam(value="login")
String login,
javax.ws.rs.core.MultivaluedMap<String,String> formParams)
login - the user to modifyformParams - the user profile (foaf, without prefix) in
UserWebService.AccountPoJo after the update in JSONUserWebService.post(MultivaluedMap)Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.