]> git.mxchange.org Git - jfinancials-lib.git/blobdiff - src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java
Continued:
[jfinancials-lib.git] / src / org / mxchange / addressbook / model / addressbook / AddressbookSessionBeanRemote.java
index b8f3c43e86ba7a1acadefa3829e0a196f4c43bc1..3ec1bcc883c94eb28004cad55e478175cf049c01 100644 (file)
@@ -19,6 +19,7 @@ package org.mxchange.addressbook.model.addressbook;
 import java.io.Serializable;
 import java.util.List;
 import javax.ejb.Remote;
+import org.mxchange.addressbook.exceptions.AddressbookNameAlreadyUsedException;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -33,7 +34,29 @@ public interface AddressbookSessionBeanRemote extends Serializable {
         * Some "getter" for a list of address books the logged-in user has created
         * <p>
         * @param loggedInUser Logged-in user
+        * <p>
         * @return List of all address books
         */
-       public List<Addressbook> getUsersList (final User loggedInUser);
+       public List<Addressbook> getUsersList(final User loggedInUser);
+
+       /**
+        * Creates given address book by persisting it. A User instance must be set,
+        * else an exception is thrown.
+        * <p>
+        * @param addressbook Address book instance to create
+        * <p>
+        * @return Updated address book instance
+        * <p>
+        * @throws org.mxchange.addressbook.exceptions.AddressbookNameAlreadyUsedException If the address book's name has already been used by the user.
+        */
+       public Addressbook createAddressbook(final Addressbook addressbook) throws AddressbookNameAlreadyUsedException;
+
+       /**
+        * Checks if the given address book's name is already used by the user.
+        * <p>
+        * @param addressbook Address bok instance to check
+        * <p>
+        * @return Whether the name has already been used by the user
+        */
+       public boolean isAddressbookNameUsed(final Addressbook addressbook);
 }