]> git.mxchange.org Git - addressbook-mailer-ejb.git/blobdiff - src/java/org/mxchange/jcontacts/contact/AddressbookContactSessionBean.java
Please cherry-pick:
[addressbook-mailer-ejb.git] / src / java / org / mxchange / jcontacts / contact / AddressbookContactSessionBean.java
index 111ef15441d76802bc5616da7a94ccf88c2456fd..4d37465feadb68f68afa8c4bf5bfbe770026d01e 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.jcontacts.contact;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -26,7 +25,6 @@ import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean;
 import org.mxchange.jcontacts.contact.utils.ContactUtils;
-import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 
 /**
@@ -48,39 +46,6 @@ public class AddressbookContactSessionBean extends BaseAddressbookDatabaseBean i
        public AddressbookContactSessionBean () {
        }
 
-       @Override
-       public Contact addContact (final Contact contact) throws ContactAlreadyAddedException {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addContact: contact={1} - CALLED!", this.getClass().getSimpleName(), contact)); //NOI18N
-
-               // Is the instance set?
-               if (null == contact) {
-                       // Throw NPE
-                       throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() != null) {
-                       // Should be null
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} - is not null", contact.getContactId())); //NOI18N
-               }
-
-               // Set created timestamp
-               contact.setContactCreated(new GregorianCalendar());
-
-               // Set all created timestamps, if instance is there
-               this.setAllContactPhoneEntriesCreated(contact);
-
-               // Persist it
-               this.getEntityManager().persist(contact);
-
-               // Flush it to get contactId set
-               this.getEntityManager().flush();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addContact: contact.contactId={1} after persisting - EXIT!", this.getClass().getSimpleName(), contact.getContactId())); //NOI18N
-
-               // Return it
-               return contact;
-       }
-
        @Override
        public Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException {
                // Log trace message