Package org.ctan.site.resources.admin
Class CrudPkg3Resource
java.lang.Object
org.ctan.site.resources.admin.CrudPkg3Resource
The class
CrudPkg3Resource contains the CRUD controller for the
pkg resource.-
Constructor Summary
ConstructorsConstructorDescriptionCrudPkg3Resource(@NonNull PkgStore store) This is the constructor for the classCrudPkg3Resource. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcreateprovides an end-point to create a pkg.The methodgetprovides means to retrieve a pkg.The methodlistprovides means to retrieve a page of packages.booleanThe methodremoveprovides an end-point to remove a pkg.booleanThe methodsetprovides means to set a single attribute of an pkg.
-
Constructor Details
-
CrudPkg3Resource
This is the constructor for the classCrudPkg3Resource.- Parameters:
store- the underlying store
-
-
Method Details
-
create
The methodcreateprovides an end-point to create a pkg.- Parameters:
pkg- the pkg object to store- Returns:
- the updated entity
-
get
@GET @Path("/pkg/{key}") @UnitOfWork("siteDb") public Pkg get(@NonNull @PathParam("key") @NonNull String key) The methodgetprovides means to retrieve a pkg.- Parameters:
key- the account- Returns:
trueiff the pkg exists
-
list
@GET @Path("/pkgs") @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 methodlistprovides means to retrieve a page of packages.- Parameters:
q- the name patternpage- the pagesize- the page sizeorderBy- the orderasc- the indicator for ascending- Returns:
- the page for the pkg or
null
-
remove
@DELETE @Path("/pkg/{key}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("key") @NonNull String key) The methodremoveprovides an end-point to remove a pkg.- Parameters:
key- the account- Returns:
trueiff the pkg has existed
-
set
@PUT @Path("/pkg/{pkg}") @UnitOfWork("siteDb") public boolean set(@NonNull @PathParam("pkg") @NonNull String pkg, @NonNull @NonNull Map<String, String> map) The methodsetprovides means to set a single attribute of an pkg.- Parameters:
pkg- the pkgmap- the mapping containing key and value- Returns:
trueiff the setting has succeeded
-