import java.text.MessageFormat;
import java.util.List;
import javax.ejb.EJB;
+import javax.ejb.EJBException;
import javax.ejb.Stateless;
import javax.persistence.NoResultException;
-import javax.persistence.PersistenceException;
import javax.persistence.Query;
import org.mxchange.jcoreee.database.BaseDatabaseBean;
import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
throw new NullPointerException("emailAddress is null"); //NOI18N
} else if (!this.userBean.ifUserExists(emailAddress.getEmailChangeUser())) {
// User does not exist
- throw new PersistenceException(MessageFormat.format("Email change with id {0} does not exist.", emailAddress.getEmailChangeId())); //NOI18N
+ throw new EJBException(MessageFormat.format("Email change with id {0} does not exist.", emailAddress.getEmailChangeId())); //NOI18N
+ } else if (this.isEmailAddressEnqueued(emailAddress.getEmailAddress())) {
+ // Email address is already enqueued
+ throw new EJBException(MessageFormat.format("Email address {0} is already enqueued.", emailAddress.getEmailAddress()));
}
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
throw new IllegalArgumentException(MessageFormat.format("emailAddress.emailChangeId={0} is not valid.", emailAddress.getEmailChangeId())); //NOI18N
} else if (!this.userBean.ifUserExists(emailAddress.getEmailChangeUser())) {
// User does not exist
- throw new PersistenceException(MessageFormat.format("Email change with id {0} does not exist.", emailAddress.getEmailChangeId())); //NOI18N
+ throw new EJBException(MessageFormat.format("Email change with id {0} does not exist.", emailAddress.getEmailChangeId())); //NOI18N
+ } else if (!this.isEmailAddressEnqueued(emailAddress.getEmailAddress())) {
+ // Email address is not enqueued
+ throw new EJBException(MessageFormat.format("Email address {0} is not enqueued.", emailAddress.getEmailAddress()));
}
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.