2 * Copyright (C) 2016 - 2020 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcustomercore.model.customer;
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Remote;
22 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
23 import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException;
26 * Administrative interface for customer beans
28 * @author Roland Häder<roland@mxchange.org>
31 public interface AdminCustomerSessionBeanRemote extends Serializable {
34 * Links customer instance with included contact instance and returns an
35 * updated customer instance after success.
37 * @param customer Customer with included contact insrtance
39 * @return Updated customer instance
42 * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException
43 * If the customer is already there
45 Customer linkCustomer (final Customer customer) throws CustomerAlreadyRegisteredException;
48 * Returns a list of all customers. This method should be used from
49 * administrative beans.
51 * @return A list of all customers
53 List<Customer> allCustomers ();
56 * Adds the given customer instance to database and returns an updated
59 * @param customer Customer instance
61 * @return Updated customer
64 * org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException
65 * If the customer is already registered.
66 * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException If
67 * the given contact data is already added.
69 Customer addCustomer (final Customer customer) throws CustomerAlreadyRegisteredException, ContactAlreadyAddedException;
72 * Creates a new (free) customer number.
74 * @return Free customer number (no free number should not happen)
76 String createCustomerNumber ();