Class CustomersResource
- java.lang.Object
-
- ejava.examples.ejbwar.customer.rs.CustomersResource
-
@Path("customers") public class CustomersResource extends Object
This class provides a JAX-RS resource for interfacing with customer methods.
-
-
Field Summary
Fields Modifier and Type Field Description private CustomerMgmtLocal
ejb
private static org.slf4j.Logger
logger
private javax.ws.rs.core.Request
request
private javax.ws.rs.core.UriInfo
uriInfo
-
Constructor Summary
Constructors Constructor Description CustomersResource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
addCustomer(Customer customer)
javax.ws.rs.core.Response
deleteCustomer(int id)
javax.ws.rs.core.Response
findCustomersByName(String firstName, String lastName, int offset, int limit)
javax.ws.rs.core.Response
getCustomer(int id)
static javax.ws.rs.core.Response.ResponseBuilder
serverError(org.slf4j.Logger log, String context, Exception ex)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
ejb
@Inject private CustomerMgmtLocal ejb
-
request
@Context private javax.ws.rs.core.Request request
-
uriInfo
@Context private javax.ws.rs.core.UriInfo uriInfo
-
-
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)
-
-