]> 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 09e02dcb984d5bd2b9d4bc00ca2f3cacd25ff115..ce227e55a55127090daf50067846fe1e0f712f7b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * 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
 package org.mxchange.jcustomercore.model.customer;
 
 import java.io.Serializable;
-import java.util.List;
 import javax.ejb.Remote;
 import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;
+import org.mxchange.jcustomercore.exceptions.CustomerNotFoundException;
 
 /**
  * An interface for customer beans
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @Remote
 public interface CustomerSessionBeanRemote extends Serializable {
@@ -38,6 +38,18 @@ public interface CustomerSessionBeanRemote extends Serializable {
         */
        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>
@@ -45,7 +57,7 @@ public interface CustomerSessionBeanRemote extends Serializable {
         * <p>
         * @return Whether the customer is already registered
         */
-       boolean isReqistered (final Customer customer);
+       boolean isRegistered (final Customer customer);
 
        /**
         * Registers the customer and creates a customer number after succesful
@@ -55,18 +67,9 @@ public interface CustomerSessionBeanRemote extends Serializable {
         * <p>
         * @return Prepared Customer instance
         * <p>
-        * @throws
-        * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException
-        * If the customer is already registered.
+        * @throws 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.
-        * <p>
-        * @return A list of all customers
-        */
-       List<Customer> allCustomers ();
-
 }