Class CustomersResource


  • @Path("customers")
    public class CustomersResource
    extends Object
    This class provides a JAX-RS resource for interfacing with customer methods.
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • request

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

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

      • CustomersResource

        public CustomersResource()
    • Method Detail

      • addCustomer

        @POST
        @Path("")
        @Consumes({"application/xml","application/json"})
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response addCustomer​(Customer customer)
      • findCustomersByName

        @GET
        @Path("")
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response findCustomersByName​(@QueryParam("firstName")
                                                             String firstName,
                                                             @QueryParam("lastName")
                                                             String lastName,
                                                             @QueryParam("offset") @DefaultValue("0")
                                                             int offset,
                                                             @QueryParam("limit") @DefaultValue("0")
                                                             int limit)
      • getCustomer

        @GET
        @Path("{id}")
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response getCustomer​(@PathParam("id")
                                                     int id)
      • deleteCustomer

        @DELETE
        @Path("{id}")
        @Produces({"application/xml","application/json"})
        public javax.ws.rs.core.Response deleteCustomer​(@PathParam("id")
                                                        int id)
      • serverError

        public static javax.ws.rs.core.Response.ResponseBuilder serverError​(org.slf4j.Logger log,
                                                                            String context,
                                                                            Exception ex)