From: Roland Häder <roland@mxchange.org>
Date: Wed, 27 Apr 2016 14:48:17 +0000 (+0200)
Subject: added business method addContact()
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8538b43cb3660e69cf86b9f631f3e4ef6cf5c459;p=jcontacts-business-lib.git

added business method addContact()
---

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
+	 * <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>