]> git.mxchange.org Git - jcontacts-business-lib.git/commitdiff
added business method addContact()
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 14:48:17 +0000 (16:48 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 14:48:17 +0000 (16:48 +0200)
src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java

index 85e241b6d340b9cfde8831aca90a5f51b6c1728b..d03546382cb0bcc5f8e7c8d912a00ae264ce2039 100644 (file)
@@ -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
+        * <p>
+        * @return Updated contact instance
+        * <p>
+        * @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.
         * <p>