Class CategoriesResource


  • @Path("categories")
    public class CategoriesResource
    extends Object
    This class implements a web facade for the product catageories in the inventory management. It uses JAX-RS to implement the server-side HTTP communications.
    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • request

        @Context
        private javax.ws.rs.core.Request request
      • uriInfo

        @Context
        private javax.ws.rs.core.UriInfo uriInfo
    • Constructor Detail

      • CategoriesResource

        public CategoriesResource()
    • Method Detail

      • findCategoriesByName

        @GET
        @Path("")
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response findCategoriesByName​(@QueryParam("name") @DefaultValue("")
                                                              String name,
                                                              @QueryParam("offset") @DefaultValue("0")
                                                              int offset,
                                                              @QueryParam("limit") @DefaultValue("0")
                                                              int limit)
        This method will respond to a GET of the base resource URI to return categories based on query parameters.
        Parameters:
        name -
        offset -
        limit -
        Returns:
      • getCategory

        @GET
        @Path("{id}")
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response getCategory​(@PathParam("id")
                                                     int id)
        This method will respond to a GET method for (root)/{id} URIs to get a specific category.
        Parameters:
        id -
        Returns:
      • deleteCategory

        @DELETE
        @Path("{id}")
        public javax.ws.rs.core.Response deleteCategory​(@PathParam("id")
                                                        int id)
        This method responds to DELETE method calls to (root)/{id} URIs to delete a specific category.
        Parameters:
        id -
        Returns: