]> git.mxchange.org Git - jcustomer-lib.git/blobdiff - src/org/mxchange/jcustomercore/model/customer/CustomerSessionBeanRemote.java
Continued a bit:
[jcustomer-lib.git] / src / org / mxchange / jcustomercore / model / customer / CustomerSessionBeanRemote.java
index 9188a56518596f2f7e231a64b49be277c21540da..ce227e55a55127090daf50067846fe1e0f712f7b 100644 (file)
@@ -1,62 +1,75 @@
-/*\r
- * Copyright (C) 2016 Roland Haeder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.jcustomercore.model.customer;\r
-\r
-import java.io.Serializable;\r
-import javax.ejb.Remote;\r
-import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;\r
-\r
-/**\r
- * An interface for customer beans\r
- * <p>\r
- * @author Roland Haeder<roland@mxchange.org>\r
- */\r
-@Remote\r
-public interface CustomerSessionBeanRemote extends Serializable {\r
-\r
-       /**\r
-        * Fills given customer instance with all available data\r
-        * <p>\r
-        * @param customer Initial Customer instance\r
-        * <p>\r
-        * @return Prepared Customer instance\r
-        */\r
-       Customer fillCustomerData (final Customer customer);\r
-\r
-       /**\r
-        * Checks if the the given customer instance is already registered\r
-        * <p>\r
-        * @param customer Customer instance\r
-        * <p>\r
-        * @return Whether the customer is already registered\r
-        */\r
-       boolean isReqistered (final Customer customer);\r
-\r
-       /**\r
-        * Registers the customer and creates a customer number after succesful\r
-        * persisting.\r
-        * <p>\r
-        * @param customer Initial customer instance\r
-        * <p>\r
-        * @return Prepared Customer instance\r
-        * <p>\r
-        * @throws\r
-        * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException If\r
-        * the customer is already registered.\r
-        */\r
-       Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException;\r
-}\r
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcustomercore.model.customer;
+
+import java.io.Serializable;
+import javax.ejb.Remote;
+import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;
+import org.mxchange.jcustomercore.exceptions.CustomerNotFoundException;
+
+/**
+ * An interface for customer beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface CustomerSessionBeanRemote extends Serializable {
+
+       /**
+        * Fills given customer instance with all available data
+        * <p>
+        * @param customer Initial Customer instance
+        * <p>
+        * @return Prepared Customer instance
+        */
+       Customer fillCustomerData (final Customer customer);
+
+       /**
+        * Tries to find a customer with given id number (not customer number). If
+        * not found, an exception is thrown.
+        * <p>
+        * @param customerId Customer id
+        * <p>
+        * @return Valid customer instance
+        * <p>
+        * @throws CustomerNotFoundException If a customer cannot be found
+        */
+       Customer findCustomerById (final Long customerId) throws CustomerNotFoundException;
+
+       /**
+        * Checks if the the given customer instance is already registered
+        * <p>
+        * @param customer Customer instance
+        * <p>
+        * @return Whether the customer is already registered
+        */
+       boolean isRegistered (final Customer customer);
+
+       /**
+        * Registers the customer and creates a customer number after succesful
+        * persisting.
+        * <p>
+        * @param customer Initial customer instance
+        * <p>
+        * @return Prepared Customer instance
+        * <p>
+        * @throws CustomerAlreadyRegisteredException If the customer is already
+        * registered.
+        */
+       Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException;
+
+}