From d2fec05858e3f3c90d294eaea8cf8f6cafc530d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 13 May 2016 11:37:33 +0200 Subject: [PATCH] Continued a bit: - added business method isEmailAddressRegistered() - added business method findContactByEmailAddress() --- .../contact/ContactSessionBeanRemote.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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. + *

+ * @param emailAddress Email address to check + *

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

+ * @param emailAddress Email address + *

+ * @return Contact instance + *

+ * @throws ContactNotFoundException If the contact was not found + */ + Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException; + } -- 2.39.2