Class CrudPkg3Resource

java.lang.Object
org.ctan.site.resources.admin.CrudPkg3Resource

@Path("/3.0/admin") @Produces("application/json") public class CrudPkg3Resource extends Object
The class CrudPkg3Resource contains the CRUD controller for the pkg resource.
  • Constructor Details

    • CrudPkg3Resource

      public CrudPkg3Resource(@NonNull @NonNull PkgStore store)
      This is the constructor for the class CrudPkg3Resource.
      Parameters:
      store - the underlying store
  • Method Details

    • create

      @POST @Path("/pkg") @UnitOfWork("siteDb") public Pkg create(@NonNull @NonNull Pkg pkg)
      The method create provides 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 method get provides means to retrieve a pkg.
      Parameters:
      key - the account
      Returns:
      true iff 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 method list provides means to retrieve a page of packages.
      Parameters:
      q - the name pattern
      page - the page
      size - the page size
      orderBy - the order
      asc - 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 method remove provides an end-point to remove a pkg.
      Parameters:
      key - the account
      Returns:
      true iff 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 method set provides means to set a single attribute of an pkg.
      Parameters:
      pkg - the pkg
      map - the mapping containing key and value
      Returns:
      true iff the setting has succeeded