]> git.mxchange.org Git - jfinancials-lib.git/blob - src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java
4af9c91f2ce30ecd896a8c1639481118d7c351e1
[jfinancials-lib.git] / src / org / mxchange / addressbook / model / addressbook / AddressbookSessionBeanRemote.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.addressbook.model.addressbook;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import javax.ejb.Remote;
22 import org.mxchange.addressbook.exceptions.AddressbookNameAlreadyUsedException;
23 import org.mxchange.jusercore.model.user.User;
24
25 /**
26  * A remote session interface for addressbook handling
27  * <p>
28  * @author Roland Haeder
29  */
30 @Remote
31 public interface AddressbookSessionBeanRemote extends Serializable {
32
33         /**
34          * Some "getter" for a list of address books the logged-in user has created
35          * <p>
36          * @param loggedInUser Logged-in user
37          * <p>
38          * @return List of all address books
39          */
40         public List<Addressbook> getUsersList (final User loggedInUser);
41
42         /**
43          * Creates given address book by persisting it. A User instance must be set,
44          * else an exception is thrown.
45          * <p>
46          * @param addressbook Address book instance to create
47          * <p>
48          * @return Updated address book instance
49          * <p>
50          * @throws
51          * org.mxchange.addressbook.exceptions.AddressbookNameAlreadyUsedException
52          * If the address book's name has already been used by the user.
53          */
54         public Addressbook createAddressbook (final Addressbook addressbook) throws AddressbookNameAlreadyUsedException;
55
56         /**
57          * Checks if the given address book's name is already used by the user.
58          * <p>
59          * @param addressbook Address bok instance to check
60          * <p>
61          * @return Whether the name has already been used by the user
62          */
63         public boolean isAddressbookNameUsed (final Addressbook addressbook);
64 }