]> git.mxchange.org Git - jmailer-ee.git/commitdiff
this method was a bad idea anyway, to much unflexible
authorRoland Häder <roland@mxchange.org>
Tue, 17 May 2016 08:32:47 +0000 (10:32 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 17 May 2016 08:32:47 +0000 (10:32 +0200)
src/org/mxchange/jmailee/model/delivery/BaseMailer.java
src/org/mxchange/jmailee/model/delivery/DeliverableEmail.java

index 9113fc60eb9dd1439594855841f8ed8a7643266f..d7645dc920596806cd40eb43bae332fdfc248025 100644 (file)
@@ -18,8 +18,6 @@ package org.mxchange.jmailee.model.delivery;
 
 import java.text.MessageFormat;
 import java.util.Date;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
 import javax.mail.MessagingException;
 import javax.mail.Session;
 import javax.mail.Transport;
@@ -30,7 +28,6 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 
 /**
  * An email class for sending out mails from templates
@@ -66,47 +63,6 @@ public abstract class BaseMailer implements DeliverableEmail {
                }
        }
 
-       @Override
-       public void sendEmailChangeMail (final MessageProducer messageProducer, final ObjectMessage message, final ChangeableEmailAddress emailChange) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("sendEmailChangeMail: messageProducer={0},message={1},emailChange={2} - CALLED", messageProducer, message, emailChange)); //NOI18N
-
-               // All parameters + some sub objects must be set
-               if (null == messageProducer) {
-                       // Throw NPE
-                       throw new NullPointerException("messageProducer is null"); //NOI18N
-               } else if (null == message) {
-                       // Throw NPE again
-                       throw new NullPointerException("message is null"); //NOI18N
-               } else if (null == emailChange) {
-                       // ... and again ...
-                       throw new NullPointerException("emailChange is null"); //NOI18N
-               } else if (emailChange.getEmailChangeUser() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("emailChange.emailChangeUser is null"); //NOI18N
-               } else if (emailChange.getEmailChangeUser().getUserId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("emailChange.emailChangeUser.userId is null"); //NOI18N
-               } else if (emailChange.getEmailChangeUser().getUserId() < 1) {
-                       // Not valid id
-                       throw new IllegalArgumentException(MessageFormat.format("emailChange.emailChangeUser.userId={0} is invalid.", emailChange.getEmailChangeUser().getUserId())); //NOI18N
-               } else if (emailChange.getEmailChangeUser().getUserContact() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("emailChange.emailChangeUser.userContact is null"); //NOI18N
-               } else if (emailChange.getEmailChangeUser().getUserContact().getContactId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("emailChange.emailChangeUser.userContact.contactId is null"); //NOI18N
-               } else if (emailChange.getEmailChangeUser().getUserContact().getContactId() < 1) {
-                       // Not valid id
-                       throw new IllegalArgumentException(MessageFormat.format("emailChange.emailChangeUser.userContact.contactId={0} is invalid.", emailChange.getEmailChangeUser().getUserContact().getContactId())); //NOI18N
-               } else if (emailChange.getEmailAddress().trim().isEmpty()) {
-                       // Email address is empty
-                       throw new IllegalArgumentException("emailChange.emaiLAddress is empty."); //NOI18N
-               }
-
-               throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-       }
-
        /**
         * Getter for logger bean
         * <p>
@@ -120,11 +76,11 @@ public abstract class BaseMailer implements DeliverableEmail {
         * Sends an email to given email address with subject line.
         * <p>
         * @param emailAddress Email address for recipient
-        * @param subjectLine  Subject line
-        * @param body         Body part
-        * @param mailSession  Corresponding mail session to use
+        * @param subjectLine Subject line
+        * @param body Body part
+        * @param mailSession Corresponding mail session to use
         * <p>
-        * @throws NamingException    If the resource cannot be found
+        * @throws NamingException If the resource cannot be found
         * @throws MessagingException If something happened on message delivery
         */
        protected void sendMail (final String emailAddress, final String subjectLine, final String body, final Session mailSession) throws NamingException, MessagingException {
index 0d7440630df090238006bb1826b081def3d9b755..0cc7685402e8ffa568acef1fa39ccc549859d081 100644 (file)
@@ -17,9 +17,6 @@
 package org.mxchange.jmailee.model.delivery;
 
 import java.io.Serializable;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 
 /**
  * An interface for email delivery classes
@@ -28,13 +25,4 @@ import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
  */
 public interface DeliverableEmail extends Serializable {
 
-       /**
-        * Sends out an email-change mail to the attached user's email address
-        * <p>
-        * @param messageProducer Message product
-        * @param message         Message object
-        * @param emailChange     Email change instance
-        */
-       void sendEmailChangeMail (final MessageProducer messageProducer, final ObjectMessage message, final ChangeableEmailAddress emailChange);
-
 }