]> git.mxchange.org Git - jcontacts-lib.git/blobdiff - src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java
updated own name and resources
[jcontacts-lib.git] / src / org / mxchange / jcontacts / contact / ContactSessionBeanRemote.java
index e79c1210c6b72cb168f2b8d1d96f64e4aeed8539..8203cc3313f5daf21d11421bd179d48f0c4314f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder<roland@mxchange.org>
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 package org.mxchange.jcontacts.contact;
 
 import java.io.Serializable;
+import java.util.List;
 import javax.ejb.Remote;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 
 /**
  * A remote interface for general contact purposes
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @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);
+
+       /**
+        * Checks if the given contact can be found by checking the whole list.
+        * <p>
+        * @param contact Contact instance to check
+        * <p>
+        * @return Whether the found instance or null
+        */
+       Contact lookupContact (final Contact contact);
+
+       /**
+        * Updates given contact data
+        * <p>
+        * @param contact Contact data to update
+        * @param isMobileUnlinked Whether a mobile entry has been unlinked in
+        * contact instance
+        * @param isLandlineUnlinked Whether a land-line entry has been unlinked in
+        * contact instance
+        * @param isFaxUnlinked Whether a fax entry has been unlinked in contact
+        * instance
+        * <p>
+        * @return Updated contact instance
+        */
+       Contact updateContactData (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked);
+
+       /**
+        * Updates given contact in database. Please note that the id number must be
+        * set. This method should also make sure that mobile, land-line and fix
+        * numbers are updated, too.
+        * <p>
+        * @param contact Contact to update
+        * <p>
+        * @return Updated contact instance
+        */
+       Contact updateContactData (final Contact contact);
+
+       /**
+        * Returns a list of all found contacts
+        * <p>
+        * @return A list of call contacts
+        */
+       List<Contact> getAllContacts ();
+
+       /**
+        * Returns a list of all registered email addresses.
+        * <p>
+        * @return A list of all email addresses
+        */
+       List<String> getEmailAddressList ();
+
        /**
         * Returns a contact instance which has the given id number.
         * <p>
@@ -39,4 +100,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;
+
 }