Package org.ctan.site.resources.admin
Class CrudUser3Resource
java.lang.Object
org.ctan.site.resources.admin.CrudUser3Resource
@Path("/3.0/admin")
@Produces("application/json")
@RolesAllowed("ADMIN")
public class CrudUser3Resource
extends Object
The class
CrudUser3Resource
contains the CRUD controller for the
user resource.-
Constructor Summary
ConstructorsConstructorDescriptionCrudUser3Resource
(@NonNull UserStore store) This is the constructor for the classCrudUser3Resource
. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcreate
provides an end-point to create a user.The methodget
provides means to retrieve a user.The methodget
provides means to retrieve a user.The methodlist
provides means to retrieve a page of users.boolean
The methodremove
provides an end-point to remove a user.boolean
The methodremove
provides an end-point to remove a user.boolean
The methodset
provides means to set a single attribute of a user.
-
Constructor Details
-
CrudUser3Resource
This is the constructor for the classCrudUser3Resource
.- Parameters:
store
- the underlying store
-
-
Method Details
-
create
The methodcreate
provides an end-point to create a user.- Parameters:
user
- the user object to store- Returns:
- the updated entity
-
get
@GET @Path("/user/id/{id}") @UnitOfWork("siteDb") public User get(@NonNull @PathParam("id") @NonNull Long id) The methodget
provides means to retrieve a user.- Parameters:
id
- the id- Returns:
true
iff the user exists
-
get
@GET @Path("/user/{account}") @UnitOfWork("siteDb") public User get(@NonNull @PathParam("account") @NonNull String account) The methodget
provides means to retrieve a user.- Parameters:
account
- the account- Returns:
true
iff the user exists
-
list
@GET @Path("/users") @UnitOfWork("siteDb") public GeneralPage list(@QueryParam("q") String q, @QueryParam("page") @DefaultValue("1") int page, @QueryParam("size") @DefaultValue("256") int size, @QueryParam("order") String orderBy, @QueryParam("asc") boolean asc) The methodlist
provides means to retrieve a page of users.- Parameters:
q
- the name patternpage
- the pagesize
- the page sizeorderBy
- the orderasc
- the indicator for ascending- Returns:
- the page for the user or
null
-
remove
@DELETE @Path("/user/id/{id}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("id") @NonNull Long id) The methodremove
provides an end-point to remove a user.- Parameters:
id
- the id- Returns:
true
iff the user has existed
-
remove
@DELETE @Path("/user/{account}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("account") @NonNull String account) The methodremove
provides an end-point to remove a user.- Parameters:
account
- the account- Returns:
true
iff the user has existed
-
set
@PUT @Path("/user/{account}") @UnitOfWork("siteDb") public boolean set(@NonNull @PathParam("account") @NonNull String account, @NonNull @NonNull Map<String, String> map) The methodset
provides means to set a single attribute of a user.- Parameters:
account
- the accountmap
- the mapping containing key and value- Returns:
true
iff the setting has succeeded
-