Ejemplo n.º 1
0
  @Override
  public void RemoveFromCart(String productReference) {
    EventStoreRepo eventStoreRepo = new EventStoreRepo();

    this.domainService.RemoveFromCart(productReference);

    Data data = new OrderDataFactory().getData("RemoveFromCart", productReference, 1);
    eventStoreRepo.sendEvent(data);
  }
Ejemplo n.º 2
0
  @Override
  public boolean AddToCart(String productReference) throws RemoteException {
    EventStoreRepo eventStoreRepo = new EventStoreRepo();

    boolean result = this.domainService.AddToCart(productReference);

    Data data = new OrderDataFactory().getData("AddToCart", productReference, 1);
    eventStoreRepo.sendEvent(data);

    return result;
  }
Ejemplo n.º 3
0
  @Override
  public SupplierStub.Product GetProduct(String productReference)
      throws AxisFault, RemoteException {
    EventStoreRepo eventStoreRepo = new EventStoreRepo();

    SupplierStub.Product result = this.domainService.GetProduct(productReference);

    Data data = new OrderDataFactory().getData("GetProduct", productReference, 0);
    eventStoreRepo.sendEvent(data);

    return result;
  }
Ejemplo n.º 4
0
  @Override
  public boolean ProcessOrder() throws AxisFault, RemoteException {
    EventStoreRepo eventStoreRepo = new EventStoreRepo();

    boolean result = this.domainService.ProcessOrder();

    for (CartItem item : this.domainService.GetCart("EUR")) {
      Data data =
          new OrderDataFactory()
              .getData("ProcessOrder", item.getProduct().getReference(), item.getQuantity());
      eventStoreRepo.sendEvent(data);
    }

    return result;
  }