From: Roland Häder <roland@mxchange.org>
Date: Fri, 13 May 2016 09:37:33 +0000 (+0200)
Subject: Continued a bit:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d2fec05858e3f3c90d294eaea8cf8f6cafc530d7;p=jcontacts-lib.git

Continued a bit:
- added business method isEmailAddressRegistered()
- added business method findContactByEmailAddress()
---

diff --git a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java
index f0c93eb..d16b40e 100644
--- a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java
+++ b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java
@@ -30,6 +30,17 @@ import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 @Remote
 public interface ContactSessionBeanRemote extends Serializable {
 
+	/**
+	 * Checks whether the given email address is already registered. The email
+	 * address should be validated by EmailAddressValidator before calling this
+	 * method.
+	 * <p>
+	 * @param emailAddress Email address to check
+	 * <p>
+	 * @return Whether the email address is already registered
+	 */
+	boolean isEmailAddressRegistered (final String emailAddress);
+
 	/**
 	 * Adds (persists) given contact instance, if not found. If successfull, the
 	 * field contactId contains the running number, otherwise an exception is
@@ -104,4 +115,15 @@ public interface ContactSessionBeanRemote extends Serializable {
 	 */
 	Contact findContactById (final Long contactId) throws ContactNotFoundException;
 
+	/**
+	 * Returns a contact instance which has the given email address.
+	 * <p>
+	 * @param emailAddress Email address
+	 * <p>
+	 * @return Contact instance
+	 * <p>
+	 * @throws ContactNotFoundException If the contact was not found
+	 */
+	Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException;
+
 }