From: Roland Häder Date: Mon, 25 Apr 2016 13:23:02 +0000 (+0200) Subject: added business method allCustomers() as this is generic X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=93c76ce0d031b9c8c51135dfaa9221cb8a8f6e12;p=jcustomer-lib.git added business method allCustomers() as this is generic --- diff --git a/src/org/mxchange/jcustomercore/model/customer/CustomerSessionBeanRemote.java b/src/org/mxchange/jcustomercore/model/customer/CustomerSessionBeanRemote.java index 9188a56..09e02dc 100644 --- a/src/org/mxchange/jcustomercore/model/customer/CustomerSessionBeanRemote.java +++ b/src/org/mxchange/jcustomercore/model/customer/CustomerSessionBeanRemote.java @@ -1,62 +1,72 @@ -/* - * Copyright (C) 2016 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcustomercore.model.customer; - -import java.io.Serializable; -import javax.ejb.Remote; -import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException; - -/** - * An interface for customer beans - *

- * @author Roland Haeder - */ -@Remote -public interface CustomerSessionBeanRemote extends Serializable { - - /** - * Fills given customer instance with all available data - *

- * @param customer Initial Customer instance - *

- * @return Prepared Customer instance - */ - Customer fillCustomerData (final Customer customer); - - /** - * Checks if the the given customer instance is already registered - *

- * @param customer Customer instance - *

- * @return Whether the customer is already registered - */ - boolean isReqistered (final Customer customer); - - /** - * Registers the customer and creates a customer number after succesful - * persisting. - *

- * @param customer Initial customer instance - *

- * @return Prepared Customer instance - *

- * @throws - * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException If - * the customer is already registered. - */ - Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException; -} +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcustomercore.model.customer; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Remote; +import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException; + +/** + * An interface for customer beans + *

+ * @author Roland Haeder + */ +@Remote +public interface CustomerSessionBeanRemote extends Serializable { + + /** + * Fills given customer instance with all available data + *

+ * @param customer Initial Customer instance + *

+ * @return Prepared Customer instance + */ + Customer fillCustomerData (final Customer customer); + + /** + * Checks if the the given customer instance is already registered + *

+ * @param customer Customer instance + *

+ * @return Whether the customer is already registered + */ + boolean isReqistered (final Customer customer); + + /** + * Registers the customer and creates a customer number after succesful + * persisting. + *

+ * @param customer Initial customer instance + *

+ * @return Prepared Customer instance + *

+ * @throws + * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException + * If the customer is already registered. + */ + Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException; + + /** + * Returns a list of all customers. This method should be used from + * administrative beans. + *

+ * @return A list of all customers + */ + List allCustomers (); + +}