X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Fpizzaapplication%2Fbeans%2Fcustomer%2FPizzaAdminCustomerWebRequestBean.java;h=0c16549d1112d5ec0009c8fb8dc74a4784c2548f;hb=e3e16631dafe1f66f9225208dd375e4c1e365818;hp=a8bc117cdf417e4cd66b6184b23b5ef88b5ae874;hpb=61c7ad8eb569de12dbad99ce9e37b78de291ec3b;p=pizzaservice-war.git diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java index a8bc117c..0c16549d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java @@ -30,15 +30,16 @@ import javax.naming.NamingException; import org.mxchange.jcontacts.contact.Contact; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; -import org.mxchange.jcustomercore.events.AdminAddedCustomerEvent; -import org.mxchange.jcustomercore.events.CustomerAdminAddedEvent; +import org.mxchange.jcustomercore.events.customer.added.AdminAddedCustomerEvent; +import org.mxchange.jcustomercore.events.customer.added.CustomerAdminAddedEvent; import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException; import org.mxchange.jcustomercore.model.customer.Customer; import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus; +import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController; -import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController; import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote; import org.mxchange.pizzaapplication.model.customer.PizzaCustomer; +import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController; /** * Administrative customer bean (controller) @@ -47,7 +48,7 @@ import org.mxchange.pizzaapplication.model.customer.PizzaCustomer; */ @Named ("adminCustomerController") @RequestScoped -public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRequestController { +public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implements PizzaAdminCustomerWebRequestController { /** * Serial number @@ -69,7 +70,7 @@ public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRe * Admin helper instance */ @Inject - private PizzaAdminWebRequestController adminHelper; + private PizzaWebRequestController adminHelper; /** * An event being fired when an administrator has added a new customer @@ -94,7 +95,7 @@ public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRe Context context = new InitialContext(); // Try to lookup - this.adminCustomerBean = (PizzaAdminCustomerSessionBeanRemote) context.lookup("java:global/PizzaService-ejb/admincustomer!org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote"); //NOI18N + this.adminCustomerBean = (PizzaAdminCustomerSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/admincustomer!org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e); @@ -159,22 +160,22 @@ public class PizzaAdminCustomerWebRequestBean implements PizzaAdminCustomerWebRe // Parameters must be valid if (null == customer) { // Throw NPE - throw new NullPointerException("customer is null"); + throw new NullPointerException("customer is null"); //NOI18N } else if (customer.getCustomerId() == null) { // Throw again ... - throw new NullPointerException("customer.customerId is null"); + throw new NullPointerException("customer.customerId is null"); //NOI18N } else if (customer.getCustomerId() < 1) { // Invalid id number - throw new IllegalArgumentException(MessageFormat.format("customer.customerId={0} is not valid", customer.getCustomerId())); + throw new IllegalArgumentException(MessageFormat.format("customer.customerId={0} is not valid", customer.getCustomerId())); //NOI18N } else if (customer.getCustomerContact() == null) { // Throw NPE again - throw new NullPointerException("customer.customerContact is null"); + throw new NullPointerException("customer.customerContact is null"); //NOI18N } else if (customer.getCustomerContact().getContactId() == null) { // .. and again - throw new NullPointerException("customer.customerContact.contactId is null"); + throw new NullPointerException("customer.customerContact.contactId is null"); //NOI18N } else if (customer.getCustomerContact().getContactId() < 1) { // Invalid id - throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId())); + throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId())); //NOI18N } // @TODO Set all data