]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
addCategory/addProduct are no longer needed for public usage, the events do it now.
authorRoland Haeder <roland@mxchange.org>
Sat, 7 May 2016 14:30:40 +0000 (16:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 7 May 2016 14:32:33 +0000 (16:32 +0200)
src/java/org/mxchange/pizzaapplication/beans/category/PizzaCategoryWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/category/PizzaCategoryWebApplicationController.java
src/java/org/mxchange/pizzaapplication/beans/product/PizzaProductWebApplicationBean.java
src/java/org/mxchange/pizzaapplication/beans/product/PizzaProductWebApplicationController.java

index 9af316c12ffe66598f152295cb63bf0f899bfc04..d89f0f7d1bf668996d868ce2ab6a7ee27e01c42c 100644 (file)
@@ -51,12 +51,6 @@ public class PizzaCategoryWebApplicationBean implements PizzaCategoryWebApplicat
         */
        private List<Category> categories;
 
-       @Override
-       public void addCategory (final Category category) {
-               // Add the category
-               this.categories.add(category);
-       }
-
        @Override
        public void afterShopCategoryAdded (@Observes final AddedCategoryEvent event) {
                // Is all valid?
@@ -74,8 +68,8 @@ public class PizzaCategoryWebApplicationBean implements PizzaCategoryWebApplicat
                        throw new IllegalArgumentException(MessageFormat.format("event.addedCategory.categoryId={0} is not valid.", event.getAddedCategory().getCategoryId())); //NOI18N
                }
 
-               // Add it here, too.
-               this.addCategory(event.getAddedCategory());
+               // Add the category
+               this.categories.add(event.getAddedCategory());
        }
 
        @Override
index 886c061c3f997f684d4dd2139acd05d3004d73e9..21569b360b619a22dcd65b2450cd77da5194f75c 100644 (file)
@@ -29,13 +29,6 @@ import org.mxchange.jshopcore.model.category.Category;
  */
 public interface PizzaCategoryWebApplicationController extends Serializable {
 
-       /**
-        * Adds given category to the "cached" instance
-        * <p>
-        * @param category Category instance
-        */
-       void addCategory (final Category category);
-
        /**
         * Some "getter" for a linked list of all categories
         * <p>
index f90a5bc9a7dec9bdcf11f6b1dfdfaacfe101393c..a5ffce83628c18589260a6be5ce04b7337e41719 100644 (file)
@@ -50,15 +50,6 @@ public class PizzaProductWebApplicationBean implements PizzaProductWebApplicatio
         */
        private List<Product> availableProducts;
 
-       @Override
-       public void addProduct (final Product product) {
-               // Is the product available?
-               if (product.getProductAvailability()) {
-                       // Add it
-                       this.availableProducts.add(product);
-               }
-       }
-
        @Override
        public void afterShopProductAdded (@Observes final AddedProductEvent event) {
                // Is all valid?
@@ -76,8 +67,11 @@ public class PizzaProductWebApplicationBean implements PizzaProductWebApplicatio
                        throw new IllegalArgumentException(MessageFormat.format("event.addedProduct.productId={0} is not valid.", event.getAddedProduct().getProductId())); //NOI18N
                }
 
-               // Add it here, too.
-               this.addProduct(event.getAddedProduct());
+               // Is the product available?
+               if (event.getAddedProduct().getProductAvailability()) {
+                       // Add it
+                       this.availableProducts.add(event.getAddedProduct());
+               }
        }
 
        @Override
index 5d25598937b9cd35cdc11d00eb719a7a123c8187..3f8fcb31ca04db2e504ad429eb31e9ab4e8402e1 100644 (file)
@@ -29,13 +29,6 @@ import org.mxchange.jshopcore.model.product.Product;
  */
 public interface PizzaProductWebApplicationController extends Serializable {
 
-       /**
-        * Adds given product to the "cached" instance
-        * <p>
-        * @param product Product instance
-        */
-       void addProduct (final Product product);
-
        /**
         * Some "getter" for a linked list of only available products
         * <p>