Modifier and Type | Field and Description |
---|---|
private CustomerMgmtLocal |
ejb |
private static org.apache.commons.logging.Log |
log |
private Request |
request |
private UriInfo |
uriInfo |
Constructor and Description |
---|
CustomersResource() |
Modifier and Type | Method and Description |
---|---|
Response |
addCustomer(Customer customer) |
Response |
deleteCustomer(int id) |
Response |
findCustomersByName(String firstName,
String lastName,
int offset,
int limit) |
Response |
getCustomer(int id) |
static Response.ResponseBuilder |
serverError(org.apache.commons.logging.Log log,
String context,
Exception ex) |
private static final org.apache.commons.logging.Log log
@Inject private CustomerMgmtLocal ejb
@POST @Path(value="") @Consumes(value="application/xml") @Produces(value="application/xml") public Response addCustomer(Customer customer)
@GET @Path(value="") @Produces(value="application/xml") public Response findCustomersByName(@QueryParam(value="firstName") String firstName, @QueryParam(value="lastName") String lastName, @QueryParam(value="offset") @DefaultValue(value="0") int offset, @QueryParam(value="limit") @DefaultValue(value="0") int limit)
@GET @Path(value="{id}") @Produces(value="application/xml") public Response getCustomer(@PathParam(value="id") int id)
@DELETE @Path(value="{id}") @Produces(value="application/xml") public Response deleteCustomer(@PathParam(value="id") int id)
public static Response.ResponseBuilder serverError(org.apache.commons.logging.Log log, String context, Exception ex)
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.