From: Roland Häder <roland@mxchange.org> Date: Sat, 3 Jun 2017 16:18:47 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e65f726d0b2e1e72765a5441ad406c05a516cd8c;p=jfinancials-ejb.git Continued a bit: - updated copyright - updated jar(s) Signed-off-by: Roland Häder <roland@mxchange.org> --- diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar index a0ca53b..6de9037 100644 Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index eaa2463..54a8731 100644 Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar index 7baf796..a60343d 100644 Binary files a/lib/jcontacts-lib.jar and b/lib/jcontacts-lib.jar differ diff --git a/lib/jcore-logger-lib.jar b/lib/jcore-logger-lib.jar index c804648..3e757cd 100644 Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 7f47a54..1c4dbec 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/jcountry-core.jar b/lib/jcountry-core.jar index 5cbad45..e91ed0a 100644 Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ diff --git a/lib/jcountry-lib.jar b/lib/jcountry-lib.jar index 066e9a1..d3f45e1 100644 Binary files a/lib/jcountry-lib.jar and b/lib/jcountry-lib.jar differ diff --git a/lib/jmailer-ee.jar b/lib/jmailer-ee.jar index 8452960..9b3912f 100644 Binary files a/lib/jmailer-ee.jar and b/lib/jmailer-ee.jar differ diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index 9587335..6f596cc 100644 Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ diff --git a/lib/jphone-lib.jar b/lib/jphone-lib.jar index 3c22799..aa0c7b7 100644 Binary files a/lib/jphone-lib.jar and b/lib/jphone-lib.jar differ diff --git a/lib/jproduct-core.jar b/lib/jproduct-core.jar index 081cf1f..58afdc5 100644 Binary files a/lib/jproduct-core.jar and b/lib/jproduct-core.jar differ diff --git a/lib/juser-core.jar b/lib/juser-core.jar index aa8a723..fd411f9 100644 Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ diff --git a/lib/juser-lib.jar b/lib/juser-lib.jar index e845d87..38a2d37 100644 Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ diff --git a/src/java/log4j2.xml b/src/java/log4j2.xml index 3741761..98e9a65 100644 --- a/src/java/log4j2.xml +++ b/src/java/log4j2.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- -Copyright (C) 2016 Roland Häder +Copyright (C) 2016, 2017 Roland Häder This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jcontacts/contact/FinancialsAdminContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/FinancialsAdminContactSessionBean.java index 6c0e00c..38bb9b0 100644 --- a/src/java/org/mxchange/jcontacts/contact/FinancialsAdminContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/FinancialsAdminContactSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java index 18ca4ff..48ef52f 100644 --- a/src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jcontacts/phone/FinancialsAdminContactPhoneSessionBean.java b/src/java/org/mxchange/jcontacts/phone/FinancialsAdminContactPhoneSessionBean.java index 5244ad1..0d85909 100644 --- a/src/java/org/mxchange/jcontacts/phone/FinancialsAdminContactPhoneSessionBean.java +++ b/src/java/org/mxchange/jcontacts/phone/FinancialsAdminContactPhoneSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jcountry/data/FinancialsCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/FinancialsCountrySingletonBean.java index 99f2075..11810ce 100644 --- a/src/java/org/mxchange/jcountry/data/FinancialsCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/data/FinancialsCountrySingletonBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jfinancials/beans/resendlink/FinancialsResendLinkSessionBean.java b/src/java/org/mxchange/jfinancials/beans/resendlink/FinancialsResendLinkSessionBean.java index 149ce0a..1e88731 100644 --- a/src/java/org/mxchange/jfinancials/beans/resendlink/FinancialsResendLinkSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/resendlink/FinancialsResendLinkSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -18,13 +18,21 @@ package org.mxchange.jfinancials.beans.resendlink; import java.text.MessageFormat; import java.util.Locale; +import javax.ejb.EJB; import javax.ejb.EJBException; import javax.ejb.Stateless; import javax.mail.Address; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; +import org.mxchange.jusercore.exceptions.UserStatusLockedException; +import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; +import org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote; +import org.mxchange.jusercore.model.user.LoginUser; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.status.UserAccountStatus; /** @@ -40,8 +48,20 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsDatabaseBean */ private static final long serialVersionUID = 71_546_726_857_195_360L; + /** + * Registration bean + */ + @EJB + private UserRegistrationSessionBeanRemote registerBean; + + /** + * Regular user bean + */ + @EJB + private UserSessionBeanRemote userBean; + @Override - public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) { + public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) throws UserNotFoundException, UserStatusLockedException, UserStatusConfirmedException { // Log trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: user={1},locale={2},baseUrl={3} - CALLED!", this.getClass().getSimpleName(), user, locale, baseUrl)); //NOI18N @@ -55,25 +75,38 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsDatabaseBean } else if (user.getUserId() < 1) { // Invalid id number throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N + } else if (!this.userBean.ifUserExists(user)) { + // User not found + throw new UserNotFoundException(user); } else if (user.getUserConfirmKey() == null) { // Throw NPE again throw new NullPointerException("this.userConfirmKey is null"); //NOI18N - } else if (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED) { + } else if (user.getUserAccountStatus() == UserAccountStatus.CONFIRMED) { + // User account status is not UNCONFIRMED + throw new UserStatusConfirmedException(user); + } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) { // User account status is not UNCONFIRMED - throw new IllegalStateException(MessageFormat.format("Account status from user.userId={0} is not UNCONFIRMED:{1}", user.getUserId(), user.getUserAccountStatus())); //NOI18N + throw new UserStatusLockedException(user); } else if (null == locale) { // Locale should be set throw new NullPointerException("locale is null"); //NOI18N } - // @TODO Unfinished: Change key + merge database + // Get new registration key + String confirmationKey = this.registerBean.generateConfirmationKey(user); + + // Get managed instance + User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId()); + + // Set it in user + managedUser.setUserConfirmKey(confirmationKey); // Init variable Address emailAddress; try { // Create email address and set - emailAddress = new InternetAddress(user.getUserContact().getContactEmailAddress()); + emailAddress = new InternetAddress(managedUser.getUserContact().getContactEmailAddress()); } catch (final AddressException ex) { // Throw again throw new EJBException(ex); diff --git a/src/java/org/mxchange/jfinancials/mailer/model/delivery/FinancialsEmailDeliveryMessageBean.java b/src/java/org/mxchange/jfinancials/mailer/model/delivery/FinancialsEmailDeliveryMessageBean.java index 47d21b6..a562f4f 100644 --- a/src/java/org/mxchange/jfinancials/mailer/model/delivery/FinancialsEmailDeliveryMessageBean.java +++ b/src/java/org/mxchange/jfinancials/mailer/model/delivery/FinancialsEmailDeliveryMessageBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jmailer/config.properties b/src/java/org/mxchange/jmailer/config.properties index 45b88a7..5a02e31 100644 --- a/src/java/org/mxchange/jmailer/config.properties +++ b/src/java/org/mxchange/jmailer/config.properties @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Roland H\u00e4der +# Copyright (C) 2016, 2017 Roland H\u00e4der # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java index 2b02301..a6b0014 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java index 9163741..c800c75 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java index 89543a2..7936651 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsPhoneSessionBean.java index 2dbd0b7..cab2cc2 100644 --- a/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsPhoneSessionBean.java +++ b/src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsPhoneSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jusercore/model/email_address/FinancialsUserEmailChangeSessionBean.java b/src/java/org/mxchange/jusercore/model/email_address/FinancialsUserEmailChangeSessionBean.java index 1ae2134..87a0e48 100644 --- a/src/java/org/mxchange/jusercore/model/email_address/FinancialsUserEmailChangeSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/email_address/FinancialsUserEmailChangeSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jusercore/model/login/FinancialsUserLoginSessionBean.java b/src/java/org/mxchange/jusercore/model/login/FinancialsUserLoginSessionBean.java index f7dd1d3..d56e318 100644 --- a/src/java/org/mxchange/jusercore/model/login/FinancialsUserLoginSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/login/FinancialsUserLoginSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jusercore/model/register/FinancialsUserRegistrationSessionBean.java b/src/java/org/mxchange/jusercore/model/register/FinancialsUserRegistrationSessionBean.java index 1f1827c..ac57a4e 100644 --- a/src/java/org/mxchange/jusercore/model/register/FinancialsUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/register/FinancialsUserRegistrationSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java index fbb10ea..6771ae3 100644 --- a/src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -24,8 +24,8 @@ import javax.ejb.Stateless; import javax.mail.Address; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; -import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean; import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNotFoundException; diff --git a/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java index bbfabd4..32a8ab1 100644 --- a/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java b/src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java index 403fd5e..9cda8e5 100644 --- a/src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Roland Häder + * Copyright (C) 2016, 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as