Package com.bookstore.service.workflow

Examples of com.bookstore.service.workflow.CustomerActivity.authenticate()


  public List<OrderRepresentation> getOrders(
      @QueryParam("username") String username,
      @QueryParam("password") String password) {
    OrderActivity orderActivity = new OrderActivity();
    CustomerActivity customerActivity = new CustomerActivity();
    String customerId = customerActivity.authenticate(username, password);
    return orderActivity.getOrders(customerId);
  }
 
  @GET
  @Produces({MediaType.APPLICATION_JSON})
View Full Code Here


      @QueryParam("username") String username,
      @QueryParam("password") String password) {
    OrderActivity orderActivity = new OrderActivity();
    CustomerActivity customerActivity = new CustomerActivity();
    // If they're authorized, return the results
    String customerId = customerActivity.authenticate(username, password);
    if (customerId != null) {
      return Response.ok(orderActivity.getOrder(id, customerId)).build();
    }
    // If they aren't authorized, return unauthorized
    return Response.status(Status.UNAUTHORIZED).build();
View Full Code Here

      @QueryParam("username") String username,
      @QueryParam("password") String password) {
    OrderActivity orderActivity = new OrderActivity();
    CustomerActivity customerActivity = new CustomerActivity();
    // If they're authorized, return the results
    String customerId = customerActivity.authenticate(username, password);
    if (customerId != null) {
      return Response.ok(orderActivity.createOrder(customerId)).build();
    }
    return Response.status(Status.UNAUTHORIZED).build();
  }
View Full Code Here

      @QueryParam("password") String password,
      OrderRepresentation orderRequest) {
    OrderActivity orderActivity = new OrderActivity();
    CustomerActivity customerActivity = new CustomerActivity();
    // If they're authorized, return the results
    String customerId = customerActivity.authenticate(username, password);
    if (customerId != null) {
      return Response.ok(orderActivity.updateOrder(id, orderRequest.getCustomer(), orderRequest.getBillingAddress(),
          orderRequest.getShippingAddress(), orderRequest.getCreditCard(), orderRequest.getShippingCompany(),
          orderRequest.getLines(), orderRequest.isPaymentReceived(), orderRequest.getOrderState())).build();
    }
View Full Code Here

      @QueryParam("password") String password) {
   
    OrderActivity orderActivity = new OrderActivity();
    CustomerActivity customerActivity = new CustomerActivity();
    // If they're authorized, return the results
    String customerId = customerActivity.authenticate(username, password);
    if (customerId != null) {
      return Response.ok(orderActivity.addBookToOrder(customerId, bookId)).build();
    }
    return Response.status(Status.UNAUTHORIZED).build();
  }
View Full Code Here

 
  @GET
  @Path("/auth")
  public Response customerAuth(@QueryParam("username") String username, @QueryParam("password") String password) {
    CustomerActivity customerActivity = new CustomerActivity();
    if (customerActivity.authenticate(username, password) == null) {
      return Response.status(Status.UNAUTHORIZED).build();
    }
    return Response.status(Status.OK).build();
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.