Class CustomersResource
- java.lang.Object
-
- ejava.examples.ejbwar.customer.rs.CustomersResource
-
@Path("customers") public class CustomersResource extends ObjectThis class provides a JAX-RS resource for interfacing with customer methods.
-
-
Field Summary
Fields Modifier and Type Field Description private CustomerMgmtLocalejbprivate static org.slf4j.Loggerloggerprivate javax.ws.rs.core.Requestrequestprivate javax.ws.rs.core.UriInfouriInfo
-
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.ResponseaddCustomer(Customer customer)javax.ws.rs.core.ResponsedeleteCustomer(int id)javax.ws.rs.core.ResponsefindCustomersByName(String firstName, String lastName, int offset, int limit)javax.ws.rs.core.ResponsegetCustomer(int id)static javax.ws.rs.core.Response.ResponseBuilderserverError(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)
-
-