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;
/**
* 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);
}