From 8538b43cb3660e69cf86b9f631f3e4ef6cf5c459 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 27 Apr 2016 16:48:17 +0200 Subject: [PATCH] added business method addContact() --- .../contact/ContactSessionBeanRemote.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java index 85e241b..d035463 100644 --- a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java +++ b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java @@ -19,6 +19,7 @@ package org.mxchange.jcontacts.contact; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; +import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; /** @@ -29,6 +30,20 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException; @Remote public interface ContactSessionBeanRemote extends Serializable { + /** + * Adds (persists) given contact instance, if not found. If successfull, the + * field contactId contains the running number, otherwise an exception is + * thrown. + * + * @param contact Contact to be added + *

+ * @return Updated contact instance + *

+ * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException + * Contact already found + */ + Contact addContact (final Contact contact) throws ContactAlreadyAddedException; + /** * Checks if the given contact can be found by checking the whole list. *

-- 2.39.5